/* Typed date fields and type-a-name people pickers (js/shell/pickers.js). The page's own <input type="date"> and
   people <select> stay in the page, hidden, holding the value. */

.picker-src { display: none !important; }
.picker { position: relative; display: flex; align-items: center; width: 100%; min-width: 0; }
.picker.picker-inline { display: inline-flex; flex: 0 1 auto; max-width: 100%; }
.picker > input { width: 100%; padding-right: 36px; }
.picker.is-bad > input { border-color: var(--danger); }
.picker.is-disabled { opacity: .7; }

.dp-btn, .pp-caret {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.dp-btn:hover, .pp-caret:hover { background: var(--sunk); color: var(--ink); }
.pp-caret span { font-size: 12px; line-height: 1; }

/* the popover: fixed to the window, so a scrolling panel or a dialog can't clip it */
.picker-pop {
  position: fixed; z-index: 1000; margin: 0; padding: 8px; list-style: none; max-height: 70vh; overflow: auto;
  background: var(--raised); color: var(--ink); border: 2px solid var(--keyline); border-radius: var(--radius-s);
  box-shadow: var(--shadow-lift); overscroll-behavior: contain;
}
.picker-pop[hidden] { display: none; }

/* dates */
.dp-preview { margin: 2px 4px 8px; font-size: 13px; color: var(--muted); min-height: 18px; }
.dp-preview strong { color: var(--ink); font-weight: 700; }
.picker.is-bad .dp-preview { color: var(--danger); }
.dp-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.dp-chip {
  min-height: 30px; padding: 4px 10px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.dp-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.dp-chip.is-on { background: var(--gold); border-color: var(--keyline); color: var(--navy); }
.dp-chip.dp-clear { color: var(--muted); border-style: dashed; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 4px; }
.dp-month { font-family: var(--display); font-weight: 700; font-size: 16px; }
.dp-nav { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.dp-nav:hover { background: var(--sunk); }
.dp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--faint); padding: 4px 0; }
.dp-day {
  height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 13px;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.dp-day:hover:not(:disabled) { background: var(--accent-soft); }
.dp-day.is-other { color: var(--faint); }
.dp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 700; }
.dp-day.is-typed { background: var(--accent-soft); }
.dp-day.is-on { background: var(--gold); color: var(--navy); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--keyline); }
.dp-day:disabled { opacity: .35; cursor: default; }

/* people */
.pp > .pp-face { position: absolute; left: 7px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.pp:not(.has-face) > .pp-face { display: none; }
.pp.has-face > input { padding-left: 38px; }
.pp-face {
  display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--face-lav); color: var(--navy); border: 1.5px solid var(--keyline); font-size: 10.5px; font-weight: 700;
  text-transform: none; letter-spacing: .02em;
}
.pp-list { padding: 4px; }
.pp-item {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.pp-item.is-active { background: var(--accent-soft); }
.pp-item[aria-selected="true"] .pp-name { font-weight: 700; }
.pp-item.is-none .pp-name { color: var(--muted); }
.pp-dot { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1.5px dashed var(--line-strong); }
.pp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pp-name mark { background: none; color: inherit; font-weight: 800; text-decoration: underline; text-decoration-color: var(--gold-shade); text-decoration-thickness: 2px; text-underline-offset: 2px; }
.pp-note { flex: none; font-size: 12px; color: var(--muted); }
.pp-now { flex: none; color: var(--accent); font-weight: 800; }
.pp-empty { padding: 10px; font-size: 13px; color: var(--muted); }

:root[data-theme="dark"] .pp-face { background: var(--accent-soft); color: var(--ink); border-color: var(--line-strong); }
:root[data-theme="dark"] .dp-chip.is-on, :root[data-theme="dark"] .dp-day.is-on { color: var(--navy); }

/* phones: bigger targets */
@media (max-width: 899px), (pointer: coarse) {
  .dp-day { height: 40px; font-size: 14px; }
  .dp-chip { min-height: 36px; padding: 6px 12px; }
  .pp-item { min-height: 46px; }
  .picker > input { font-size: 16px; } /* stops iOS zooming in */
}
