/* talk-planner · foglio di stile completo
   1) tp.css: base, componenti, tema scuro (data-theme="scuro")
   2) livello "Material 3 blu": ridefinisce i token e la forma dei componenti (radice: <div class="tp app">)
   3) componenti aggiunti nel prototipo (menu con ricerca, mini-calendario, programma del mese, ...)
*/

/* ===== 1. tp.css ===== */
/* =========================================================
   talk-planner · design system v1
   Un solo foglio di stile: token in variabili CSS (--…),
   tema chiaro di default, tema scuro con data-theme="scuro".
   Font: Atkinson Hyperlegible (Google Fonts), pensato per
   la leggibilità anche con vista ridotta.
   ========================================================= */

.tp {
  /* superfici */
  --bg: #F5F5F2;
  --surface: #FFFFFF;
  --surface-2: #EFEFEA;
  --surface-3: #E4E4DE;
  --border: #D8D8D1;
  --border-strong: #8C9098;
  /* testo */
  --text: #1A1D21;
  --text-2: #454B53;
  --text-3: #5E646C;
  /* accento */
  --primary: #1F4FA3;
  --primary-hover: #183F84;
  --primary-soft: #E5ECF8;
  --on-primary: #FFFFFF;
  /* stati */
  --warn-bg: #FFF4CC;
  --warn-border: #D6A100;
  --warn-text: #4F3A00;
  --warn-icon: #8A6300;
  --danger: #B42318;
  --danger-bg: #FCEBE9;
  --danger-text: #8C1C13;
  --on-danger: #FFFFFF;
  --success: #1B7340;
  --success-bg: #E3F3E8;
  --wa: #0E7A3E;
  --wa-hover: #0A6232;
  /* modalità */
  --m-o: #0F6A6A;  --m-o-bg: #DDF1EF;
  --m-z: #5A35B5;  --m-z-bg: #ECE6FA;
  --m-s: #9A4400;  --m-s-bg: #FBE9D8;
  --m-n: #4B5058;  --m-n-bg: #E9E9E4;
  /* varie */
  --inverse: #1F2328;
  --on-inverse: #F3F4F5;
  --toast-ic: #7DCB98;
  --backdrop: rgba(20, 22, 26, .52);
  --shadow: 0 1px 2px rgba(20, 22, 26, .05), 0 2px 8px rgba(20, 22, 26, .05);
  --shadow-lg: 0 12px 32px rgba(20, 22, 26, .2);
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}

.tp[data-theme="scuro"] {
  --bg: #111316;
  --surface: #1A1D21;
  --surface-2: #23272C;
  --surface-3: #2E3339;
  --border: #353B42;
  --border-strong: #6E7680;
  --text: #ECEDEF;
  --text-2: #C2C7CD;
  --text-3: #A6ACB3;
  --primary: #8FB3F5;
  --primary-hover: #AAC6F8;
  --primary-soft: #1C2A44;
  --on-primary: #0B1730;
  --warn-bg: #352A06;
  --warn-border: #9C7A00;
  --warn-text: #F6E3A1;
  --warn-icon: #E9C24A;
  --danger: #F2867C;
  --danger-bg: #3A1613;
  --danger-text: #F8B8B1;
  --on-danger: #2A0906;
  --success: #7DCB98;
  --success-bg: #11301D;
  --wa: #0E7A3E;
  --wa-hover: #11904A;
  --m-o: #7DD3CB;  --m-o-bg: #123634;
  --m-z: #C3B0F6;  --m-z-bg: #2B2250;
  --m-s: #F4B27C;  --m-s-bg: #3B250F;
  --m-n: #BAC0C6;  --m-n-bg: #2A2E33;
  --inverse: #ECEDEF;
  --on-inverse: #16191C;
  --toast-ic: #1B7340;
  --backdrop: rgba(0, 0, 0, .62);
  --shadow: none;
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- base ---------- */
.tp *, .tp *::before, .tp *::after { box-sizing: border-box; }
.tp h1, .tp h2, .tp h3, .tp h4, .tp p, .tp ul, .tp ol, .tp dl, .tp figure { margin: 0; }
.tp ul, .tp ol { padding: 0; list-style: none; }
.tp h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.tp h2 { font-size: 19px; line-height: 1.3; font-weight: 700; }
.tp h3 { font-size: 17px; line-height: 1.3; font-weight: 700; }
:where(.tp) a { color: var(--primary); text-underline-offset: 3px; }
:where(.tp) button, :where(.tp) input, :where(.tp) select, :where(.tp) textarea { font: inherit; color: inherit; }
:where(.tp) button { cursor: pointer; }
.tp :focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.tp fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.tp legend { padding: 0; }
.tp hr, .divider { height: 1px; background: var(--border); border: 0; margin: 0; }

.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 24px; height: 24px; }

.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 14px; }
.xs { font-size: 13px; }
.bold { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-1 { display: flex; flex-direction: column; gap: 4px; }
.stack-2 { display: flex; flex-direction: column; gap: 8px; }
.stack-4 { display: flex; flex-direction: column; gap: 16px; }
.stack-6 { display: flex; flex-direction: column; gap: 24px; }
.hrow { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }

/* ---------- shell mobile ---------- */
.phone { position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.topbar { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 8px 12px 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex: none; }
.group-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; margin-left: -10px; border: 0; background: none; border-radius: var(--r); font-weight: 700; font-size: 17px; text-align: left; }
.group-switch:hover { background: var(--surface-2); }
.gs-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.gs-sub { display: block; font-size: 13px; font-weight: 400; color: var(--text-2); line-height: 1.1; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 15px; border: 0; flex: none; }
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r); color: var(--text); flex: none; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); }
.pagehead { display: flex; align-items: center; gap: 4px; padding: 14px 16px 2px; }
.pagehead.back { padding-left: 6px; }
.content { flex: 1; display: flex; flex-direction: column; gap: 24px; padding: 16px 16px 28px; min-height: 0; }
.bottomnav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--border); padding: 4px 4px 12px; flex: none; }
.navitem { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; font-size: 12px; font-weight: 700; color: var(--text-2); text-decoration: none; border-radius: var(--r); letter-spacing: -.01em; }
.navitem .i { width: 24px; height: 24px; }
.navitem[aria-current="page"] { color: var(--primary); }
.navitem[aria-current="page"]::before { content: ""; position: absolute; top: -4px; left: 26%; right: 26%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
.actionbar { display: flex; gap: 8px; padding: 12px 16px 16px; background: var(--surface); border-top: 1px solid var(--border); flex: none; }
.actionbar .btn { flex: 1; }
.readonly-banner { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface-2); color: var(--text-2); font-size: 14px; font-weight: 700; border-bottom: 1px solid var(--border); }

/* ---------- shell desktop ---------- */
.desk { display: flex; flex-wrap: wrap; min-height: 100vh; align-items: stretch; }
.sidebar { flex: 1 1 248px; background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 12px 18px; font-weight: 700; font-size: 18px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; flex: none; }
.side-link { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: var(--r); color: var(--text-2); font-weight: 700; text-decoration: none; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.side-link .count { margin-left: auto; }
.side-label { padding: 18px 12px 6px; font-size: 13px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.d-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.d-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 68px; padding: 8px 32px; border-bottom: 1px solid var(--border); background: var(--surface); }
.d-body { padding: 28px 32px 56px; display: flex; flex-direction: column; gap: 28px; max-width: 1240px; width: 100%; }
.d-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.d-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; align-items: start; }
.d-split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .d-split { grid-template-columns: minmax(0, 1fr); } .d-body { padding: 20px 16px 40px; } .d-top { padding: 8px 16px; } }

