/* ==========================================================================
   Time picker — every <input type="time" class="form-control"> becomes a field you can
   type in, with a list of times (a bottom sheet on phones). datetime-local becomes a
   date field + a time field. moey.js builds it; the real input stays in the form.
   ========================================================================== */

.timepicker { min-width: 0; }
.timepicker > .form-control { font-variant-numeric: tabular-nums; }
.timepicker > .form-control[readonly] { cursor: pointer; }
.timepicker-btn {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-inline-end: -.375rem;
  padding: 0;
  font-size: 1.0625rem;
  color: var(--mo-fg-3);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: var(--mo-radius-control);
}
.timepicker-btn:hover { color: var(--mo-fg-body); background: color-mix(in oklab, var(--mo-fg-body) 6%, transparent); }
/* (beats the adornment rule: a centered icon in a round button) */
.form-adorn.timepicker > .timepicker-btn { display: grid; place-items: center; top: 50%; translate: 0 -50%; border-radius: 999px; }
.form-adorn.timepicker > .timepicker-btn:not(:hover) { background: none; }

/* The list of times */
.timepicker-menu { max-height: min(17rem, 60vh); overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: .375rem; }
.timepicker-menu > .menu-item { font-variant-numeric: tabular-nums; }
.timepicker-menu > .menu-item.is-active { background: var(--mo-menu-item-hover, color-mix(in oklab, var(--mo-fg-body) 6%, transparent)); }
.timepicker-menu > .menu-item[aria-selected="true"] { font-weight: var(--mo-font-weight-semibold); color: var(--mo-default-fg-emphasis, var(--mo-fg-body)); }
.timepicker-menu > .menu-item[aria-selected="true"]::after {
  width: 1rem;
  height: 1rem;
  margin-inline-start: auto;
  content: "";
  background: currentcolor;
  mask: var(--mo-icon-check) center / contain no-repeat;
}
.timepicker-menu.is-sheet { max-height: min(60vh, 26rem); }

/* Date + time side by side */
.datetime-field { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: .5rem; min-width: 0; }
