/* Libro prenotazioni — stesso aspetto della pagina del libro: titolo blu, fasce azzurre, righe da quaderno. */
:root {
  --paper: #fdfdfb;
  --desk: #e9edf4;
  --ink: #24407e;
  --ink-soft: #4d6396;
  --band: #b4c1d6;
  --band-soft: #dbe2ee;
  --rule: #d5dce8;
  --rule-strong: #9eaecb;
  --text: #17202f;
  --muted: #5d6b82;
  --green: #1e8449;
  --green-soft: #e3f4ea;
  --orange: #c8610f;
  --orange-soft: #fdeedd;
  --red: #c0392b;
  --red-soft: #fbe6e3;
  --sheet: #ffffff;
  --shadow: 0 10px 30px rgba(20, 35, 70, .22);
  --radius: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--desk);
  color: var(--text);
  font: 16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
input, textarea, select { font-size: 16px; } /* niente zoom automatico su iPhone */
[hidden] { display: none !important; }

/* ---------- barra in alto ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top, 0px));
  background: var(--ink); color: #fff;
}
.top button {
  background: rgba(255,255,255,.12); border: 0; color: #fff; border-radius: 10px;
  min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
}
.top button:active { background: rgba(255,255,255,.28); }
.top .nav { font-size: 30px; line-height: 1; padding-bottom: 4px; }
.top .today { padding: 0 14px; font-weight: 600; }
.top .grow { flex: 1; }
.top svg { width: 22px; height: 22px; }

/* ---------- pagina del libro ---------- */
.book { max-width: 1500px; margin: 0 auto; padding: 12px 12px calc(96px + var(--safe-b)); }
.head { text-align: center; padding: 8px 4px 2px; }
.head h1 { margin: 0; color: var(--ink); font-size: clamp(30px, 8vw, 46px); font-weight: 700; letter-spacing: .5px; }
.head .month { color: var(--muted); font-size: 14px; text-transform: lowercase; }
.head .holiday { margin-top: 2px; color: var(--ink-soft); font-size: 17px; font-weight: 600; min-height: 1.2em; }
.head .holiday.red { color: var(--red); }
.head.red h1 { color: var(--red); }

.tabs { display: flex; gap: 8px; margin: 12px 0 10px; }
.tab {
  flex: 1; display: flex; align-items: center; gap: 10px; justify-content: center;
  border: 2px solid var(--band); background: var(--band-soft); color: var(--ink);
  border-radius: 12px 12px 4px 4px; padding: 8px 10px; min-height: 56px;
}
.tab svg { width: 30px; height: 30px; flex: none; }
.tab .label { font-weight: 800; letter-spacing: 1px; }
.tab .covers { font-size: 26px; font-weight: 800; line-height: 1; }
.tab .covers small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .5px; color: var(--muted); }
.tab.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs.single .tab { cursor: default; justify-content: center; gap: 16px; }
.tabs.single .tab .covers { font-size: 30px; }
.tab.on .covers small { color: #cfd9ee; }

.pages { display: block; }
.page {
  background: var(--paper); border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.12);
  overflow: hidden; margin-bottom: 16px;
}
.page.off { display: none; }
.page-tab { display: none; }