/* ---------- sezioni ---------- */
.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--text); color: var(--surface); font-size: 14px; font-weight: 700; line-height: 1; }
.count.warn { background: var(--warn-bg); color: var(--warn-text); border: 1.5px solid var(--warn-border); }
.more { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; font-size: 15px; color: var(--primary); text-decoration: none; }
.month-h { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.week-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 700; font-size: 15px; color: var(--text-2); }

/* ---------- card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface); }

/* da gestire */
.todo-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.todo { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.todo:last-child { border-bottom: 0; }
.todo:hover { background: var(--surface-2); }
.todo-num { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-size: 21px; font-weight: 700; flex: none; background: var(--primary-soft); color: var(--primary); }
.todo-num.warn { background: var(--warn-bg); color: var(--warn-text); box-shadow: inset 0 0 0 1.5px var(--warn-border); }
.todo-title { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.todo-sub { font-size: 14px; color: var(--text-2); }
.chev { color: var(--text-3); }

/* data */
.datebox { display: block; flex: none; width: 58px; border-radius: 11px; background: var(--surface-2); text-align: center; padding: 7px 0 6px; line-height: 1.1; }
.datebox .dow { display: block; font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--text-2); }
.datebox .dd { display: block; font-size: 25px; font-weight: 700; margin: 1px 0; }
.datebox .mm { display: block; font-size: 13px; color: var(--text-2); }
.datebox.today { background: var(--primary); color: var(--on-primary); }
.datebox.today .dow, .datebox.today .mm { color: var(--on-primary); }

/* appuntamento */
.appt { display: flex; gap: 14px; align-items: flex-start; }
.appt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.appt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 15px; color: var(--text-2); }
.talk { display: block; font-weight: 700; font-size: 17px; line-height: 1.3; }
.talk .no { color: var(--text-2); margin-right: 2px; }
.speaker { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.speaker .from { color: var(--text-2); font-size: 14px; }
.appt-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.appt.cancelled .talk, .appt.cancelled .speaker { text-decoration: line-through; color: var(--text-3); }

/* badge modalità */
.mode { --mc: var(--m-o); --mbg: var(--m-o-bg); display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px 0 3px; border-radius: 7px; font-size: 14px; font-weight: 700; white-space: nowrap; color: var(--mc); background: var(--mbg); line-height: 1; }
.mode .ml { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: var(--mc); color: var(--surface); font-size: 14px; font-weight: 700; }
.mode .i { width: 16px; height: 16px; }
.mode.short { padding-right: 6px; }
.m-o { --mc: var(--m-o); --mbg: var(--m-o-bg); }
.m-z { --mc: var(--m-z); --mbg: var(--m-z-bg); }
.m-s { --mc: var(--m-s); --mbg: var(--m-s-bg); }
.m-n { --mc: var(--m-n); --mbg: var(--m-n-bg); }

/* badge stato */
.status { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 14px; font-size: 14px; font-weight: 700; border: 1.5px solid transparent; white-space: nowrap; line-height: 1; }
.status .i { width: 16px; height: 16px; }
.st-plan { border-color: var(--border-strong); color: var(--text-2); background: var(--surface); }
.st-ok { background: var(--success-bg); color: var(--success); }
.st-wait { border-style: dashed; border-color: var(--warn-border); color: var(--warn-text); background: var(--warn-bg); }
.st-cancel { background: var(--surface-2); color: var(--text-3); text-decoration: line-through; }
.st-no { background: var(--danger-bg); color: var(--danger-text); }

/* conferma oratore */
.conf { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; }
.conf .i { width: 18px; height: 18px; }
.conf-ok { color: var(--success); }
.conf-wait { color: var(--warn-text); }
.conf-wait .i { color: var(--warn-icon); }
.conf-no { color: var(--warn-text); background: var(--warn-bg); padding: 3px 9px 3px 7px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--warn-border); }

/* tag */
.tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 13px; background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 700; white-space: nowrap; line-height: 1; }
.tag .i { width: 15px; height: 15px; }
.tag-split { background: transparent; border: 1.5px dashed var(--border-strong); color: var(--text); }
.tag-primary { background: var(--primary-soft); color: var(--primary); }
.tag-ok { background: var(--success-bg); color: var(--success); }
.tag-warn { background: var(--warn-bg); color: var(--warn-text); }

/* giornata in tandem */
.tandem { background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.tandem-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tandem-head .when { font-weight: 700; font-size: 16px; }
.tandem-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.cong-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.cong-cell { padding: 12px 14px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cong-cell + .cong-cell { border-left: 1px solid var(--border); }
.cong-cell .time { font-size: 21px; font-weight: 700; line-height: 1.2; }
.cong-cell .cname { font-weight: 700; font-size: 15px; }
.cong-cell .addr { font-size: 14px; color: var(--text-2); }

/* giornata separata */
.split { background: var(--surface); border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.split-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 2px; }
.split-head .when { font-weight: 700; font-size: 16px; }
.subcard { border: 1px solid var(--border); border-radius: var(--r); padding: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.subcard-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--text-2); font-weight: 700; }

/* slot */
.slot-free { display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 14px; border: 2px dashed var(--border-strong); border-radius: var(--r-lg); }
.slot-free .label-free { font-weight: 700; }
.slot-n { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--border); }
.slot-n .reason { font-weight: 700; font-size: 17px; }

/* avvisi */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1.5px solid var(--warn-border); background: var(--warn-bg); color: var(--warn-text); font-size: 15px; line-height: 1.4; }
.alert > .i { color: var(--warn-icon); margin-top: 1px; }
.alert-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.alert-title { font-weight: 700; }
.alert-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.alert-error { border-color: var(--danger); background: var(--danger-bg); color: var(--danger-text); }
.alert-error > .i { color: var(--danger); }
.alert-info { border-color: transparent; background: var(--primary-soft); color: var(--text); }
.alert-info > .i { color: var(--primary); }
.alert-success { border-color: transparent; background: var(--success-bg); color: var(--text); }
.alert-success > .i { color: var(--success); }

/* indicatore rotazione */
.rot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.rot .i { width: 17px; height: 17px; }
.rot b { color: var(--text); }
.rot.warn { background: var(--warn-bg); color: var(--warn-text); box-shadow: inset 0 0 0 1.5px var(--warn-border); }
.rot.warn b { color: var(--warn-text); }
.rot.warn .i { color: var(--warn-icon); }

/* indicatore equità */
.equity { display: flex; flex-direction: column; gap: 8px; }
.eq-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) 54px; align-items: center; gap: 10px; font-size: 14px; }
.eq-row .eq-v { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.eq-track { height: 14px; border-radius: 7px; background: var(--surface-2); display: flex; gap: 2px; overflow: hidden; }
.eq-fill { height: 100%; background: var(--primary); border-radius: 7px 0 0 7px; }
.eq-fill.recv { background: var(--m-o); }
.eq-pend { height: 100%; border: 2px dashed var(--primary); border-radius: 0 7px 7px 0; }
.eq-pend.recv { border-color: var(--m-o); }
.eq-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.eq-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: var(--primary); }
.lg.dash { background: transparent; border: 2px dashed var(--text-2); }

