:root {
  --ink: #1d1d1f; --ink-2: #4a4a4f; --muted: #7a7a82; --line: #e4e4e8; --bg: #f6f6f4; --card: #ffffff;
  --accent: #f39200; --accent-d: #c97600; --accent-l: #fff2df;
  --ok: #2f7d32; --ok-l: #e7f4e8; --warn: #b26a00; --warn-l: #fff4e0; --err: #c62828; --err-l: #fdecea;
  --fest: #fdeceb; --sab: #f1f1f3; --sel: #ffe2b3;
  --r: 10px; --sh: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent-d); }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 18px 0 8px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.right { margin-left: auto; }
.hidden { display: none !important; }

/* layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #fff; padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; letter-spacing: .02em; }
.brand .logo { width: 38px; height: 38px; border-radius: 50%; display: block; flex: none; }
.brand small { display: block; font-weight: 400; color: #aaa; font-size: 12px; letter-spacing: 0; }
.nav a { display: block; color: #ddd; text-decoration: none; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.nav a:hover { background: #2c2c30; color: #fff; }
.nav a.on { background: var(--accent); color: var(--ink); font-weight: 600; }
.nav .sep { height: 1px; background: #333; margin: 10px 6px; }
.nav .lab { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .08em; padding: 8px 12px 4px; }
.side .who { margin-top: auto; font-size: 13px; color: #bbb; padding: 10px 12px; border-top: 1px solid #333; }
.side .who b { color: #fff; display: block; }
.side .who a { color: var(--accent); cursor: pointer; }
.main { padding: 22px 28px 60px; min-width: 0; }
.topbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 30% 0 0; z-index: 30; transform: translateX(-105%); transition: transform .2s; height: 100%; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .topbar { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 10px 14px; position: sticky; top: 0; z-index: 20; }
  .topbar button { background: none; border: 0; color: #fff; font-size: 22px; }
  .main { padding: 16px 12px 60px; }
}

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh); margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.warn { border-color: #f3c27a; background: var(--warn-l); }
.stat.err { border-color: #f1a9a5; background: var(--err-l); }

/* controls */
button, .btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
button:hover, .btn:hover { border-color: #cfcfd5; background: #fafafa; }
button.pri, .btn.pri { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 600; }
button.pri:hover { background: var(--accent-d); border-color: var(--accent-d); }
button.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
button.danger { color: var(--err); border-color: #f1c4c1; }
button.sm { padding: 5px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; border: 1px solid #d6d6dc; border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input[type=checkbox] { width: auto; }
label.f { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 10px; }
label.f > span { display: block; margin-bottom: 4px; }
label.chk { display: flex; gap: 8px; align-items: center; font-size: 14px; margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
@media (max-width: 700px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr 1fr; } }
.quick { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.quick button { padding: 4px 10px; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid #d6d6dc; border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 7px 12px; }
.seg button.on { background: var(--ink); color: #fff; }

/* tables */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 10px; border-bottom: 1px solid #efeff2; vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #fbfbfa; }
table.t tfoot td { font-weight: 650; border-top: 2px solid var(--line); }
table.t th.num, table.t td.num { text-align: right; }
table.t th.ctr, table.t td.ctr { text-align: center; }
.tablewrap { overflow-x: auto; }

/* badges */
.b { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b.bozza { background: #eee; color: #555; }
.b.inviato { background: #e3edfb; color: #1a56a8; }
.b.approvato { background: var(--ok-l); color: var(--ok); }
.b.chiuso { background: var(--ink); color: #fff; }
.b.warn { background: var(--warn-l); color: var(--warn); }
.b.err { background: var(--err-l); color: var(--err); }
.b.in_attesa { background: var(--warn-l); color: var(--warn); }
.b.approvata { background: var(--ok-l); color: var(--ok); }
.b.rifiutata, .b.annullata { background: #eee; color: #777; }

/* banners */
.banner { border-radius: var(--r); padding: 12px 16px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner.info { background: var(--accent-l); border: 1px solid #f7cf91; }
.banner.ok { background: var(--ok-l); border: 1px solid #b7dcb9; }
.banner.warn { background: var(--warn-l); border: 1px solid #f3c27a; }
.banner.err { background: var(--err-l); border: 1px solid #f1a9a5; }
.banner.dark { background: var(--ink); color: #fff; }

/* month header */
.monthnav { display: flex; align-items: center; gap: 8px; }
.monthnav .m { font-size: 20px; font-weight: 700; min-width: 170px; text-align: center; text-transform: capitalize; }
.monthnav button { padding: 6px 11px; }

/* grid presenze */
.mgrid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; user-select: none; -webkit-user-select: none; }
table.mgrid { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
table.mgrid th, table.mgrid td { text-align: center; padding: 0; height: 32px; min-width: 30px; border-right: 1px solid #f0f0f2; border-bottom: 1px solid #f0f0f2; font-variant-numeric: tabular-nums; }
table.mgrid th.lab, table.mgrid td.lab { position: sticky; left: 0; background: #fff; z-index: 2; text-align: left; padding: 0 10px; min-width: 92px; font-weight: 600; font-size: 12.5px; color: var(--ink-2); border-right: 1px solid var(--line); }
table.mgrid td.tot { font-weight: 700; min-width: 54px; background: #fafafa; }
table.mgrid thead th { font-size: 11.5px; color: var(--muted); font-weight: 600; height: 22px; }
table.mgrid thead tr.d th { font-size: 14px; color: var(--ink); height: 28px; }
table.mgrid .festivo, table.mgrid .domenica { background: var(--fest); }
table.mgrid .sabato { background: var(--sab); }
table.mgrid .today { box-shadow: inset 0 -3px 0 var(--accent); }
table.mgrid td.c { cursor: pointer; }
table.mgrid td.c:hover { background: #fff7ea; }
table.mgrid .sel { background: var(--sel) !important; }
table.mgrid .miss { background-image: repeating-linear-gradient(45deg, transparent 0 5px, rgba(198,40,40,.09) 5px 10px); }
table.mgrid .caus { font-weight: 700; font-size: 11.5px; border-radius: 5px; padding: 2px 4px; color: #fff; }
table.mgrid .tr { color: var(--accent-d); font-weight: 800; }
table.mgrid .fuori { background: #e9e9ec !important; color: #bbb; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 8px 2px 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; border: 1px solid #ddd; }

/* layout mese */
.mlayout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1599px) {
  .mlayout { grid-template-columns: 1fr; }
  .editor { position: static; }
  .editor #ef { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; align-items: start; }
  .editor #ef > .row { grid-column: 1 / -1; }
}
.editor { position: sticky; top: 16px; }
.editor .selinfo { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; background: var(--accent-l); padding: 8px 10px; border-radius: 8px; }

/* toast & modal */
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 100; max-width: 90vw; }
#toast.on { opacity: 1; }
#toast.err { background: var(--err); }
.modal { position: fixed; inset: 0; background: rgba(20,20,22,.45); z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 14px; max-width: 760px; width: 100%; max-height: 90vh; overflow: auto; padding: 22px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-box.wide { max-width: 980px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--ink); padding: 20px; }
.login .box { background: #fff; border-radius: 16px; padding: 30px 28px; width: 100%; max-width: 380px; }
.login .logo { width: 64px; height: 64px; border-radius: 50%; display: block; margin-bottom: 14px; }
.err-msg { color: var(--err); font-size: 14px; min-height: 20px; }

/* cedolino */
.ced { font-size: 13.5px; }
.ced td { padding: 5px 8px; border-bottom: 1px solid #f0f0f0; }
.ced .h td { font-weight: 700; background: #f6f6f6; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; font-size: 14px; }
.kv .t { font-weight: 700; border-top: 1px solid var(--line); padding-top: 6px; }
pre.json { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
textarea.code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; min-height: 420px; }

/* riordino anagrafica */
td.handle { cursor: grab; color: #b0b0b8; font-size: 16px; letter-spacing: -2px; width: 28px; text-align: center; user-select: none; }
td.handle:hover { color: var(--accent-d); }
tr.dragging td { background: var(--accent-l) !important; opacity: .7; }
tr.moved td { background: var(--accent-l); transition: background .6s; }
button.arrow { padding: 3px 8px; min-width: 28px; justify-content: center; }

/* doppia autenticazione */
.qrbox { display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 8px 0; }
.qrbox svg { width: 220px; height: 220px; }
input.otp { font-size: 26px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
code.key { font-family: ui-monospace, Menlo, monospace; font-size: 15px; background: #f4f4f4; padding: 3px 6px; border-radius: 6px; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; background: #f6f6f6; border-radius: 10px; padding: 14px; }
.codes code { font-family: ui-monospace, Menlo, monospace; font-size: 17px; text-align: center; }
details summary { cursor: pointer; color: var(--accent-d); }

/* vista tutti i dipendenti */
.toggle { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #d6d6dc; border-radius: 8px; padding: 7px 12px; font-size: 14px; margin: 0; cursor: pointer; white-space: nowrap; }
table.all { border-collapse: separate; border-spacing: 0; font-size: 12px; width: 100%; background: #fff; user-select: none; -webkit-user-select: none; }
table.all th, table.all td { border-bottom: 1px solid #f0f0f2; border-right: 1px solid #f3f3f5; text-align: center; padding: 0; height: 22px; min-width: 23px; font-variant-numeric: tabular-nums; }
table.all thead th { font-size: 10.5px; color: var(--muted); font-weight: 600; height: 18px; }
table.all thead tr.dd th { font-size: 12.5px; color: var(--ink); height: 22px; }
table.all td.nm { text-align: left; padding: 4px 10px; min-width: 150px; font-size: 12.5px; border-right: 1px solid var(--line); vertical-align: middle; line-height: 1.3; cursor: pointer; position: sticky; left: 0; background: #fff; z-index: 2; }
table.all td.nm:hover { background: #fff7ea; }
table.all td.nm .mt { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
table.all td.nm .b { font-size: 9.5px; padding: 1px 6px; }
table.all td.lb { text-align: left; padding: 0 8px; font-size: 11px; color: var(--ink-2); min-width: 70px; border-right: 1px solid var(--line); }
table.all tr.first td { border-top: 2px solid #d9d9de; }
table.all tr.odd td.lb, table.all tr.odd td.nm { background: #fbfbfa; }
table.all .fest { background: var(--fest); }
table.all .sab { background: var(--sab); }
table.all .oggi { box-shadow: inset 0 -2px 0 var(--accent); }
table.all td.c { cursor: pointer; }
table.all td.c:hover { background: #ffe9c4; }
table.all td.miss { background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(198,40,40,.12) 4px 8px); }
table.all td.fuori { background: #e9e9ec; }
table.all td.tt { font-weight: 700; min-width: 44px; background: #fafafa; border-left: 1px solid var(--line); }
table.all td.ex { font-size: 10.5px; color: var(--ink-2); min-width: 80px; text-align: left; padding: 0 6px; background: #fafafa; white-space: nowrap; }
table.all .cz { color: #fff; font-weight: 700; font-size: 10px; border-radius: 4px; padding: 1px 3px; }
table.all .tx { color: var(--accent-d); }
table.all tfoot td { font-weight: 700; background: var(--accent-l); border-top: 2px solid #e7c58c; height: 28px; }
table.all tfoot td.nm { background: var(--accent-l); }
/* v1.4 collaboratori esterni */
table.all tr.sepest td { background: #fdf1e0; color: #8a5300; font-weight: 600; font-size: 12px; padding: 6px 10px; text-align: left; border-top: 2px solid #f39200; }
.mgrid .prj { color: #f39200; font-size: 11px; }

/* ---------------------------------------------------------------- v1.5 telefono */
.tabbar, .sheet-wrap, .tlogo, .tuser, .tmore, .sideclose { display: none; }
.mcards { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.mcard { display: block; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; color: inherit; text-decoration: none; cursor: pointer; }
.mcard .hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mcard .hd .nm { font-weight: 700; font-size: 15px; margin-right: auto; }
.mcard .hd .nm span { font-weight: 400; }
.mcard .kv { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 7px; font-size: 13px; color: var(--ink-2); align-items: center; }
.mcard .kv b { font-size: 14px; color: var(--ink); }
.mcard .act { display: flex; gap: 8px; margin-top: 10px; }
.mcard .act button { flex: 1; justify-content: center; min-height: 42px; }
.mcard.tot { background: var(--accent-l); cursor: default; font-size: 13px; }
.sec { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 16px 2px 8px; }

@media (max-width: 700px) {
  body { -webkit-text-size-adjust: 100%; }
  body.noscroll { overflow: hidden; }
  .topbar { padding: calc(8px + env(safe-area-inset-top)) 14px 10px; }
  .topbar .tlogo { display: block; width: 28px; height: 28px; border-radius: 50%; }
  .topbar b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .tuser { display: block; margin-left: auto; font-size: 12px; color: #aaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
  .topbar .tmore { display: block; margin-left: 4px; }
  .side { inset: 0; padding-top: calc(18px + env(safe-area-inset-top)); overflow-y: auto; }
  .sideclose { display: block; margin-left: auto; background: none; border: 0; color: #fff; font-size: 22px; }
  .hide-m { display: none; }
  .topbar #burger:not(.tmore) + .tlogo + b { margin-right: auto; }
  .nav a { padding: 13px 14px; font-size: 16px; }
  .main { padding: 14px 12px 40px; }
  .main.withtab { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 21px; }
  input, select, textarea { font-size: 16px; min-height: 44px; }
  textarea { min-height: 64px; }
  button, .btn { min-height: 42px; }
  button.sm, .btn.sm { min-height: 36px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr !important; }
  .card { padding: 14px; border-radius: 14px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .row > .right { margin-left: 0; }
  /* barra in basso */
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 9px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
  .tabbar a i { font-style: normal; font-size: 21px; line-height: 1.1; }
  .tabbar a.on { color: var(--accent-d); }
  #toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  /* finestre a schermo intero */
  .modal { padding: 0; place-items: stretch; }
  .modal-box { max-width: none; max-height: none; height: 100%; border-radius: 0; padding: calc(16px + env(safe-area-inset-top)) 16px 30px; }
  /* tabelle larghe: colonna del nome fissa */
  .tablewrap table.t td:first-child, .tablewrap table.t th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; box-shadow: 1px 0 0 var(--line); }
  table.all td.nm, table.all th:first-child { position: sticky; left: 0; z-index: 2; }
  /* mese: navigazione, totali, elenco giorni */
  .mnav-m .monthnav { display: flex; width: 100%; justify-content: space-between; margin: 10px 0; }
  .mnav-m .monthnav .m { flex: 1; text-align: center; }
  .mnav-m .monthnav button { min-width: 40px; }
  .strip { display: flex; gap: 8px; overflow-x: auto; margin: 0 -12px 10px; padding: 0 12px 2px; scrollbar-width: none; }
  .strip .stat { flex: none; min-width: 92px; padding: 8px 11px; border-radius: 12px; }
  .strip .stat .v { font-size: 19px; }
  .agenda { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .agenda .d { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #eee; min-height: 54px; }
  .agenda .d:last-child { border-bottom: 0; }
  .agenda .d[data-d] { cursor: pointer; }
  .agenda .d .g { width: 40px; text-align: center; flex: none; }
  .agenda .d .g .w { font-size: 10.5px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
  .agenda .d .g .n { font-size: 19px; font-weight: 700; line-height: 1.05; }
  .agenda .d .c { flex: 1; min-width: 0; font-size: 13.5px; }
  .agenda .d .l1 { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
  .agenda .d .l2 { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .agenda .d .h { font-weight: 700; font-size: 15px; }
  .agenda .d .x { font-size: 12px; color: var(--muted); }
  .agenda .d .caus { color: #fff; font-size: 11px; font-weight: 700; border-radius: 5px; padding: 1px 6px; }
  .agenda .d .trb { color: var(--accent-d); font-weight: 800; font-size: 11.5px; border: 1.5px solid var(--accent); border-radius: 5px; padding: 0 5px; }
  .agenda .d .chev { color: #c4c4ca; font-size: 20px; }
  .agenda .d.we { background: #f7f7f8; }
  .agenda .d.fe { background: var(--fest); }
  .agenda .d.we .g .n, .agenda .d.fe .g .n { color: #b5b5bb; }
  .agenda .d.today { box-shadow: inset 4px 0 0 var(--accent); }
  .agenda .d.miss { background: repeating-linear-gradient(45deg, #fff 0 6px, #fdf0ef 6px 12px); }
  .agenda .d.miss .l1 { color: var(--err); font-weight: 600; }
  .agenda .d.sel { background: var(--accent-l); }
  .agenda .chk { width: 24px; height: 24px; border-radius: 7px; border: 2px solid #c9c9cf; flex: none; display: grid; place-items: center; color: transparent; font-size: 15px; font-weight: 800; }
  .agenda .chk.on { background: var(--accent); border-color: var(--accent); color: #fff; }
  .selbar { position: fixed; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 26; background: var(--ink); color: #fff; border-radius: 16px; padding: 10px 12px 10px 16px; display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: 13px; }
  .selbar span { color: #bbb; }
  .selbar button { margin-left: auto; }
  /* pannello dal basso */
  .sheet-wrap { display: block; position: fixed; inset: 0; z-index: 60; }
  .sheet-wrap[hidden] { display: none; }
  .sheet-dim { position: absolute; inset: 0; background: rgba(0,0,0,.38); }
  .sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 20px 20px 0 0; padding: 6px 0 calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,.2); animation: sheetUp .18s ease-out; }
  @keyframes sheetUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
  .sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #d4d4d8; margin: 4px auto 6px; }
  .sheet .editor { border: 0; box-shadow: none; margin: 0; padding: 4px 16px; position: static; }
  .sheet .editor h2 { font-size: 19px; margin-bottom: 4px; }
  .sheet .editor #ef { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
  .sheet .editor #ef > label.f { grid-column: 1 / -1; }
  .sheet .editor #ef > label.f:nth-of-type(2), .sheet .editor #ef > label.f:nth-of-type(3) { grid-column: auto; }
  .sheet .editor #ef > .row { grid-column: 1 / -1; display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
  .sheet .editor #ef > .row #eClear { grid-column: 1 / -1; border: 0; background: none; justify-content: center; min-height: 34px; }
  .sheet .editor #ef > .row button.pri { min-height: 50px; justify-content: center; font-size: 16px; }
  .sheet .quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
  .sheet .quick button { min-height: 46px; justify-content: center; font-size: 16px; font-weight: 700; background: #fafafa; }
}

/* v1.6 scelta del metodo di verifica */
button.metodo { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 10px; border-radius: 12px; border: 1.5px solid var(--line); }
button.metodo:hover { border-color: var(--accent); background: var(--accent-l); }
button.metodo b { font-size: 15px; display: flex; gap: 8px; align-items: center; }
button.metodo span:not(.b) { font-size: 13px; color: var(--muted); font-weight: 400; }
