/* ==========================================================================
   Selettori di data e ora (js/pickers.js)
   Riquadro sotto il pulsante; sui telefoni foglio dal basso.
   ========================================================================== */
.pk-layer { position: fixed; inset: 0; z-index: 450; }
.pk {
  position: fixed; width: 304px; max-width: calc(100vw - 16px);
  padding: 12px; border-radius: 14px;
  background: var(--raised); color: var(--ink);
  border: 1px solid var(--stroke-2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32), 0 2px 6px rgba(0, 0, 0, 0.12);
  opacity: 0; transform: translateY(-4px) scale(0.97);
  transition: opacity 0.16s, transform 0.2s var(--ease);
  -webkit-user-select: none; user-select: none;
}
.pk-layer.in .pk { opacity: 1; transform: none; }
.pk-layer.out .pk { opacity: 0; transform: scale(0.98); transition-duration: 0.14s; }
.pk-grab, .pk-sheet-title { display: none; }

/* foglio dal basso (schermi stretti) */
.pk-layer.sheet { display: flex; align-items: flex-end; background: rgba(0, 0, 0, 0); transition: background 0.2s; }
.pk-layer.sheet.in { background: rgba(0, 0, 0, 0.4); }
.pk-layer.sheet.out { background: rgba(0, 0, 0, 0); }
.pk-layer.sheet .pk {
  position: relative; left: auto; top: auto; width: 100%; max-width: none;
  padding: 8px 16px calc(14px + var(--sab, 0px)); border-radius: 20px 20px 0 0; border-bottom: 0;
  transform: translateY(100%); opacity: 1;
  transition: transform 0.3s var(--ease);
}
.pk-layer.sheet.in .pk { transform: none; }
.pk-layer.sheet.out .pk { transform: translateY(100%); }
.pk-layer.sheet .pk-grab { display: block; width: 38px; height: 5px; border-radius: 5px; background: var(--fill-3); margin: 0 auto 8px; }
.pk-layer.sheet .pk-sheet-title { display: block; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }

/* --- data --- */
.pk-head { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.pk-title {
  flex: 1; display: inline-flex; align-items: center; gap: 4px; justify-content: flex-start;
  height: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: none;
  color: var(--ink); font: inherit; font-size: 15.5px; font-weight: 600; cursor: pointer;
}
.pk-title svg { width: 16px; height: 16px; color: var(--ink-3); transition: transform 0.2s var(--ease); }
.pk.months .pk-title svg { transform: rotate(180deg); }
.pk-title:hover, .pk-arrow:hover { background: var(--fill-2); }
.pk-arrow { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ink-2); cursor: pointer; }
.pk-arrow svg { width: 17px; height: 17px; }
.pk-body { overflow: hidden; }
.pk-body.pk-sl > * { animation: pkL 0.26s var(--ease); }
.pk-body.pk-sr > * { animation: pkR 0.26s var(--ease); }
.pk-body.pk-zoom > * { animation: pkZ 0.22s var(--ease); }
@keyframes pkL { from { opacity: 0; transform: translateX(16px); } }
@keyframes pkR { from { opacity: 0; transform: translateX(-16px); } }
@keyframes pkZ { from { opacity: 0; transform: scale(0.94); } }
.pk-dow, .pk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.pk-dow span { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 2px 0 4px; }
.pk-day {
  position: relative; height: 38px; margin: 1px; border: 0; border-radius: 50%;
  background: none; color: var(--ink); font: inherit; font-size: 14px; font-variant-numeric: tabular-nums;
  cursor: pointer; display: grid; place-items: center; padding: 0;
  transition: background 0.12s, transform 0.12s var(--ease);
}
.pk-day::before { content: ""; position: absolute; width: 34px; height: 34px; border-radius: 50%; z-index: -1; transition: background 0.12s; }
.pk-day { z-index: 0; background: none; }
.pk-day:hover::before { background: var(--fill-2); }
.pk-day:active { transform: scale(0.9); }
.pk-day.out { color: var(--ink-4); }
.pk-day.sun:not(.sel) { color: var(--ko); }
.pk-day.sun.out:not(.sel) { opacity: 0.5; }
.pk-day.today::before { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.pk-day.today { font-weight: 700; }
.pk-day.sel { color: var(--on-solid); font-weight: 600; }
.pk-day.sel::before { background: var(--solid); }
.pk-day:focus-visible { outline: none; }
.pk-day:focus-visible::before { box-shadow: 0 0 0 2px var(--ink); }
.pk-months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px 0; }
.pk-mon { height: 52px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; font-size: 14.5px; cursor: pointer; transition: background 0.12s; }
.pk-mon:hover { background: var(--fill-2); }
.pk-mon.today { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.pk-mon.sel { background: var(--solid); color: var(--on-solid); font-weight: 600; }

/* scorciatoie */
.pk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--stroke); }
.pk-chip {
  display: inline-flex; align-items: baseline; gap: 4px; height: 32px; padding: 0 11px; align-items: center;
  border-radius: 999px; border: 1px solid var(--stroke-2); background: transparent;
  color: var(--ink); font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background 0.12s, transform 0.12s var(--ease);
}
.pk-chip small { font-size: 11.5px; color: var(--ink-3); }
.pk-chip:hover { background: var(--fill-2); }
.pk-chip:active { transform: scale(0.95); }
.pk-chip.active { background: var(--solid); color: var(--on-solid); border-color: transparent; }
.pk-chip.active small { color: inherit; opacity: 0.7; }
.pk-none { color: var(--ink-2); }