/* modificato nell'originale */
.diff { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; font-size: 14px; margin: 4px 0 0; }
.diff dt { color: var(--warn-text); }
.diff dd { margin: 0; }
.diff .old { text-decoration: line-through; opacity: .8; }
.diff .new { font-weight: 700; }

/* forse intendevi */
.similar { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.similar-item { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.similar-item .who { font-weight: 700; }

/* pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--r); border: 1.5px solid transparent; font-size: 16px; font-weight: 700; line-height: 1.1; text-decoration: none; white-space: nowrap; background: none; color: var(--text); }
.btn .i { width: 20px; height: 20px; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { color: var(--primary); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: var(--on-danger); }
.btn-danger-outline { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn-wa { background: var(--wa); color: #FFFFFF; }
.btn-wa:hover { background: var(--wa-hover); }
.btn-mail { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn-lg { min-height: 56px; font-size: 17px; padding: 0 22px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.sent { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--success); font-weight: 700; }
.sent .i { width: 18px; height: 18px; }
.textlink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; color: var(--primary); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; padding: 0; }

/* form */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 15px; font-weight: 700; color: var(--text); }
.label .opt { font-weight: 400; color: var(--text-3); }
.label .req { font-weight: 400; color: var(--text-2); }
.input { min-height: 50px; width: 100%; padding: 0 14px; border: 1.5px solid var(--border-strong); border-radius: var(--r); background: var(--surface); font-size: 17px; color: var(--text); }
textarea.input { padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.45; }
select.input { appearance: none; padding-right: 44px; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input.is-focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input::placeholder { color: var(--text-3); }
.input-wrap { position: relative; display: block; }
.input-wrap > .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.input-wrap > .i.end { left: auto; right: 14px; }
.input-wrap .input.has-ic { padding-left: 46px; }
.hint { font-size: 14px; color: var(--text-3); }
.field.invalid .input { border-color: var(--danger); border-width: 2px; }
.err { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; font-weight: 700; color: var(--danger-text); }
.err .i { color: var(--danger); width: 18px; height: 18px; margin-top: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.readonly-box { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--surface-2); }

/* menu suggerimenti */
.menu { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.menu-item:last-child { border-bottom: 0; }
.menu-item[aria-selected="true"] { background: var(--primary-soft); }

/* selettore a segmenti (modalità e scelte brevi) */
.seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.seg.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg-opt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 72px; padding: 8px 4px; border: 1.5px solid var(--border-strong); border-radius: var(--r); background: var(--surface); text-align: center; font-size: 13px; font-weight: 700; color: var(--text-2); line-height: 1.15; cursor: pointer; }
.seg-opt.low { min-height: 50px; font-size: 15px; flex-direction: row; gap: 6px; }
.seg-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-opt .ml { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--surface-2); color: var(--text); font-size: 17px; }
.seg-opt:has(input:checked) { border-color: var(--mc, var(--primary)); background: var(--mbg, var(--primary-soft)); color: var(--mc, var(--primary)); box-shadow: inset 0 0 0 1.5px var(--mc, var(--primary)); }
.seg-opt:has(input:checked) .ml { background: var(--mc, var(--primary)); color: var(--surface); }
.seg-opt:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }

/* scelte grandi (guest) */
.choice { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; border: 1.5px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); font-size: 17px; font-weight: 700; cursor: pointer; }
.choice input { width: 24px; height: 24px; accent-color: var(--primary); margin: 0; flex: none; }
.choice:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary); background: var(--primary-soft); }
.choice .sub { display: block; font-weight: 400; font-size: 14px; color: var(--text-2); }

/* interruttore e casella */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.switch { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: 16px; background: var(--border-strong); position: relative; flex: none; margin: 0; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF; transition: transform .15s; }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(20px); }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 16px; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--primary); margin: 0; flex: none; }

/* chip filtro, tab, toggle */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; }
.chip .i { width: 18px; height: 18px; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { min-height: 48px; padding: 0 14px; border: 0; background: none; font-weight: 700; color: var(--text-2); border-bottom: 3px solid transparent; margin-bottom: -1px; font-size: 16px; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.toggle { display: inline-flex; border: 1.5px solid var(--border-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.toggle button { min-height: 44px; padding: 0 14px; border: 0; background: none; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.toggle button + button { border-left: 1.5px solid var(--border-strong); }
.toggle button[aria-pressed="true"] { background: var(--text); color: var(--surface); }

/* liste */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.li { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.li:last-child { border-bottom: 0; }
a.li:hover { background: var(--surface-2); }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.li-title { font-weight: 700; }
.li-sub { font-size: 14px; color: var(--text-2); }
.li-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }

/* dati chiave-valore */
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; font-size: 15px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 700; }

/* toast e modale */
.toast { position: absolute; left: 16px; right: 16px; bottom: 96px; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; min-height: 60px; border-radius: var(--r-lg); background: var(--inverse); color: var(--on-inverse); box-shadow: var(--shadow-lg); font-weight: 700; z-index: 5; }
.toast > .i { color: var(--toast-ic); }
.toast-act { margin-left: auto; min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; background: none; border: 0; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.backdrop { position: absolute; inset: 0; background: var(--backdrop); display: flex; align-items: flex-end; z-index: 10; }
.sheet { width: 100%; background: var(--surface); border-radius: 22px 22px 0 0; padding: 8px 20px 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-lg); }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong); align-self: center; margin: 4px 0 4px; }
.dialog { background: var(--surface); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-lg); max-width: 440px; border: 1px solid var(--border); }
.danger-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--danger-bg); color: var(--danger); display: grid; place-items: center; }

/* stato vuoto */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 36px 20px; }
.empty-ic { width: 76px; height: 76px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); margin-bottom: 4px; }
.empty-ic .i { width: 34px; height: 34px; stroke-width: 1.75; }
.empty-ic.ok { background: var(--success-bg); color: var(--success); }

/* calendario mese (desktop) */
.cal-wrap { overflow-x: auto; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--border); gap: 1px; min-width: 820px; }
.cal-dow { background: var(--surface-2); padding: 8px 10px; font-size: 13px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.cal-day { background: var(--surface); min-height: 128px; padding: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; min-width: 0; }
.cal-day .d { font-weight: 700; font-size: 14px; color: var(--text-2); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; }
.cal-day.out { background: var(--surface-2); }
.cal-day.out .d { color: var(--text-3); }
.cal-day.today .d { background: var(--primary); color: var(--on-primary); }
.cal-ev { border-radius: 8px; padding: 6px 8px; background: var(--surface-2); line-height: 1.3; display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.cal-ev .t { font-weight: 700; }
.cal-ev.split-ev { border-style: dashed; border-color: var(--border-strong); }
.cal-free { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 2px dashed var(--border-strong); border-radius: 8px; background: none; color: var(--primary); font-weight: 700; font-size: 14px; }
.mini-ml { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; font-size: 12px; font-weight: 700; background: var(--mc); color: var(--surface); flex: none; }

/* tabella (solo desktop) */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 760px; }
.tbl th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .grp td { background: var(--surface-2); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); padding: 8px 14px; }