.strip { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.strip .slot { background: var(--band-soft); color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 14px; font-weight: 600; }
.strip .slot b { font-size: 15px; }
.strip .info { color: var(--muted); font-size: 14px; padding: 3px 4px; }
.strip .info.warn { color: var(--orange); font-weight: 600; }

/* intestazione colonne (come le fasce con le icone del libro) */
.cols, .line {
  display: grid;
  grid-template-columns: 62px minmax(110px, 1.25fr) minmax(90px, 1fr) 128px minmax(110px, 1.1fr) minmax(100px, 1fr) 64px 74px;
}
.cols { background: var(--band); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.cols > div { padding: 8px 6px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; border-left: 1px solid rgba(255,255,255,.45); }
.cols > div:first-child, .cols > button:first-child { border-left: 0; }
/* intestazioni che ordinano (COGNOME, NOME, TORTA, COPERTI; ORA = ordine normale) */
.cols > button.sortable { padding: 8px 6px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  border: 0; border-left: 1px solid rgba(255,255,255,.45); background: transparent; color: inherit; font: inherit; letter-spacing: inherit;
  text-transform: inherit; cursor: pointer; position: relative; }
.cols > button.sortable:hover { background: rgba(255,255,255,.16); }
.cols > button.sortable.on { background: var(--ink); }
.cols > button.sortable .arrow { font-size: 13px; line-height: 1; color: #ffd23f; }
.cols svg { width: 22px; height: 22px; opacity: .95; }

.line { min-height: 44px; border-bottom: 1px solid var(--rule); background: transparent; position: relative; }
.line > .c { padding: 9px 6px; border-left: 1px solid var(--rule-strong); overflow-wrap: anywhere; min-width: 0; }
.line > .c:first-child { border-left: 0; }
.line.empty { cursor: pointer; }
.line.empty:hover { background: #f3f6fb; }
.line.res { cursor: pointer; }
.line.res:hover { background: #f5f8fd; }
.c.time { white-space: nowrap; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; text-align: center; font-size: 17px; }
.c.name { font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.c.phone { font-variant-numeric: tabular-nums; color: #2b3445; }
.c.phone a { color: inherit; text-decoration: none; }
.c.req { text-transform: uppercase; font-size: 14px; color: #34405a; }
.c.cake { font-size: 14px; color: #6b3d00; }
.c.covers { text-align: center; font-size: 22px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.c.table { text-align: center; padding: 6px 4px; }
.tchip {
  display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 36px; padding: 2px 8px;
  border-radius: 10px; font-weight: 800; font-size: 19px; border: 2px solid var(--ink); background: #fff; color: var(--ink);
}
.tchip.none { border: 2px dashed var(--rule-strong); color: var(--muted); font-size: 13px; font-weight: 600; }
.tchip.turn { border-color: var(--orange); color: var(--orange); }
.warnmark { display: inline-block; margin-left: 6px; color: var(--red); font-size: 12px; font-weight: 700; text-transform: none; letter-spacing: 0; }
.dim { color: var(--muted); }

/* stati */
.line.st-annullata .c:not(.table) { color: #9aa3b2; text-decoration: line-through; }
.line.st-annullata .tchip { opacity: .4; }
.line.st-non_presentata { background: #f6f6f6; }
.line.st-non_presentata .c.name::after { content: " · NON VENUTO"; color: var(--red); font-size: 11px; }
.line.st-arrivata .c.time { box-shadow: inset 4px 0 0 var(--green); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; text-transform: uppercase; letter-spacing: .3px; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.cake { background: #fff1d6; color: #8a5300; }

/* giratavolo: riga agganciata sotto la prenotazione successiva dello stesso tavolo */
.turnband { background: var(--orange-soft); color: var(--orange); font-weight: 800; font-size: 13px; letter-spacing: .4px; padding: 3px 10px; border-top: 2px solid var(--orange); }
.turnband.bad { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.line.turnrow { background: #fffaf3; box-shadow: inset 6px 0 0 var(--orange); }
/* Giratavolo (Francesco 22/10): un tavolo che gira è UN riquadro; la riga di chi deve andare via è tutta gialla col pallino rosso. */
.turnblock { border: 3px solid var(--orange); border-radius: 10px; margin: 6px 4px; overflow: hidden; }
.turnblock .turnhead { background: var(--orange); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .5px; padding: 3px 10px; }
.turnblock .line:last-child { border-bottom: 0; }
.line.giraline, .line.giraline:hover { background: #fff1a6; }
.menu { display: grid; gap: 16px; }
.msec h3 { margin: 0 0 6px 4px; font-size: 12px; letter-spacing: .8px; color: #6b7487; }
.mlist { border: 1px solid var(--rule-strong); border-radius: 12px; overflow: hidden; background: #fff; }
.mitem { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 10px 14px; border: 0; border-top: 1px solid var(--rule); background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.mlist .mitem:first-child { border-top: 0; }
.mitem:hover { background: #f5f8fd; }
.mitem .mt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mitem .mt b { font-size: 17px; }
.mitem .mt small { font-size: 14px; color: #6b7487; }
.mitem .chev { font-size: 26px; color: #9aa3b2; line-height: 1; }
.mitem.danger .mt b { color: #c8161d; }
.turninfo { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 6px 12px; border: 0; border-top: 1px dashed var(--orange); background: #fff8ef; color: #8a4b00; font: 600 14px inherit; text-align: left; cursor: pointer; }
.turninfo .ti-l { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.turninfo .ti-t { font-weight: 800; font-variant-numeric: tabular-nums; }
.turninfo .ti-n { flex: 1; min-width: 0; }
.turninfo .ti-go { font-size: 13px; color: #b5651d; }
.line.nowline { box-shadow: inset 7px 0 0 #1f9d55; }
.line.nowtime .c.time .tt { color: #1f7a45; }
/* riquadro del tavolo che gira: margini come «imbottitura» del contenitore, così la striscia verde resta fuori e continua */
.turnwrap { padding: 6px 4px 6px 12px; }
.turnwrap.now { box-shadow: inset 7px 0 0 #1f9d55; }
.turnwrap > .turnblock { margin: 0; }
.bigtime { font-size: 20px; min-height: 44px; padding: 4px 10px; }
.testclock { min-height: 40px; padding: 0 10px; margin-right: 6px; flex: none; border-radius: 10px; border: 2px solid rgba(255,255,255,.5); background: rgba(255,255,255,.12); color: #fff; font: 800 16px inherit; font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; }
.testclock.fake { background: #ffd23f; border-color: #ffd23f; color: #3a2a00; }
.confirmq { font-size: 20px; line-height: 1.35; margin: 8px 0 4px; }
.confirmq .confirmsub { display: block; margin-top: 8px; font-size: 15px; color: #6b7487; }
.btn.big { min-height: 52px; min-width: 120px; font-size: 18px; }
.searchbar { display: flex; align-items: center; gap: 8px; width: calc(100% - 12px); margin: 0 6px 6px; min-height: 58px; padding: 0 14px; border: 5px solid #c8161d; border-radius: 12px; background: #fff; color: #4a5160; font: 600 18px inherit; cursor: pointer; text-align: left; }
.searchbar svg { width: 26px; height: 26px; color: #c8161d; }
.cancbtn { display: block; margin: 8px 6px; padding: 8px 12px; border: 0; background: none; color: #6b7487; font: 600 14px inherit; text-decoration: underline; cursor: pointer; }
.holdnote { margin-top: 3px; font-size: 13px; font-weight: 700; color: #b5651d; }
.line.flash, .line.flash.giraline { animation: flashrow 2.6s ease-out; }
@keyframes flashrow { 0%, 40% { background: #bfe3ff; box-shadow: inset 0 0 0 3px #2a6fd6; } 100% { background: inherit; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .line.flash { animation: none; box-shadow: inset 0 0 0 3px #2a6fd6; } }
.viewbar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 6px; }
.vbtn { min-height: 44px; border-radius: 10px; border: 2px solid var(--rule-strong); background: #fff; font: 700 15px inherit; color: inherit; cursor: pointer; }
.vbtn.on { background: var(--ink, #23356b); border-color: var(--ink, #23356b); color: #fff; }
.vbtn b { font-size: 17px; margin-left: 4px; }
.assignbox { border: 3px dashed #c8161d; border-radius: 10px; margin: 10px 4px 6px; overflow: hidden; }
.assignbox .assignhead { background: #fde7e7; color: #c8161d; font-weight: 800; font-size: 13px; letter-spacing: .5px; padding: 4px 10px; }
.assignbox .line:last-child { border-bottom: 0; }
.line .c.time { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.arrbox { width: 30px; height: 30px; border: 2px solid var(--rule-strong); border-radius: 6px; background: #fff; font: 800 18px/1 inherit; color: #fff; cursor: pointer; padding: 0; }
.arrbox.on { background: var(--green, #1d7a55); border-color: var(--green, #1d7a55); }
.empty-note.pad { padding: 16px 10px; }
.girapill { color: #c8161d; font-weight: 800; font-size: 13px; margin-left: 8px; white-space: nowrap; }

/* riga in scrittura (desktop: si scrive direttamente sulla riga vuota) */
.line.writing { background: #fffbe6; }
.line.writing input { width: 100%; border: 0; border-bottom: 2px solid var(--ink); background: transparent; padding: 4px 2px; min-width: 0; outline: none; }
.line.writing input.bad { border-bottom-color: var(--red); background: var(--red-soft); }
.line.writing .c.name input, .line.writing .c.req input { text-transform: uppercase; }
.line.writing .c.covers input, .line.writing .c.time input { text-align: center; font-weight: 800; }
.writehint { font-size: 12px; color: var(--muted); padding: 2px 10px 6px; }

/* fondo pagina: tavoli liberi / da girare, note, meteo */
.foot { padding: 12px; border-top: 2px solid var(--band); display: grid; gap: 12px; }
.foot h3 { margin: 0 0 6px; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.foot .free h3 { color: var(--green); }
.foot .turns h3 { color: var(--orange); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { border-radius: 10px; padding: 4px 9px; font-size: 14px; display: inline-flex; gap: 6px; align-items: baseline; }
.fchip b { font-size: 17px; }
.fchip.free { background: var(--green-soft); color: var(--green); border: 1px solid #b9e2c8; }
.fchip.turn { background: var(--orange-soft); color: var(--orange); border: 1px solid #f3c99f; flex-wrap: wrap; }
.notes textarea { width: 100%; min-height: 64px; border: 1px solid var(--rule-strong); border-radius: 8px; padding: 8px; background: #fff; resize: vertical; }
.notes label, .weather .lbl { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink); font-weight: 700; display: block; margin-bottom: 4px; }
.weather .row { display: flex; gap: 8px; }
.weather .wx { display: flex; gap: 12px; align-items: center; font-size: 16px; font-weight: 700; }
.weather .wx b { font-size: 20px; }
.weather .wx-ico { font-size: 40px; line-height: 1; }
.weather .wx-day { font-size: 14px; font-weight: 600; color: var(--muted); }
.weather button { width: 52px; height: 48px; border-radius: 10px; border: 2px solid var(--rule); background: #fff; color: var(--band); display: inline-flex; align-items: center; justify-content: center; }
.weather button svg { width: 30px; height: 30px; }
.weather button.on { border-color: var(--ink); color: var(--ink); background: var(--band-soft); }
.empty-note { color: var(--muted); font-size: 14px; }

/* ---------- pulsante nuova ---------- */
.fab {
  position: fixed; right: 16px; bottom: calc(16px + var(--safe-b)); z-index: 15;
  background: var(--ink); color: #fff; border: 0; border-radius: 999px; padding: 0 22px; height: 56px;
  font-size: 18px; font-weight: 700; box-shadow: var(--shadow);
}

/* ---------- avvisi non bloccanti ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + var(--safe-b)); z-index: 60;
  background: #1d2433; color: #fff; padding: 10px 14px; border-radius: 12px; max-width: min(560px, calc(100vw - 32px));
  display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); font-size: 15px; width: max-content;
}
.toast button { background: #fff; color: #1d2433; border: 0; border-radius: 8px; padding: 6px 10px; font-weight: 700; }
.pending {
  position: fixed; left: 0; right: 0; top: 60px; z-index: 25; background: var(--orange); color: #fff; text-align: center;
  padding: 10px 12px; font-weight: 700; cursor: pointer; font-size: 15px;
}

/* ---------- fogli (modulo, tavoli, cerca, calendario) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(15, 25, 50, .45); display: flex; align-items: center; justify-content: center; }
.sheet {
  background: var(--sheet); width: min(620px, 100vw); max-height: min(92vh, 980px); border-radius: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--rule); background: var(--ink); color: #fff; }
.sheet-head h2 { margin: 0; font-size: 18px; flex: 1; }
.sheet-head .x { background: rgba(255,255,255,.15); border: 0; color: #fff; width: 44px; height: 44px; border-radius: 10px; font-size: 24px; }
.sheet-body { padding: 14px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.sheet-foot { padding: 10px 14px calc(10px + var(--safe-b)); border-top: 1px solid var(--rule); display: flex; gap: 10px; background: #fafbfd; }
.sheet-foot .grow { flex: 1; }

.field { margin-bottom: 14px; }
.field > label, .field > .lbl { display: block; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ink); margin-bottom: 6px; }
.field input[type=text], .field input[type=tel], .field input[type=date], .field input[type=number], .field textarea, .field input[type=search] {
  width: 100%; border: 1.5px solid var(--rule-strong); border-radius: 10px; padding: 11px 12px; background: #fff; min-height: 48px;
}
.field input:focus, .field textarea:focus { outline: 3px solid #c7d4f0; border-color: var(--ink); }
.field .err { color: var(--red); font-size: 14px; margin-top: 4px; font-weight: 600; }
.field.bad input { border-color: var(--red); background: var(--red-soft); }
.upper { text-transform: uppercase; }
.grid-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.grid-btns.small { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
.pick {
  min-height: 46px; border-radius: 10px; border: 1.5px solid var(--rule-strong); background: #fff; font-weight: 700; color: var(--ink); font-size: 16px;
}
.pick.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg { display: flex; gap: 6px; }
.seg .pick { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg .pick svg { width: 20px; height: 20px; }
.qchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.qchip { border: 1px solid var(--rule-strong); background: #f4f6fb; border-radius: 999px; padding: 6px 12px; font-size: 14px; min-height: 36px; }
.switch { display: flex; align-items: center; gap: 10px; }
.switch .pick { min-width: 70px; }
.btn { min-height: 48px; border-radius: 12px; border: 0; padding: 0 18px; font-weight: 700; font-size: 16px; }
.btn.primary { background: var(--ink); color: #fff; min-width: 140px; }
.btn.ghost { background: #eef1f7; color: var(--ink); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.green { background: var(--green); color: #fff; }
.who { color: var(--muted); font-size: 14px; margin-top: 4px; }
.cwarn { background: var(--red-soft); color: var(--red); border-radius: 8px; padding: 6px 10px; font-size: 14px; font-weight: 600; margin-top: 6px; }
.rowline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rowline input[type=date] { flex: 1; min-width: 150px; }
.tbl-current { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* scelta tavolo */
.tsec { margin-bottom: 16px; }
.tsec h3 { margin: 0 0 8px; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; }
.tsec.free h3 { color: var(--green); }
.tsec.turn h3 { color: var(--orange); }
.topts { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
.topt { border-radius: 12px; padding: 8px 6px; text-align: center; border: 2px solid; background: #fff; min-height: 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.topt b { font-size: 24px; line-height: 1.1; }
.topt span { font-size: 12px; }
.topt.free { border-color: #9fd5b4; color: var(--green); }
.topt.free.fit { background: var(--green); color: #fff; border-color: var(--green); }
.topt.turn { border-color: #f0b98a; color: var(--orange); }
.topt.turn.fit { background: var(--orange); color: #fff; border-color: var(--orange); }
.topt.short { border-color: #ddd; color: #9aa3b2; background: #f6f6f6; cursor: not-allowed; }
.topt.unfit { opacity: .7; }
.legend { font-size: 13px; color: var(--muted); margin: -4px 0 10px; }

/* cerca */
.results { display: grid; gap: 6px; margin-top: 10px; }
.result { display: grid; grid-template-columns: 74px 1fr auto; gap: 8px; align-items: center; text-align: left; border: 1px solid var(--rule); background: #fff; border-radius: 10px; padding: 8px 10px; min-height: 52px; }
.result .d { font-size: 13px; color: var(--ink); font-weight: 700; line-height: 1.2; }
.result .n { font-weight: 700; text-transform: uppercase; }
.result .s { font-size: 13px; color: var(--muted); }
.result .p { font-size: 20px; font-weight: 800; color: var(--ink); }
.result.st-annullata .n { text-decoration: line-through; color: #9aa3b2; }

/* calendario */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head b { font-size: 18px; text-transform: capitalize; color: var(--ink); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.cal .d { min-height: 54px; border-radius: 10px; border: 1px solid var(--rule); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px; }
.cal .d .num { font-weight: 700; font-size: 16px; }
.cal .d .cnt { font-size: 11px; color: var(--ink); font-weight: 700; min-height: 13px; }
.cal .d.red .num { color: var(--red); }
.cal .d.today { border: 2px solid var(--ink); }
.cal .d.sel { background: var(--ink); color: #fff; }
.cal .d.sel .cnt, .cal .d.sel .num { color: #fff; }
.cal .blank { visibility: hidden; }

/* archivio tavoli */
.ttable { width: 100%; border-collapse: collapse; }
.ttable th { font-size: 12px; text-transform: uppercase; color: var(--muted); text-align: left; padding: 4px; }
.ttable td { padding: 4px; border-top: 1px solid var(--rule); }
.ttable input[type=text], .ttable input[type=number] { width: 100%; min-width: 0; border: 1px solid var(--rule-strong); border-radius: 8px; padding: 8px; min-height: 42px; }
.ttable input[type=checkbox] { width: 24px; height: 24px; }
.ttable th:nth-child(4), .ttable th:nth-child(5), .ttable td:nth-child(4), .ttable td:nth-child(5) { text-align: center; }
.ttable th { white-space: nowrap; }
.ttable td:nth-child(2), .ttable td:nth-child(3) { width: 76px; }
.ttable td:nth-child(4), .ttable td:nth-child(5) { width: 64px; }
.ttable input[type=number] { font-size: 18px; font-weight: 700; text-align: center; }
.ttable tr.off td { color: var(--muted); background: #f6f6f6; }
.ttable tr.offhead td { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--muted); padding-top: 14px; }
.ttable tr.add td { border-top: 2px solid var(--rule-strong); }
.ttable .btn.tadd { min-width: 48px; width: 48px; padding: 0; font-size: 24px; }
.topt .tmore { font-weight: 700; }

/* login */
.login { position: fixed; inset: 0; z-index: 80; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .box { width: min(360px, 100%); text-align: center; }
.login h1 { margin: 0 0 4px; font-size: 26px; }
.login p { margin: 0 0 14px; color: #cfd9ee; }
.login input { width: 100%; border: 0; color: var(--text); background: #fff; border-radius: 12px; padding: 12px; min-height: 50px; text-align: center; margin-bottom: 10px; }
.login .dots { font-size: 34px; letter-spacing: 10px; min-height: 48px; }
.login .pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.login .pad button { height: 62px; border-radius: 14px; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; font-weight: 700; }
.login .pad button:active { background: rgba(255,255,255,.3); }
.login .go { width: 100%; height: 54px; border: 0; border-radius: 14px; background: #fff; color: var(--ink); font-size: 18px; font-weight: 800; }
.login .err { color: #ffd0c8; min-height: 22px; margin-top: 8px; font-weight: 600; }

/* ---------- telefono (iPhone 375 px): righe compatte ---------- */
@media (max-width: 760px) {
  .book { padding: 8px 8px calc(96px + var(--safe-b)); }
  .tabs { gap: 6px; }
  .tab { gap: 6px; padding: 6px; }
  .tab svg { width: 24px; height: 24px; }
  .tab .label { font-size: 14px; }
  .cols { display: none; }
  .line { grid-template-columns: 62px minmax(0, 1fr) 66px; min-height: 56px; }
  .line > .c { border-left: 0; padding: 7px 6px; }
  .line .c.name, .line .c.first, .line .c.phone, .line .c.req, .line .c.cake { display: none; }
  .line .c.time { grid-column: 1; grid-row: 1 / span 2; font-size: 18px; align-self: center; white-space: nowrap; padding: 7px 2px; }
  .line .mobile-main { grid-column: 2; grid-row: 1 / span 2; padding: 7px 4px; min-width: 0; }
  .line .c.covers { grid-column: 3; grid-row: 1; font-size: 24px; padding-bottom: 0; }
  .line .c.table { grid-column: 3; grid-row: 2; padding: 0 4px 6px; }
  .mm-name { font-weight: 800; text-transform: uppercase; font-size: 17px; overflow-wrap: anywhere; }
  .mm-sub { font-size: 14px; color: #34405a; overflow-wrap: anywhere; }
  .mm-sub a { color: inherit; text-decoration: none; font-variant-numeric: tabular-nums; }
  .mm-req { font-size: 13px; text-transform: uppercase; color: #34405a; }
  .line.st-non_presentata .mm-name::after { content: " · NON VENUTO"; color: var(--red); font-size: 11px; }
  .line.st-annullata .mobile-main { color: #9aa3b2; text-decoration: line-through; }
  .tchip { min-width: 50px; min-height: 34px; font-size: 18px; }
  .line.empty { min-height: 46px; grid-template-columns: 1fr; }
  .line.empty .c, .line.empty .mobile-main { display: none; }
  .foot { padding: 10px; }
  .sheet-wrap { align-items: stretch; }
  .sheet { width: 100vw; max-height: none; height: 100%; border-radius: 0; }
  .fab { right: 12px; }
}
@media (min-width: 761px) {
  .mobile-main { display: none; }
}

/* ---------- desktop largo: libro aperto, pranzo a sinistra e cena a destra ---------- */
@media (min-width: 1280px) {
  .tabs:not(.single) { display: none; }
  .tabs.single { max-width: 1200px; margin-left: auto; margin-right: auto; }
  .pages.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  .pages.one { max-width: 1200px; margin: 0 auto; }
  .pages.one .page-tab { display: none; }
  .page.off { display: block; }
  .page-tab { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--band-soft); color: var(--ink); border-bottom: 2px solid var(--band); }
  .page-tab svg { width: 30px; height: 30px; }
  .page-tab .label { font-weight: 800; letter-spacing: 1px; flex: 1; }
  .page-tab .covers { font-size: 26px; font-weight: 800; }
  .page-tab .covers small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 4px; }
  .cols, .line { grid-template-columns: 54px minmax(100px, 1.2fr) minmax(80px, .9fr) 112px minmax(80px, 1fr) minmax(70px, .9fr) 52px 64px; }
  .c.covers { font-size: 20px; }
}

/* lista nera */
.blackbox { background: #1b1b1b; color: #fff; border-left: 8px solid var(--red); border-radius: 10px; padding: 12px 14px; margin-top: 8px; font-size: 15px; }
.blackbox b { display: block; font-size: 19px; color: #ff8a80; letter-spacing: .3px; }
.blackbox .small { font-size: 13px; color: #c9c9c9; margin-top: 4px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 8px 10px; margin-top: 8px; font-weight: 600; font-size: 14px; }
.maybebox { background: #fff4e5; color: #8a4b00; border-left: 8px solid #e08a00; border-radius: 10px; padding: 10px 14px; margin-top: 8px; font-size: 15px; font-weight: 600; }
.maybebox b { display: block; font-size: 18px; }
.blackmark.maybe { background: #e08a00; color: #fff; }
.blsec { margin-top: 14px; }
.blsec h3 { font-size: 14px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; margin: 0 0 8px; }
.blsec.rest h3 { color: var(--ink); }
.blsec.maybe h3 { color: #b36200; }
.blsec.sure h3 { color: var(--red); }
.blcard { border: 2px solid var(--rule); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.blcard.sure { border-color: #1b1b1b; }
.blcard.maybe { border-color: #e08a00; }
.bltag { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 6px; margin-bottom: 4px; }
.bltag.sure { background: #1b1b1b; color: #ff8a80; }
.bltag.maybe { background: #e08a00; color: #fff; }
.blname { font-size: 20px; font-weight: 800; }
.blalso, .blwhy { font-size: 14px; font-weight: 600; color: #8a4b00; margin-top: 2px; }
.blphones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.blphone { font-size: 16px; font-weight: 700; background: var(--band-soft); border-radius: 8px; padding: 2px 8px; }
.blphone.on { background: #1b1b1b; color: #ff8a80; }
.blcount { margin-top: 6px; font-size: 16px; font-weight: 800; color: var(--red); }
.blshows { margin: 4px 0 0; padding-left: 18px; font-size: 15px; font-weight: 600; }
.blshows li { margin: 3px 0; }
.blbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.blthr { width: 90px; }
.btn.blbtn { width: 100%; margin-top: 12px; }
.ttable input.tlabel { width: 64px; font-weight: 800; font-size: 17px; text-align: center; }
.jsec { margin-top: 14px; }
.jsec h3 { font-size: 14px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; margin: 0 0 8px; color: var(--ink); }
.jtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.jtile { min-height: 72px; border: 2px solid var(--rule-strong); border-radius: 12px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: inherit; color: var(--ink); cursor: pointer; }
.jtile b { font-size: 24px; line-height: 1.1; }
.jtile span { font-size: 12px; font-weight: 700; }
.jtile .jbusy { color: #b36200; }
.jtile.busy { border-style: dashed; border-color: #e08a00; }
.jtile.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.jtile.on .jbusy { color: #ffd59a; }
.jcard { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.jcard b { font-size: 22px; }
.jcard .jsub { font-size: 14px; font-weight: 700; color: var(--muted); }
.jfields { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.blinfo { margin-top: 12px; background: #1b1b1b; color: #ff8a80; border-radius: 10px; padding: 10px 12px; font-weight: 700; }
.line.res { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } /* tenere premuto = lista nera */
.sheet .two, div.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.blackmark { display: inline-block; margin-left: 6px; background: #1b1b1b; color: #ff8a80; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 6px; letter-spacing: .4px; vertical-align: 2px; }
.walink { display: flex; align-items: center; justify-content: center; text-decoration: none; margin-top: 12px; background: #e7f6ec; color: #13703a; }
.grid-btns.two { grid-template-columns: 1fr 1fr; }

/* ---------- cognome e nome divisi (22/10) ---------- */
.c.first { font-weight: 600; text-transform: capitalize; color: #2b3445; }
.line.writing .c.first input { text-transform: capitalize; }
.mm-name .sn { font-size: 18px; letter-spacing: .3px; }
.mm-name .fn { margin-left: 6px; font-size: 14px; font-weight: 600; text-transform: capitalize; color: #4a5568; letter-spacing: 0; }
.namegrid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; }
.namegrid .lbl { display: block; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ink); margin-bottom: 6px; }
.namegrid input { width: 100%; border: 1.5px solid var(--rule-strong); border-radius: 10px; padding: 11px 12px; background: #fff; min-height: 48px; min-width: 0; }
.namegrid input:focus { outline: 3px solid #c7d4f0; border-color: var(--ink); }
.field.bad .namegrid input { border-color: var(--red); background: var(--red-soft); }

/* ---------- ordinamento (22/10) ---------- */
.sortrow { display: none; padding: 0 6px 6px; }
.sortbtn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 46px; padding: 0 14px; border: 2px solid var(--rule-strong); border-radius: 10px;
  background: #fff; color: var(--ink); font: 700 16px inherit; cursor: pointer; text-align: left; }
.sortbtn .si { font-size: 20px; line-height: 1; }
.sortbtn small { margin-left: auto; font-weight: 600; font-size: 14px; color: #6b7487; }
.sortbtn b { margin-left: auto; font-size: 14px; color: #fff; background: var(--ink); border-radius: 999px; padding: 3px 10px; }
.sortbtn.on { border-color: var(--ink); }
.sortbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 6px 8px; padding: 10px 12px; border-radius: 10px;
  background: #fff3c4; border: 2px solid #e0a800; color: #3a2a00; font-size: 16px; }
.sortbar > span { flex: 1 1 180px; }
.sortbar b { font-weight: 800; }
.sortx { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--ink); color: #fff;
  font: 700 15px inherit; cursor: pointer; }
.sortx .x { font-size: 18px; line-height: 1; }
.sortopt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 10px 14px; border: 0; border-top: 1px solid var(--rule); background: #fff;
  text-align: left; font: inherit; color: inherit; cursor: pointer; }
.mlist .sortopt:first-child { border-top: 0; }
.sortopt .so-t { flex: 1; display: grid; gap: 2px; }
.sortopt .so-t b { font-size: 17px; }
.sortopt .so-t small { font-size: 14px; color: #6b7487; }
.sortopt .so-c { font-size: 22px; font-weight: 800; color: var(--ink); min-width: 22px; }
.sortopt.on { background: var(--band-soft); }
@media (max-width: 760px) { .sortrow { display: block; } }

/* ---------- modulo: GIRA (22/10) ---------- */
.grid-btns.gira { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
.grid-btns.gira .pick.wide { grid-column: span 2; }
.grid-btns.gira .pick.on { background: var(--orange); border-color: var(--orange); color: #fff; }
.grid-btns.gira .pick.wide.on { background: var(--ink); border-color: var(--ink); }
.gira-hint { grid-column: 1 / -1; }
.girafield .legend { margin: 0 0 8px; }
.girafield input.giraother { margin-top: 8px; width: 100%; border: 1.5px solid var(--orange); border-radius: 10px; padding: 11px 12px; min-height: 48px; background: #fff; }
.giraWarn { margin-top: 8px; background: var(--orange-soft); color: #9a4a00; border: 2px solid var(--orange); border-radius: 10px; padding: 8px 10px; font-weight: 700; font-size: 15px; }
.girahint { margin: -4px 0 10px; font-size: 14px; color: #5d3a00; background: #fff7d6; border-radius: 8px; padding: 6px 10px; }
.girahint .girapill { margin-left: 0; }
.topt.giraok { box-shadow: 0 0 0 3px #1f9d55; }
.topt .gok { font-weight: 800; }
.topt.girano { opacity: .55; }
.btn.before { background: var(--orange-soft); color: #9a4a00; border: 2px solid var(--orange); width: 100%; margin-top: 4px; }

/* ---------- leggibilità della riga (Francesco 22/10, dopo cognome/nome divisi) ----------
 * COGNOME e NOME vicini, senza linea in mezzo; telefono, richieste e torta con lo stesso carattere/grandezza/peso del nome;
 * la riga orizzontale tra una prenotazione e l'altra più marcata delle linee verticali delle colonne. */
.line { border-bottom: 2px solid #8191b3; }
.line > .c { border-left-color: #dfe4ee; }
.line > .c.first { border-left: 0; padding-left: 0; }
.cols > :nth-child(3) { border-left: 0; }
.c.name, .c.first, .c.phone, .c.req, .c.cake { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: .3px; }
.c.phone a { color: inherit; }
.c.cake { color: #6b3d00; }
.cols, .line { grid-template-columns: 62px minmax(100px, .85fr) minmax(80px, .65fr) 136px minmax(110px, 1.3fr) minmax(100px, 1fr) 64px 74px; }
@media (min-width: 1280px) {
  .cols, .line { grid-template-columns: 54px minmax(110px, .8fr) minmax(90px, .6fr) 130px minmax(120px, 1.5fr) minmax(100px, 1.1fr) 56px 64px; }
}
@media (max-width: 760px) {
  .line { grid-template-columns: 62px minmax(0, 1fr) 66px; }
  .mm-name .fn { font-size: 16px; font-weight: 700; color: #2b3445; }
  .mm-sub { font-size: 16px; font-weight: 600; color: var(--text); }
  .mm-req { font-size: 15px; font-weight: 700; color: var(--text); }
}
/* «Tavolo 24 occupato da … fino alle …» da PC: riga sotto, larga da COGNOME a TORTA (nella colonna stretta andava a capo ogni parola) */
@media (min-width: 761px) {
  .line > .c.holdpc { grid-column: 2 / 7; grid-row: 2; border-left: 0; padding-top: 0; }
  .line > .c.holdpc .holdnote { margin-top: 0; font-size: 14px; }
  .line.hashold > .c.time, .line.hashold > .c.covers, .line.hashold > .c.table { grid-row: 1 / span 2; }
}
@media (max-width: 760px) { .line > .c.holdpc { display: none; } }

/* ---------- «HAI POSTO?» nella nuova prenotazione (22/10, prima i posti) ---------- */
.haiposto { margin: -4px 0 16px; border: 2px solid var(--ink); border-radius: 12px; padding: 10px; background: #f7f9fd; display: grid; gap: 10px; }
.hp-head { font-size: 15px; color: var(--ink); }
.hp-head b { font-size: 16px; letter-spacing: .8px; }
.hp-note { margin: 0; font-size: 14px; color: var(--muted); }
.hp-note.warn { color: #9a4a00; font-weight: 700; }
.hp-title { font-size: 13px; font-weight: 800; letter-spacing: .6px; margin-bottom: 6px; }
.hp-group.free .hp-title { color: var(--green); }
.hp-group.turn .hp-title { color: var(--orange); }
.hp-group.standing .hp-title { color: #1d5fb8; }
.hp-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.hp-group.turn .hp-chips, .hp-group.standing .hp-chips { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.hp-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 52px; padding: 6px 9px; border-radius: 10px; border: 2px solid; background: #fff; text-align: left; font: inherit; cursor: pointer; }
.hp-chip b { font-size: 22px; line-height: 1.05; }
.hp-chip .hp-seats { font-size: 13px; font-weight: 700; }
.hp-chip .hp-more-seats { font-size: 12px; font-weight: 700; opacity: .85; }
.hp-chip .hp-l { font-size: 13px; line-height: 1.25; }
.hp-chip.free { border-color: #9fd5b4; color: var(--green); }
.hp-chip.free.fit { background: var(--green-soft); border-color: var(--green); }
.hp-chip.turn { border-color: #f0b98a; color: #9a4a00; }
.hp-chip.turn.fit { background: var(--orange-soft); border-color: var(--orange); }
.hp-chip.standing { border-color: #9cc0ee; color: #1d5fb8; }
.hp-chip.standing.fit { background: #e6f0fc; border-color: #1d5fb8; }
.hp-chip.unfit { opacity: .6; }
.hp-chip.sel { box-shadow: 0 0 0 3px var(--ink); opacity: 1; }
.hp-chip.free.sel { background: var(--green); color: #fff; }
.hp-chip.turn.sel { background: var(--orange); color: #fff; }
.hp-chip.standing.sel { background: #1d5fb8; color: #fff; }
.hp-more { justify-self: start; margin-top: 6px; border: 0; background: none; color: var(--ink); font: 700 14px inherit; text-decoration: underline; cursor: pointer; padding: 4px 0; }
.hp-none { background: var(--red-soft); color: var(--red); border: 2px solid var(--red); border-radius: 10px; padding: 10px 12px; font-size: 15px; display: grid; gap: 6px; }
.hp-none b { font-size: 17px; }
.hp-next { margin-left: 6px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--red); background: #fff; color: var(--red); font: 800 16px inherit; cursor: pointer; }
.hp-picked { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 6px 10px; font-size: 15px; color: var(--ink); }
.hp-picked > span { flex: 1 1 160px; }
.hp-picked .btn { min-height: 40px; }
/* riga: ora d'arrivo e attesa del tavolo */
.sincemark { display: inline-block; margin-left: 6px; font-size: 13px; font-weight: 700; color: var(--green); text-transform: none; letter-spacing: 0; }
.waitmark { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 800; color: #fff; background: #1d5fb8; border-radius: 6px; padding: 1px 6px; text-transform: none; letter-spacing: .2px; }
.mm-since .sincemark, .mm-since .waitmark { margin-left: 0; margin-top: 2px; }
.jhint { font-weight: 700; color: var(--ink); margin: 10px 0 0; }
.jform { background: var(--band-soft); border-radius: 12px; padding: 10px; }
.jfoot { width: 100%; }
.jfoot .btn.blbtn { margin-top: 6px; }
.jfoot .jhint { margin: 4px 0; }
/* Sala e mappe: quadratini staccati, si trascinano col dito (Francesco 22/10) */
.joins .jtiles { gap: 14px; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.jtile { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.jtile.joined { border-color: var(--ink); border-width: 3px; background: var(--band-soft); }
.jtile.extra { border-style: dotted; border-color: #1d5fb8; }
.jtile .jmem { font-size: 11px; color: var(--muted); }
.jtile.dragging { opacity: .35; }
.jtile.drop { outline: 4px solid #1f9d55; outline-offset: 2px; background: #e9f7ee; }
.jghost { position: fixed; left: 0; top: 0; width: 76px; z-index: 9999; pointer-events: none; opacity: .92; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.jpicks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.jmaps { display: grid; gap: 8px; }
.jmap { border: 2px solid var(--rule-strong); border-radius: 12px; padding: 8px 12px; }
.jmap b { font-size: 18px; display: block; }
.jmapbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.jpicks .pick { min-width: 72px; min-height: 52px; font-size: 20px; font-weight: 800; }
/* data in cima alla nuova prenotazione (Francesco 22/10) */
.dayrow { display: flex; align-items: center; gap: 8px; }
.dayrow .daybig { flex: 1; text-align: center; font-size: 19px; font-weight: 800; color: var(--ink); }
.dayrow .pick { min-width: 52px; font-size: 22px; }
.daybtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.daybtns input[type=date] { flex: 1; min-width: 150px; font-size: 16px; min-height: 44px; }
/* Mappa disegnata (copia della cassa, mappa.css) dentro Sala e mappe */
.jswitch { display: flex; gap: 8px; margin-bottom: 10px; }
.jswitch .pick { flex: 1; min-height: 44px; font-size: 16px; font-weight: 800; }
.jfloor { max-height: 60vh; min-height: 260px; }
.floor-object.floor-table.floor-joined { background: var(--band-soft); border-color: var(--ink); border-width: 3px; }
.floor-object.floor-table.floor-off { opacity: .35; }
.floor-object.floor-table[data-label] { cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.floor-object.floor-table.drop { outline: 4px solid #1f9d55; outline-offset: 2px; }
/* editor della mappa (copiato dalla cassa) in una scheda larga */
.sheet.floor-dialog { width: min(1280px, 98vw); max-width: 98vw; }
.floor-body .admin-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; margin-bottom: 8px; }
.floor-body .admin-toolbar button, .floor-properties > button, .floor-palette > button { border: 1px solid var(--rule-strong); background: #fff; border-radius: 10px; padding: 8px 10px; font: inherit; font-weight: 700; min-height: 40px; color: var(--ink); }
.floor-body label.floor-field { display: flex; flex-direction: column; font-size: 12px; font-weight: 700; color: var(--muted); gap: 3px; }
.floor-body label.floor-field input, .floor-body label.floor-field select { font-size: 16px; min-height: 40px; border: 1px solid var(--rule-strong); border-radius: 8px; padding: 4px 8px; }
.floor-body .admin-flag { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 6px 0; }
.floor-object .floor-joinmark { font-size: 10px; font-weight: 800; color: var(--ink); }
/* Sala e mappe: sul PC scheda larga, così la mappa si legge */
@media (min-width: 761px) { .sheet.sala-sheet { width: min(1100px, 96vw); max-width: 96vw; } }
.jfloor { max-height: 70vh; }
/* NAVIGAZIONE (Francesco 23/10): la mappa si vede intera, la rotellina / il dito scorrono la pagina (sotto ci sono
 * tavoli non nella mappa e mappe); a destra e sinistra con la barra o Maiusc + rotellina */
.floor-scroll.jfloor { max-height: none; min-height: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior: auto; touch-action: pan-x pan-y; }
.floor-body > p:first-of-type { min-height: 1.5em; margin: 4px 0; } /* la scritta di stato non fa saltare la mappa */
.jmaptools { flex-wrap: nowrap; }
.jmaptools .btn:first-child { flex: 1; padding: 0 10px; }
.jmaptools .btn:not(:first-child) { min-width: 48px; width: 48px; padding: 0; font-size: 22px; }
/* maniglie per allargare stanze, muri e tavoli nell'editor della mappa */
.floor-handle { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: #1289b0; border: 3px solid #fff; box-shadow: 0 1px 4px #0006; z-index: 20; touch-action: none; cursor: nwse-resize; }
.floor-handle-n, .floor-handle-s { cursor: ns-resize; } .floor-handle-e, .floor-handle-w { cursor: ew-resize; }
/* pezzi bloccati nell'editor: non si toccano (il dito passa sotto: si scorre la mappa) */
.floor-object.floor-locked { pointer-events: none; }
.floor-body .admin-toolbar button.floor-lock.on { background: var(--ink); color: #fff; border-color: var(--ink); }
/* scritte della mappa: grandi quanto il riquadro, sopra le stanze */
.floor-object.floor-text { z-index: 7; }
.floor-object .floor-textlabel { font-weight: 800; color: #253a4b; line-height: 1; white-space: nowrap; pointer-events: none; }
.floor-object.floor-table strong { line-height: 1; }
/* trascinamento sulla mappa: il tavolo che segue il dito deve stare sopra a tutto (lo stile della mappa lo metteva sotto) */
.jghost.jghost { position: fixed !important; left: 0 !important; top: 0 !important; z-index: 10000 !important; pointer-events: none !important; opacity: .95; box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.floor-object.floor-table.jghost { width: 90px; height: 64px; border-width: 3px; border-color: #1f9d55; background: #e9f7ee; display: flex; }
.floor-object.floor-table.dragging { opacity: .3; }
/* Sala del giorno: tavolo d'appoggio, prenotazioni da trascinare, posti di stasera (Francesco 23/10) */
.jhelperrow { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.jhelperrow .who { margin: 0; flex: 1; }
.jtile.jhelper { width: 96px; flex: 0 0 96px; border-style: dashed; border-color: #8a5a2b; background: #f6eee4; color: #6b4320; }
.jrecs { display: flex; flex-wrap: wrap; gap: 8px; }
.jrec { display: flex; gap: 6px; align-items: baseline; border: 2px solid var(--ink); border-radius: 10px; padding: 6px 10px; background: #fff; cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; font-size: 15px; }
.jrec b { font-size: 16px; }
.jrec .jrn { font-weight: 800; }
.jrec .jrt { font-size: 13px; color: #b36200; font-weight: 700; }
.jrec.has { border-color: var(--rule-strong); background: var(--band-soft); }
.jrec.has .jrt { color: var(--muted); }
.jrec.dragging { opacity: .35; }
.dsrow { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 14px 0; }
.dsrow .dsbtn { min-width: 64px; min-height: 64px; font-size: 32px; padding: 0; }
.dsnum { font-size: 28px; min-width: 120px; text-align: center; }
.jhelpers { display: flex; gap: 8px; }
/* CARTELLINI delle prenotazioni sui tavoli (Francesco 23/10) */
.ftags { position: absolute; z-index: 12; transform: translateY(calc(-100% - 6px)); display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
.ftag { pointer-events: auto; display: flex; align-items: baseline; gap: 5px; padding: 3px 8px; border-radius: 8px; font-size: 15px; line-height: 1.15; white-space: nowrap;
  background: #e6f0fc; border: 2px solid #1d5fb8; color: #12345f; box-shadow: 0 2px 6px rgba(0,0,0,.18); cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.ftag b { font-size: 15px; }
.ftag .ftn { font-weight: 800; }
.ftag .ftp { font-weight: 700; opacity: .8; }
.ftag .ftg { font-weight: 800; color: #9a4a00; }
.ftag.seated { background: #e3f5e9; border-color: #1f9d55; color: #145c34; }
.ftag.late { background: #fde8e8; border-color: #c62828; color: #8e1b1b; }
.ftag.turns { background: #ffe9cc; border-color: #e07000; color: #7a3a00; }
.ftag.turns.now { animation: girablink 1s ease-in-out infinite; }
@keyframes girablink { 50% { background: #ff9f2e; } }
.ftag.next { border-style: dashed; opacity: .92; }
.ftag .ftpoi { font-size: .8em; font-weight: 800; text-transform: uppercase; }
.ftag.dragging { opacity: .35; }
.jtags { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; width: 100%; }
.jtags .ftag { font-size: 12px; padding: 2px 5px; }
.jtags .ftag b { font-size: 12px; }
/* nei quadratini il cartellino va a capo invece di uscire (iPhone) */
.jtags .ftag { flex-wrap: wrap; justify-content: center; white-space: normal; column-gap: 3px; row-gap: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; overflow-wrap: anywhere; }
.flegend { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.flegend .ftag { cursor: default; font-size: 12px; padding: 2px 8px; box-shadow: none; font-weight: 700; }
.floor-table.flash, .jtile.flash { animation: flashtab 1.6s ease-out 2; }
@keyframes flashtab { 0% { box-shadow: 0 0 0 0 rgba(31,157,85,.9); } 70% { box-shadow: 0 0 0 14px rgba(31,157,85,0); } 100% { box-shadow: 0 0 0 0 rgba(31,157,85,0); } }

/* BLOCCA TAVOLI (Francesco 23/10) */
.lockbtn { margin-top: 8px; background: #fff; border: 2px solid #8a97a8; color: #2b3a4d; font-weight: 700; }
.lockbtn.on { background: #fff3d6; border-color: #c98a00; color: #6b4700; }

/* PANNELLO FISSO A SINISTRA con le prenotazioni (Francesco 23/10): sempre visibile mentre si scorre la sala.
 * In grande i coperti, poi l'ora, il nome più piccolo. Sul telefono stretto resta sopra. */
.jsplit.two { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; }
.jsplit.two > .jrecbox { position: sticky; top: 0; z-index: 5; max-height: calc(100dvh - 130px); overflow-y: auto; margin: 0; padding: 8px; background: var(--paper, #fff); border: 1px solid var(--rule-strong); border-radius: 12px; }
.jsplit.two > .jrecbox h3 { margin-top: 0; }
.jsplit.two .jrecs { flex-direction: column; flex-wrap: nowrap; gap: 6px; }
.jmain { min-width: 0; }
.jrhead { margin: 8px 0 4px; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.jrec { align-items: center; gap: 8px; padding: 6px 8px; }
.jrec .jrp { display: flex; flex-direction: column; align-items: center; min-width: 40px; line-height: 1; }
.jrec .jrp b { font-size: 30px; font-weight: 900; }
.jrec .jrp small { font-size: 11px; font-weight: 700; color: var(--muted); }
.jrec .jrmid { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.15; }
.jrec .jrtime { font-size: 20px; font-weight: 900; }
.jrec .jrn { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jrec .jrt { font-size: 12px; text-align: right; display: flex; flex-direction: column; flex-shrink: 0; }
.jrec .jrt b { font-size: 14px; }
@media (max-width: 760px) { .jsplit.two { display: block; } .jsplit.two > .jrecbox { position: static; max-height: none; } }

/* CAPOTAVOLA nella scheda del tavolo (Francesco 23/10) */
.dsheads { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin: 6px 0; }
.dsheads .dslab { font-weight: 800; margin-right: 4px; }
.dsheads .pick { min-height: 44px; padding: 0 12px; font-weight: 700; }
.dshow { text-align: center; font-weight: 700; color: var(--muted); margin: 4px 0 10px; }

/* METEO A FASCE (Francesco 23/10): adesso + sera 18–20 / 20–22 / 22–24 */
.weather .wx-bands { display: grid; gap: 4px; margin-top: 8px; }
.weather .wx-row { display: grid; grid-template-columns: 92px 30px minmax(0, 1fr) 42px 64px; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; background: rgba(0,0,0,.035); }
.weather .wx-row.now { background: #e6f0fc; }
.weather .wx-when { display: flex; flex-direction: column; line-height: 1.1; }
.weather .wx-when b { font-size: 16px; }
.weather .wx-when small { font-size: 11px; font-weight: 700; color: var(--muted); }
.weather .wx-ri { font-size: 22px; text-align: center; }
.weather .wx-rt { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weather .wx-deg { font-size: 18px; text-align: right; }
.weather .wx-rain { font-size: 13px; font-weight: 700; color: var(--muted); text-align: right; }
.weather .wx-rain.wet { color: #1d5fb8; }

/* «C'È POSTO?» (Francesco 25/10) */
.fab2 { right: auto; left: 16px; background: #fff; color: var(--ink); border: 3px solid var(--ink); }
.posto { margin-top: 6px; }
.postoverdict { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 3px solid; margin-bottom: 10px; }
.postoverdict b { font-size: 24px; font-weight: 900; }
.postoverdict span { font-size: 16px; font-weight: 700; }
.postoverdict.si { background: #e3f5e9; border-color: #1f9d55; color: #145c34; }
.postoverdict.forse { background: #fff3d6; border-color: #c98a00; color: #6b4700; }
.postoverdict.no { background: #fde8e8; border-color: #c62828; color: #8e1b1b; }
.postonums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.postonums > div { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border: 1px solid var(--rule-strong); border-radius: 10px; text-align: center; }
.postonums b { font-size: 26px; font-weight: 900; line-height: 1.05; }
.postonums small { font-size: 12px; font-weight: 700; color: var(--muted); }
.postonums .left { border-width: 3px; border-color: var(--ink); }
.postowarn { font-weight: 700; color: #8a4b00; background: #fff1e0; border-radius: 10px; padding: 8px 10px; }
.postohead { font-weight: 800; margin: 10px 0 6px; }
.posto .fchip.extra { border-style: dashed; }
.postopicks .pick { min-width: 46px; min-height: 46px; font-size: 18px; font-weight: 800; }
.postopicks input { width: 80px; min-height: 46px; font-size: 16px; }
.postobtns { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.postocopy { width: 100%; min-height: 80px; font-size: 16px; margin-top: 8px; }

/* CONTROLLORE DELLE CHAT WHATSAPP (Francesco 25/10) */
.tool.wa { position: relative; font-size: 22px; width: auto; min-width: 44px; padding: 0 8px; }
.tool.wa .wa-n { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; border-radius: 10px; background: #d32f2f; color: #fff; font-size: 13px; line-height: 20px; text-align: center; padding: 0 5px; }
.wa-h { margin: 12px 0 6px; }
.wa-card { border: 2px solid var(--rule-strong); border-left-width: 8px; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.wa-card.red { border-left-color: #d32f2f; }
.wa-card.orange { border-left-color: #e07000; }
.wa-card.blue { border-left-color: #1d5fb8; }
.wa-card.green { border-left-color: #1f9d55; }
.wa-card.done { opacity: .75; }
.wa-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wa-who { font-size: 18px; }
.wa-ago { font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.wa-label { font-weight: 800; margin-top: 2px; }
.wa-card.red .wa-label { color: #b71c1c; }
.wa-card.orange .wa-label { color: #8a4b00; }
.wa-card.blue .wa-label { color: #1d5fb8; }
.wa-card.green .wa-label { color: #145c34; }
.wa-facts { font-size: 17px; font-weight: 800; margin-top: 4px; }
.wa-diff { font-weight: 800; color: #8a4b00; margin-top: 2px; }
.wa-sub, .wa-phone { font-size: 14px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.wa-sugg { margin-top: 6px; padding: 8px 10px; border-radius: 10px; font-weight: 700; }
.wa-sugg p { margin: 4px 0 0; font-weight: 600; white-space: pre-line; }
.wa-sugg.si { background: #e3f5e9; color: #145c34; }
.wa-sugg.forse { background: #fff3d6; color: #6b4700; }
.wa-sugg.no { background: #fde8e8; color: #8e1b1b; }
.wa-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wa-btns .btn { min-height: 44px; }
.wa-chat { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; background: #efeae2; border-radius: 10px; padding: 8px; }
.wa-msg { max-width: 85%; padding: 6px 9px; border-radius: 10px; font-size: 15px; white-space: pre-wrap; background: #fff; align-self: flex-start; }
.wa-msg.out { background: #d9fdd3; align-self: flex-end; }
.wa-msg small { display: block; font-size: 11px; color: var(--muted); text-align: right; }
.wa-done summary { font-weight: 800; cursor: pointer; margin: 10px 0; }

/* COPIA LOCALE sul PC della cassa (Francesco 25/10) */
.syncpill { border: 0; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 800; white-space: nowrap; min-height: 32px; }
.syncpill.ok { background: #e3f5e9; color: #145c34; }
.syncpill.wait { background: #e6f0fc; color: #1d5fb8; }
.syncpill.off { background: #fff1e0; color: #8a4b00; }
@media (max-width: 520px) { .syncpill .syncwide { display: none; } .syncpill { padding: 4px 8px; } }
/* iPhone: con 💬 e la copia locale in alto i tasti si stringono un po' (25/10), il menu ☰ resta dentro lo schermo */
@media (max-width: 420px) {
  .top { gap: 4px; padding-left: 8px; padding-right: 8px; }
  .top button { min-width: 38px; }
  .top .today { padding: 0 9px; }
  .testclock { padding: 0 6px; margin-right: 0; font-size: 15px; }
  .tool.wa { min-width: 38px; padding: 0 5px; font-size: 20px; }
  .syncpill { padding: 4px 6px; min-height: 30px; }
}