/* --- ora --- */
.pk.pk-time { width: 288px; }
.pk-thead { margin-bottom: 8px; }
.pk-tfield {
  width: 100%; height: 44px; box-sizing: border-box; padding: 0 12px; text-align: center;
  font: inherit; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink);
  background: var(--fill); border: 1px solid var(--stroke-2); border-radius: 10px; outline: none;
  -webkit-user-select: text; user-select: text;
}
.pk-tfield::placeholder { font-weight: 400; font-size: 16px; color: var(--ink-4); }
.pk-tfield:focus { border-color: var(--ink-3); }
.pk-tfield.bad { border-color: var(--ko); }
.pk-tfield.shake { animation: pkShake 0.3s; }
@keyframes pkShake { 25%, 75% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
.pk-wheels { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; height: 200px; }
.pk-band { position: absolute; left: 8px; right: 8px; top: 80px; height: 40px; border-radius: 10px; background: var(--fill-2); pointer-events: none; }
.pk-col {
  position: relative; width: 76px; height: 200px; overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; padding: 80px 0; box-sizing: border-box; scrollbar-width: none;
  outline: none; border-radius: 10px;
  -webkit-mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent);
  mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent);
}
.pk-col::-webkit-scrollbar { display: none; }
.pk-col:focus-visible { box-shadow: inset 0 0 0 2px var(--ink-3); -webkit-mask-image: none; mask-image: none; }
.pk-it {
  height: 40px; line-height: 40px; text-align: center; scroll-snap-align: center;
  font-size: 21px; font-variant-numeric: tabular-nums; color: var(--ink-3); cursor: pointer;
  transition: color 0.12s, transform 0.15s var(--ease);
}
.pk-it.on { color: var(--ink); font-weight: 600; }
.pk-colon { position: relative; font-size: 21px; font-weight: 600; color: var(--ink-2); }
.pk-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pk-layer.sheet .pk-foot .btn { flex: 1; height: 44px; }
.pk-layer.sheet .pk-col { width: 96px; }

@media (prefers-reduced-motion: reduce) {
  .pk, .pk-layer.sheet .pk { transition: opacity 0.12s; transform: none !important; }
  .pk-body > * { animation: none !important; }
}