/* grafici */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 14px; }
.hbar .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.hbar-track { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.hbar-fill { height: 100%; background: var(--primary); border-radius: 5px; }
.hbar-fill.alt { background: var(--m-o); }
.stackbar { display: flex; height: 32px; border-radius: 8px; overflow: hidden; gap: 2px; }
.stackbar > span { display: grid; place-items: center; color: var(--surface); font-weight: 700; font-size: 14px; background: var(--mc); }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; font-size: 14px; }
.legend > div { display: flex; align-items: center; gap: 8px; }
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; }
.stat .v { font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 14px; color: var(--text-2); }

/* accesso */
.steps { display: flex; gap: 6px; }
.step { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); }
.step.done { background: var(--primary); }
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.otp input { height: 60px; width: 100%; text-align: center; font-size: 26px; font-weight: 700; border: 1.5px solid var(--border-strong); border-radius: var(--r); background: var(--surface); padding: 0; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; font-family: var(--mono); font-size: 17px; font-weight: 600; padding: 16px; background: var(--surface-2); border-radius: var(--r); letter-spacing: .03em; }
.qr { width: 184px; height: 184px; padding: 12px; background: #FFFFFF; border-radius: 12px; border: 1px solid var(--border); align-self: center; }

/* messaggi */
.bubble { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; white-space: pre-line; font-size: 15px; line-height: 1.5; border: 1px solid var(--border); }
.tok { font-family: var(--mono); font-size: 14px; background: var(--primary-soft); color: var(--primary); padding: 1px 6px; border-radius: 5px; font-weight: 600; white-space: nowrap; }
.tok-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 22px; border: 1.5px solid var(--border-strong); background: var(--surface); font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--primary); }

/* guest */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.guest-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.big-date { font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
.place { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); align-items: flex-start; }
.place .time { font-size: 26px; font-weight: 700; line-height: 1.1; min-width: 76px; }

/* =========================================================
   Prototipo funzionante: shell responsive con container query.
   Sotto i 960 px: barra in basso. Da 960 px: sidebar a sinistra.
   ========================================================= */
.app { width: 100%; container-type: inline-size; overflow: hidden; position: relative; display: flex; flex-direction: column; }
.app-shell { display: flex; flex: 1; min-height: 0; }
.app-side { display: none; }
.app-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.app-top { display: flex; align-items: center; gap: 6px; min-height: 60px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); flex: none; }
.app-top .avatar { margin-left: auto; }
.app-top-title { font-size: 19px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; padding-left: 4px; }
.app-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.app-content { width: 100%; max-width: 1120px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 24px; }
.app-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--border); padding: 4px 4px 10px; flex: none; }
.app-nav.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.app .navitem { border: 0; background: none; width: 100%; font-size: 12px; font-weight: 700; color: var(--text-2); }
.app .navitem[aria-current="page"] { color: var(--primary); }
.app .side-link { border: 0; background: none; width: 100%; text-align: left; font-weight: 700; color: var(--text-2); }
.app .side-link[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.app .app-side .group-switch { width: 100%; margin: 0 0 14px; }
.hide-m { display: none; }
.cols { display: flex; flex-direction: column; gap: 24px; }
.struck { text-decoration: line-through; }
.warn-txt { color: var(--warn-text); }
.auth-body { width: 100%; max-width: 440px; margin: 0 auto; padding: 44px 24px 40px; display: flex; flex-direction: column; gap: 24px; }
.guest-wrap { flex: 1; min-height: 0; overflow-y: auto; }
.guest-body { width: 100%; max-width: 600px; margin: 0 auto; padding: 20px 20px 56px; display: flex; flex-direction: column; gap: 20px; }
.sim-fab { position: absolute; right: 12px; top: 10px; z-index: 30; box-shadow: var(--shadow-lg); }
.sim { border: 2px dashed var(--border-strong); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
.week-block { display: flex; flex-direction: column; gap: 10px; }
.app > .toast { bottom: 88px; }
.toast.low { bottom: 24px; }
.cong-pair.one { grid-template-columns: minmax(0, 1fr); }
.place:first-child { border-top: 0; padding-top: 4px; }
.empty-ic.warn { background: var(--warn-bg); color: var(--warn-icon); }
.ro-actions { flex: 1 1 100%; display: flex; flex-direction: column; gap: 8px; padding-left: 48px; }
.li-wrap { flex-wrap: wrap; }
.li-wrap .li-main { flex: 1 1 160px; }
.stat-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.mv-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; align-items: baseline; }
.mv-k { font-size: 13px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.input-wrap > .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.input-wrap > .ico.end { left: auto; right: 14px; }
.out-row { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border-radius: var(--r); background: var(--primary-soft); color: var(--text); border: 0; width: 100%; text-align: left; font-size: 15px; font-weight: 700; cursor: pointer; }
.out-row .ico { color: var(--primary); }
.help-pop { position: absolute; top: 66px; right: 12px; z-index: 25; width: min(330px, calc(100% - 24px)); max-height: calc(100% - 90px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.4; }
.help-pop ol { list-style: decimal; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.help-q { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid currentColor; font-weight: 700; font-size: 14px; line-height: 1; }
.help-btn { color: var(--text-2); }
.combo { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.combo[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.hour-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.link-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.ico-close { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E"); }
.help-btn[aria-pressed="true"] { color: var(--primary); }

/* elementi cliccabili resi come <button> */
button.todo, button.li { width: 100%; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); text-align: left; color: var(--text); font: inherit; cursor: pointer; }
button.todo:last-child, button.li:last-child { border-bottom: 0; }
button.todo:hover, button.li:hover { background: var(--surface-2); }
.tb-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: 100%; border: 0; background: none; text-align: left; color: inherit; cursor: pointer; padding: 14px; }
.subcard .tb-btn { padding: 0; }
.menu button.menu-item { width: 100%; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); text-align: left; color: var(--text); cursor: pointer; }
.menu button.menu-item:last-child { border-bottom: 0; }
.menu button.menu-item:hover { background: var(--surface-2); }
.status-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; }
.slot-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 56px; padding: 10px 14px; border-radius: var(--r); border: 1.5px solid var(--border); background: var(--surface); text-align: left; font-weight: 700; color: var(--text); cursor: pointer; }
.slot-pick .occ { font-weight: 400; font-size: 14px; color: var(--text-2); }
.slot-pick.ok { border: 2px dashed var(--primary); }
.slot-pick.ok .occ { color: var(--primary); font-weight: 700; }
.slot-pick.on { border-style: solid; background: var(--primary-soft); box-shadow: inset 0 0 0 1.5px var(--primary); }
.slot-pick.dis { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }

/* calendario mese: compatto su mobile, dettagliato su desktop */
.mcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mc-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--text-2); padding: 4px 0; text-transform: uppercase; }
.mc { min-height: 56px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 14px; font-weight: 700; color: var(--text-3); min-width: 0; }
.mc.out { visibility: hidden; }
.mc.sat { color: var(--text); border-color: var(--border-strong); }
.mc.free { border: 2px dashed var(--primary); }
.mc.today .mc-n { background: var(--primary); color: var(--on-primary); }
.mc-n { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 12px; }
.mc-badges { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.mc-detail { display: none; }
button.mc { cursor: pointer; font: inherit; font-weight: 700; }
.mini-out { --mc: var(--primary); }

/* icone a maschera: <span class="ico ico-home"></span> (colore = currentColor) */
.ico { display: inline-block; width: 20px; height: 20px; flex: none; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 24px; height: 24px; }
.ico-home { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.ico-cal { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.ico-out { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6M20 4l-9 9M19 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E"); }
.ico-users { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c.8-3.6 3.4-5.5 6.5-5.5s5.7 1.9 6.5 5.5M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14.8c1.9.7 3 2.4 3.5 5.2'/%3E%3C/svg%3E"); }
.ico-dots { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='19' cy='12' r='2'/%3E%3C/svg%3E"); }
.ico-inbox { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13h5l1.5 3h5l1.5-3h5'/%3E%3Cpath d='M5 5h14l2 8v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-6z'/%3E%3C/svg%3E"); }
.ico-chart { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 20V11M11 20V4M17 20v-7M3 20h18'/%3E%3C/svg%3E"); }
.ico-doc { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h8.5L19 7.5V21H6z'/%3E%3Cpath d='M14 3v5h5M9 13h7M9 17h5'/%3E%3C/svg%3E"); }
.ico-shield { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 20 6v6c0 4.6-3.4 8.1-8 9-4.6-.9-8-4.4-8-9V6z'/%3E%3C/svg%3E"); }
.ico-grid { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E"); }
.ico-back { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M11 6l-6 6 6 6'/%3E%3C/svg%3E"); }
.ico-plus { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.ico-search { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E"); }
.ico-check { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.ico-clock { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3.2 2'/%3E%3C/svg%3E"); }
.ico-warn { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4.5M12 17.2v.1'/%3E%3C/svg%3E"); }
.ico-x { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m9 9 6 6M15 9l-6 6'/%3E%3C/svg%3E"); }
.ico-pin { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11.5a7 7 0 0 1 14 0C19 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E"); }
.ico-wa { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 20.5 5 16a8.5 8.5 0 1 1 3.2 3.1z'/%3E%3Cpath d='M9 9.5c.3 2.6 2.4 4.8 5.5 5.5'/%3E%3C/svg%3E"); }
.ico-mail { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3.5 7 8.5 6 8.5-6'/%3E%3C/svg%3E"); }
.ico-move { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4M8 15.5h8M13 13l3 2.5-3 2.5'/%3E%3C/svg%3E"); }
.ico-trash { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9.5 7V4h5v3M6 7l1 13h10l1-13'/%3E%3C/svg%3E"); }
.ico-split { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v18M5 8l-3 4 3 4M19 8l3 4-3 4'/%3E%3C/svg%3E"); }
.ico-tandem { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='12' r='5.5'/%3E%3Ccircle cx='15' cy='12' r='5.5'/%3E%3C/svg%3E"); }
.ico-copy { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='12' height='12' rx='2'/%3E%3Cpath d='M16 8V5a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h3'/%3E%3C/svg%3E"); }
.ico-link { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 1 0 5.7 5.7l1-1'/%3E%3C/svg%3E"); }
.ico-edit { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3C/svg%3E"); }
.ico-info { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.5M12 7.6v.1'/%3E%3C/svg%3E"); }
.ico-lock { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7.5a4 4 0 0 1 8 0V11'/%3E%3C/svg%3E"); }
.ico-chev { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E"); }
.ico-chevl { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 6-6 6 6 6'/%3E%3C/svg%3E"); }
.ico-chevd { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.ico-moon { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z'/%3E%3C/svg%3E"); }
.ico-refresh { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 0 0-14.5-4.5L4 8M4 4v4h4M4 13a8 8 0 0 0 14.5 4.5L20 16M20 20v-4h-4'/%3E%3C/svg%3E"); }
.ico-eye { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.ico-logout { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4M10 8l-4 4 4 4M6 12h10'/%3E%3C/svg%3E"); }
.ico-phone { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2z'/%3E%3C/svg%3E"); }
.ico-download { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E"); }
.ico-send { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 3 10 14M21 3l-7 18-4-7-7-4z'/%3E%3C/svg%3E"); }

/* icone dei badge: modalità (.mi) e stati/conferme (.ci) */
.mode .mi, .seg-opt .mi { width: 16px; height: 16px; }
.m-o .mi { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='7.5' r='3.5'/%3E%3Cpath d='M5 21c.9-4.2 3.6-6.5 7-6.5s6.1 2.3 7 6.5'/%3E%3C/svg%3E"); }
.m-z .mi { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='6' width='13' height='12' rx='2'/%3E%3Cpath d='m15.5 10 6-3.5v11l-6-3.5'/%3E%3C/svg%3E"); }
.m-s .mi { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M10 8.5v7l6-3.5z'/%3E%3C/svg%3E"); }
.m-n .mi { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M5.6 18.4 18.4 5.6'/%3E%3C/svg%3E"); }
.ci { width: 18px; height: 18px; }
.status .ci { width: 16px; height: 16px; }
.conf-ok .ci, .st-ok .ci { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.conf-wait .ci, .st-wait .ci { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3.2 2'/%3E%3C/svg%3E"); }
.conf-no .ci { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4.5M12 17.2v.1'/%3E%3C/svg%3E"); }
.st-no .ci, .st-cancel .ci { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m9 9 6 6M15 9l-6 6'/%3E%3C/svg%3E"); }
.st-plan .ci { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); }

@container (min-width: 960px) {
  .app-side { display: flex; flex-direction: column; gap: 2px; width: 268px; flex: none; background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; overflow-y: auto; }
  .app-nav { display: none; }
  .m-only { display: none; }
  .hide-m { display: block; }
  .app-top { min-height: 68px; padding: 8px 32px; }
  .app-top-title { font-size: 22px; }
  .app-content { padding: 28px 32px 56px; }
  .cols { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
  .cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app > .toast { left: auto; right: 24px; bottom: 24px; width: 420px; }
  .backdrop { align-items: center; justify-content: center; }
  .sheet { max-width: 480px; border-radius: 20px; }
  .grabber { display: none; }
  .stat-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mcal { gap: 6px; }
  .mc { min-height: 118px; align-items: stretch; padding: 8px; font-size: 13px; }
  .mc-badges { justify-content: flex-start; }
  .mc-detail { display: flex; flex-direction: column; gap: 2px; font-weight: 400; color: var(--text); line-height: 1.3; text-align: left; }
}


/* ===== 2-3. Livello Material 3 blu e componenti del prototipo ===== */

.prn-t{width:100%;border-collapse:collapse;font-size:15px}
.prn-t th{text-align:left;font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--text-2);padding:8px 10px;border-bottom:2px solid var(--border)}
.prn-t td{padding:10px;border-bottom:1px solid var(--border);vertical-align:top}
.prn-t td b{display:block}
.prn-sub{display:block;font-size:13px;color:var(--text-2)}
.prn-t tr.free td{color:var(--text-2);font-style:italic}
.prn-t tr.nday td{background:var(--surface-2)}
@media (max-width:600px){.prn-t{font-size:14px}.prn-t td,.prn-t th{padding:8px 6px}}
@media print{
  .app-side,.app-top,nav,.no-print,.sim-fab,.help-pop,.toast{display:none !important}
  .app-shell,.app-main{display:block !important;margin:0 !important;padding:0 !important;background:#fff !important}
  .prn-sheet{box-shadow:none !important;border:0 !important;padding:0 !important}
  body{background:#fff !important}
}


body{margin:0}

/* ===== Stile Material 3 blu (sovrascrive tp.css solo in questo prototipo) ===== */
.tp.app{--bg:#F8F9FF;--surface:#FFFFFF;--surface-2:#EEF0F9;--surface-3:#E2E5F0;--border:#E1E2EC;--border-strong:#757780;--text:#191C22;--text-2:#44474F;--text-3:#5D6069;
  --primary:#2B5BB8;--primary-hover:#244E9F;--primary-soft:#DAE2FF;--on-primary:#FFFFFF;--sec:#DCE2F9;--on-sec:#141B2C;
  --success:#1B6B3A;--success-bg:#C9EFD3;--warn-bg:#FFEFC2;--warn-border:#C99A1A;--warn-text:#5C3F00;--warn-icon:#8A6300;--danger:#BA1A1A;--danger-bg:#FFDAD6;--danger-text:#93000A;
  --inverse:#2E3036;--on-inverse:#F1F0F7;--toast-ic:#B2C5FF;--r-sm:8px;--r:12px;--r-lg:24px;
  --shadow:0 1px 2px rgba(30,40,80,.06);--shadow-lg:0 8px 28px rgba(20,30,70,.18);
  --font:"Roboto Flex",Roboto,system-ui,sans-serif;font-family:var(--font);letter-spacing:0}
.tp.app[data-theme="scuro"]{--bg:#111318;--surface:#1A1C22;--surface-2:#22252C;--surface-3:#2C3038;--border:#33363F;--border-strong:#8E9099;--text:#E2E2E9;--text-2:#C4C6D0;--text-3:#A5A8B2;
  --primary:#B2C5FF;--primary-hover:#C9D6FF;--primary-soft:#2A3E6E;--on-primary:#0E2E6E;--sec:#3C4458;--on-sec:#DCE2F9;--inverse:#E2E2E9;--on-inverse:#2E3036;--toast-ic:#2B5BB8}
.tp.app h1,.tp.app h2{font-weight:500;letter-spacing:0}
.tp.app h3{font-weight:600}
.tp .app-side{background:var(--surface-2);border-right:0;padding:16px 12px}
.tp.app .side-link{min-height:52px;border-radius:999px;padding:0 18px;font-weight:500}
.tp.app .side-link[aria-current="page"]{background:var(--sec);color:var(--on-sec);font-weight:700}
.tp.app .side-link:hover{background:var(--surface-3);color:var(--text)}
.tp .brand-mark{border-radius:14px}
.tp .gs-mark{border-radius:12px}
.tp .app-top{background:var(--bg);border-bottom:0}
.tp .app-top-title{font-weight:500}
.tp .card,.tp .list,.tp .todo-list,.tp .tandem,.tp .stat,.tp .tbl-wrap{border:0;border-radius:var(--r-lg);box-shadow:var(--shadow)}
.tp .card{padding:20px}
.tp .tandem{box-shadow:0 1px 3px rgba(30,40,80,.12)}
.tp .tandem-head{background:var(--sec);color:var(--on-sec);border-bottom:0}
.tp .split{border-radius:var(--r-lg);border-color:var(--border-strong)}
.tp .subcard,.tp .link-box,.tp .hour-row,.tp .readonly-box{border:0;background:var(--surface-2);border-radius:16px}
.tp .btn{border-radius:999px;font-weight:600;letter-spacing:.01em;font-size:15px;min-height:44px;padding:0 22px}
.tp .btn-lg{min-height:52px;font-size:16px}
.tp .btn-sm{min-height:40px;padding:0 16px;font-size:14px}
.tp .btn-primary{box-shadow:none}
.tp .btn-primary:hover{box-shadow:0 1px 3px rgba(30,40,80,.25)}
.tp .btn-secondary{background:transparent;color:var(--primary);border:1px solid var(--border-strong)}
.tp .btn-secondary:hover{background:var(--primary-soft)}
.tp .btn-ghost:hover{background:var(--primary-soft)}
.tp .btn-danger-outline{background:transparent;border-width:1px}
.tp .btn-mail{background:var(--sec);color:var(--on-sec);border:0}
.tp .chip{min-height:36px;border-radius:8px;border:1px solid var(--border-strong);background:transparent;font-weight:500;font-size:14px;padding:0 14px}
.tp .chip[aria-pressed="true"]{background:var(--sec);color:var(--on-sec);border-color:transparent;font-weight:600}
.tp .tok-btn{border-radius:8px;border-width:1px}
.tp .tabs{border-bottom:1px solid var(--border);gap:0 4px;flex-wrap:wrap;overflow:visible}
.tp .tab{flex:0 0 auto}
.tp .tabs::-webkit-scrollbar,.tp .chips.scroll::-webkit-scrollbar{display:none}
.tp .chips.scroll{scrollbar-width:none;overflow-y:hidden}
.tp .tab{margin-bottom:0}
.tp .tab{font-weight:500;padding:0 18px;border-bottom-width:3px}
.tp .tab[aria-selected="true"]{font-weight:700}
.tp .toggle{border-radius:999px;border:1px solid var(--border-strong)}
.tp .toggle button{font-weight:600;min-height:40px;padding:0 18px}
.tp .toggle button+button{border-left:1px solid var(--border-strong)}
.tp .toggle button[aria-pressed="true"]{background:var(--sec);color:var(--on-sec)}
.tp .input{border:0;border-bottom:1.5px solid var(--border-strong);border-radius:4px 4px 0 0;background:var(--surface-2);font-size:16px;min-height:52px}
.tp .input:focus,.tp .input.is-focus,.tp .combo[aria-expanded="true"]{border-bottom:2px solid var(--primary);box-shadow:none;background:var(--surface-3)}
.tp textarea.input{border-radius:4px 4px 0 0}
.tp .field.invalid .input{border-bottom-color:var(--danger)}
.tp .label{font-size:13px;font-weight:600;color:var(--text-2)}
.tp .hint{font-size:13px}
.tp .menu{border:0;border-radius:4px 4px 16px 16px;box-shadow:var(--shadow-lg)}
.tp .menu-item{border-bottom:0}
.tp .menu button.menu-item{border-bottom:0}
.tp .seg-opt{border:1px solid var(--border-strong);border-radius:12px;font-weight:600}
.tp .seg-opt:has(input:checked){border-color:transparent;box-shadow:none}
.tp .choice{border-width:1px;border-radius:16px}
.tp .choice:has(input:checked){box-shadow:none;border-color:var(--primary)}
.tp .alert{border:0;border-radius:16px;padding:14px 16px}
.tp .alert-info{background:var(--primary-soft);color:var(--text)}
.tp .status{border-radius:8px;font-weight:600;height:28px}
.tp .st-wait{border-style:solid;border-color:transparent}
.tp .tag{border-radius:8px;font-weight:600}
.tp .mode{border-radius:8px}
.tp .datebox{border-radius:16px;background:var(--primary-soft)}
.tp .datebox .dow,.tp .datebox .mm{color:var(--primary)}
.tp .slot-free{border-width:1.5px;border-color:var(--primary)}
.tp .slot-n{border:0;border-radius:var(--r-lg)}
.tp .li{min-height:64px}
.tp button.li:hover,.tp button.todo:hover{background:var(--surface-2)}
.tp .avatar{background:var(--primary-soft);color:var(--primary)}
.tp .mc{border:1px solid var(--border);background:var(--surface);border-radius:12px}
.tp .mc.sat{border:1px solid var(--border);background:var(--surface-2)}
.tp .mc.out{visibility:visible;border:0;background:transparent}
.tp .mc .mc-n{width:28px;min-width:28px;height:28px;border-radius:999px}
.tp .mc.free{border:1.5px dashed var(--primary);background:var(--surface)}
.tp .mcal{gap:6px}
.tp .pcal-d{border-radius:12px}
.tp .pcal-d.ok{border-width:1px}
.tp .toast{border-radius:8px;font-weight:500}
.tp .sheet,.tp .dialog{border-radius:28px;border:0}
.tp .help-pop{border:0;border-radius:16px;max-height:min(78vh,640px);overflow-y:auto}
.help-list{display:flex;flex-direction:column;gap:8px;line-height:1.4}
.tp .switch{background:var(--surface-3);box-shadow:inset 0 0 0 2px var(--border-strong)}
.tp .switch::after{background:var(--border-strong);width:16px;height:16px;top:8px;left:8px}
.tp .switch:checked{background:var(--primary);box-shadow:none}
.tp .switch:checked::after{background:var(--on-primary);width:24px;height:24px;top:4px;left:4px;transform:translateX(20px)}
.tp .eq-track{border-radius:999px}
.tp .count{border-radius:999px;background:var(--primary);color:var(--on-primary)}
.tp .empty-ic{background:var(--primary-soft);color:var(--primary)}
.tp .todo-num{border-radius:14px}
.gr-blocks{display:flex;flex-direction:column;gap:16px}
.td-block{display:flex;align-items:stretch;gap:10px}
.tp .day-box{background:var(--surface);border-radius:var(--r-lg);border:1px solid var(--border);border-left:6px solid var(--primary);box-shadow:0 2px 6px rgba(30,40,80,.10);overflow:hidden}
.tp .day-box.is-free{border-left-color:var(--border-strong);border-left-style:dashed;background:var(--surface)}
.tp .day-box.is-none{border-left-color:var(--text-3)}
.tp .day-box .tandem-head{background:var(--sec);color:var(--on-sec);padding:12px 16px}
.tp .day-box .tandem-head .when{font-size:17px}
.tp .week-block{gap:0}
.tp .day-box > sc-if > .tandem,.tp .day-box .tandem,.tp .day-box .split,.tp .day-box .slot-free,.tp .day-box .slot-n{border:0;border-radius:0;box-shadow:none}
.tp .day-box .slot-free{border:0;border-radius:0;margin:0;padding:12px 14px}
.tp .day-box .split{border:0;padding:12px}
.tp .day-outs{border-top:1px solid var(--border);padding:10px 14px 12px;display:flex;flex-direction:column;gap:6px;background:var(--surface)}
.tp .day-outs-h{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--text-3)}
.tp .day-outs .out-row{border-radius:12px}
.tp .um-wrap{position:relative;margin-left:auto;display:inline-flex}
.tp .app-top .um-wrap .avatar{margin-left:0;cursor:pointer}
.tp .um-menu{position:absolute;right:0;top:calc(100% + 8px);width:280px;z-index:40}
.tp .um-head{display:flex;gap:12px;align-items:center;padding:14px;border-bottom:1px solid var(--border)}
.tp .um-out{color:var(--danger)}
.tp .sp-missing{margin:6px 16px 4px 60px;padding:8px 12px;border-radius:14px;background:var(--surface-2);display:flex;flex-direction:column}
.tp .tag-home{background:#FFDBCB;color:#7A2E00}
.tp[data-theme="scuro"] .tag-home{background:#5C2400;color:#FFDBCB}
.tp .sp-add{display:grid;grid-template-columns:minmax(90px,120px) minmax(0,1fr);gap:10px}
.tp .cbx{display:flex;flex-direction:column;gap:4px}
.tp .cbx-menu{max-height:340px;overflow-y:auto}
.tp .cbx-search{position:sticky;top:0;z-index:1;background:var(--surface);padding:8px;border-bottom:1px solid var(--border)}
.tp .sp-list{display:flex;flex-direction:column;border-top:1px solid var(--border);padding:6px 0 6px 0;background:var(--surface)}
.tp .sp-list .li{padding-left:60px;min-height:56px;border-bottom:0}
.tp .sp-count{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-3);padding:6px 16px 2px 60px}
.tp .cg-head{border-bottom:0}
.tp .list.flat{box-shadow:none;border-radius:0;background:transparent;border-top:1px solid var(--border)}
.tp .list.flat .li{padding-left:0;padding-right:0}
.pcal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.pcal-h{font-size:13px;font-weight:700;color:var(--text-3);text-align:center;padding:4px 0}
.pcal-h.we{color:var(--primary)}
.pcal-d{min-height:44px;border-radius:var(--r-sm);border:1px solid transparent;background:transparent;font:inherit;font-size:15px;color:var(--text-3);display:flex;align-items:center;justify-content:center;position:relative;padding:0}
.pcal-d.we{background:var(--surface-2)}
.pcal-d.out{visibility:hidden}
.pcal-d.ok{color:var(--text);font-weight:700;border-color:var(--primary);background:var(--surface);cursor:pointer}
.pcal-d.ok.we{background:var(--primary-soft)}
.pcal-d.ok:hover{background:var(--primary-soft)}
.pcal-d.mtg::after{content:"";position:absolute;bottom:5px;width:5px;height:5px;border-radius:50%;background:var(--primary)}
.pcal-d.mine{border-style:dashed;border-color:var(--warn-border);background:var(--warn-bg);color:var(--warn-text)}
.pcal-d.on,.pcal-d.ok.on,.pcal-d.ok.we.on,.pcal-d.mine.on{background:var(--primary);color:var(--on-primary);border-color:var(--primary)}
.pcal-d.on::after{background:var(--on-primary)}
.pcal-d.ok.good{border-color:var(--success);background:var(--success-bg);color:var(--text)}
.pcal-d.ok.none{border-color:var(--border);border-style:dashed;background:transparent;color:var(--text-3);font-weight:400}
.pcal-sw.good{border-color:var(--success);background:var(--success-bg)}
.pcal-sw.none{border:1px dashed var(--border);background:transparent}
.pcal-legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:13px;color:var(--text-2)}
.pcal-legend span{display:inline-flex;align-items:center;gap:6px}
.pcal-sw{width:16px;height:16px;border-radius:4px;border:1px solid var(--primary);background:var(--surface)}
.pcal-sw.we{background:var(--surface-2);border-color:transparent}
.pcal-sw.mine{border:1px dashed var(--warn-border);background:var(--warn-bg)}
.td-brace{flex:0 0 40px;display:flex;align-items:center;gap:4px}
.td-brace-lbl{writing-mode:vertical-rl;transform:rotate(180deg);font-size:13px;font-weight:700;letter-spacing:.04em;color:var(--primary);display:flex;align-items:center;gap:6px}
.td-brace-line{position:relative;align-self:stretch;width:12px;margin:10px 0;border:2px solid var(--primary);border-right:none;border-radius:12px 0 0 12px}
.td-brace-line::after{content:"";position:absolute;left:-8px;top:50%;width:8px;border-top:2px solid var(--primary)}
.td-block .list{flex:1 1 auto;min-width:0;border-color:var(--primary)}


/* ===== Liste leggibili su schermi stretti: etichette a capo sotto il nome ===== */
.tp .li{flex-wrap:wrap;row-gap:6px}
.tp .li .li-main{flex:1 1 150px;min-width:0}
.tp .li .li-title,.tp .li .li-sub{overflow-wrap:anywhere}
.tp .li-right{flex:1 1 100%;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:6px;text-align:left;order:3;padding-left:46px}
.tp .li-right:empty{display:none}
.tp .li > .chev{order:2}
.tp .sp-list .li{padding-left:16px}
.tp .sp-count{padding-left:16px}
.tp .sp-missing{margin:6px 12px 4px 16px}
.tp .cbx-menu .menu-item{flex-wrap:nowrap}
.tp .sp-addbtn{margin:4px 0 4px 8px}
@container (min-width: 640px) { .tp .sp-addbtn{margin-left:48px} }
@container (min-width: 640px) {
  .tp .li{flex-wrap:nowrap}
  .tp .li-right{flex:0 0 auto;flex-direction:column;align-items:flex-end;text-align:right;order:0;padding-left:0}
  .tp .li > .chev{order:0}
  .tp .sp-list .li{padding-left:60px}
  .tp .sp-count{padding-left:60px}
  .tp .sp-missing{margin:6px 16px 4px 60px}
}
/* ===== Densità compatta su schermi larghi (≥ 960 px) ===== */
@container (min-width: 960px) {
.tp.dens-compact .app-side{width:236px;padding:12px 10px}
.tp.dens-compact .side-link{min-height:40px;font-size:14px;padding:0 14px;gap:10px}
.tp.dens-compact .side-brand,.tp.dens-compact .app-side .group-switch{font-size:15px}
.tp.dens-compact .app-top{min-height:56px;padding:6px 24px}
.tp.dens-compact .app-top-title{font-size:20px}
.tp.dens-compact .app-content{padding:20px 24px 40px;gap:16px;max-width:1180px}
.tp.dens-compact .app-scroll,.tp.dens-compact .guest-wrap{font-size:14.5px;line-height:1.45}
.tp.dens-compact h1{font-size:20px}.tp.dens-compact h2{font-size:16px}.tp.dens-compact h3{font-size:15px}
.tp.dens-compact .month-h{font-size:12.5px}
.tp.dens-compact .cols{gap:16px}
.tp.dens-compact .stack{gap:10px}.tp.dens-compact .stack-4{gap:12px}.tp.dens-compact .stack-6{gap:16px}.tp.dens-compact .section{gap:10px}
.tp.dens-compact .card{padding:14px 16px}
.tp.dens-compact .card-foot,.tp.dens-compact .card-head{padding:10px 14px}
.tp.dens-compact .input{min-height:40px;font-size:14.5px;padding:0 12px}
.tp.dens-compact textarea.input{min-height:80px;padding:8px 12px}
.tp.dens-compact .input-wrap .input.has-ic{padding-left:38px}
.tp.dens-compact .input-wrap > .ico{left:12px}.tp.dens-compact .input-wrap > .ico.end{left:auto;right:12px}
.tp.dens-compact select.input{padding-right:36px}
.tp.dens-compact .label{font-size:12.5px}
.tp.dens-compact .hint,.tp.dens-compact .small,.tp.dens-compact .li-sub{font-size:13px}
.tp.dens-compact .btn{min-height:38px;font-size:14px;padding:0 16px;gap:6px}
.tp.dens-compact .btn-sm{min-height:34px;font-size:13.5px;padding:0 12px}
.tp.dens-compact .btn-lg{min-height:44px;font-size:15px}
.tp.dens-compact .btn .ico{width:18px;height:18px}
.tp.dens-compact .icon-btn{width:38px;height:38px}
.tp.dens-compact .li{min-height:50px;padding:6px 12px;gap:10px}
.tp.dens-compact .menu-item{min-height:42px;padding:6px 12px}
.tp.dens-compact .chip{min-height:32px;font-size:13px;padding:0 12px}
.tp.dens-compact .tab{min-height:42px;font-size:14px;padding:0 14px}
.tp.dens-compact .toggle button{min-height:34px;font-size:13.5px}
.tp.dens-compact .tag{height:24px;font-size:12px;padding:0 8px}
.tp.dens-compact .status{height:24px;font-size:12.5px;padding:0 9px}
.tp.dens-compact .mode{height:24px;font-size:12.5px}
.tp.dens-compact .avatar{width:36px;height:36px;font-size:13px}.tp.dens-compact .avatar-sm{width:30px;height:30px;font-size:12px}
.tp.dens-compact .gs-mark{width:28px;height:28px}
.tp.dens-compact .datebox{width:50px;padding:5px 0}.tp.dens-compact .datebox .dd{font-size:21px}.tp.dens-compact .datebox .dow,.tp.dens-compact .datebox .mm{font-size:11.5px}
.tp.dens-compact .talk{font-size:15px}.tp.dens-compact .speaker{font-size:14px}
.tp.dens-compact .cong-cell{padding:8px 12px}.tp.dens-compact .cong-cell .time{font-size:17px}.tp.dens-compact .cong-cell .cname{font-size:14px}.tp.dens-compact .cong-cell .addr{font-size:12.5px}
.tp.dens-compact .tandem-head{padding:8px 12px}.tp.dens-compact .tandem-body{padding:10px 12px}
.tp.dens-compact .alert{padding:10px 12px;font-size:14px}
.tp.dens-compact .switch-row{min-height:44px}
.tp.dens-compact .seg-opt{min-height:56px;font-size:12.5px}.tp.dens-compact .seg-opt.low{min-height:40px;font-size:14px}
.tp.dens-compact .mc{min-height:90px;padding:6px}.tp.dens-compact .mcal{gap:4px}
.tp.dens-compact .pcal-d{min-height:38px;font-size:14px}
.tp.dens-compact .kv{font-size:14px;gap:6px 14px}
.tp.dens-compact .todo{min-height:56px;padding:8px 12px}.tp.dens-compact .todo-num{width:36px;height:36px;font-size:17px}.tp.dens-compact .todo-title{font-size:14.5px}
.tp.dens-compact .slot-free,.tp.dens-compact .slot-n{padding:8px 12px}
.tp.dens-compact .stat .v{font-size:22px}
.tp.dens-compact .empty{padding:24px 16px}.tp.dens-compact .empty-ic{width:60px;height:60px}
.tp.dens-compact .link-box,.tp.dens-compact .hour-row{padding:10px}
.tp.dens-compact .eq-row{font-size:13px}
.tp.dens-compact .sp-list .li{padding-left:52px;min-height:44px}.tp.dens-compact .sp-count{padding-left:52px}.tp.dens-compact .sp-missing{margin-left:52px}
.tp.dens-compact .guest-body{gap:16px}
}
