/* Month calendar and date/time picker (INVENTORY DT1, DT2; SPEC.md §4.26 — knowledge). */
.w2k-monthcal {
  display: inline-flex;
  flex-direction: column;
  padding: 0 var(--metric-monthcal-pad) 2px;
  background: var(--sys-window);
  color: var(--sys-window-text);
  font: var(--font-ui);
  user-select: none;
}
.w2k-monthcal__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--metric-monthcal-title-height);
  margin: 0 calc(-1 * var(--metric-monthcal-pad));
  padding: 0 4px;
  background: var(--sys-active-title);
  color: var(--sys-title-text);
  font: var(--font-ui-bold);
}
.w2k-monthcal__arrow {
  position: relative;
  width: 22px;
  height: 16px;
  border: 0;
  padding: 0;
  background: var(--color-control-face);
  box-shadow: var(--edge-control);
  outline: none;
}
.w2k-monthcal__arrow::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  border: 4px solid transparent;
  border-left: 0;
  border-right: 4px solid var(--sys-btn-text);
}
.w2k-monthcal__arrow[data-dir="1"]::before { left: 10px; border-right: 0; border-left: 4px solid var(--sys-btn-text); }
.w2k-monthcal__arrow[data-pressed]::before { transform: translate(1px, 1px); }
.w2k-monthcal__arrow[data-pressed] { box-shadow: var(--edge-sunken); }
.w2k-monthcal__days, .w2k-monthcal__week { display: grid; grid-template-columns: repeat(7, var(--metric-monthcal-cell-width)); }
.w2k-monthcal__days { height: var(--metric-monthcal-cell-height); margin-top: 3px; color: var(--color-monthcal-days, var(--sys-active-title));   /* the caption colour (a theme keeps it readable: js/palettes.js) */ box-shadow: inset 0 -1px var(--sys-btn-shadow); }
.w2k-monthcal__days > span, .w2k-monthcal__day { text-align: center; line-height: var(--metric-monthcal-cell-height); }
.w2k-monthcal__week { height: var(--metric-monthcal-cell-height); }
.w2k-monthcal__day { position: relative; cursor: inherit; }
.w2k-monthcal__day[data-trailing] { color: var(--sys-gray-text); }
.w2k-monthcal__day[data-bold] { font: var(--font-ui-bold); line-height: var(--metric-monthcal-cell-height); }
.w2k-monthcal__day[aria-selected="true"] { background: var(--sys-active-title); color: var(--sys-title-text); }
.w2k-monthcal__day[data-today]::after, .w2k-monthcal__mark {
  content: "";
  position: absolute;
  inset: 0 1px;
  border: 1px solid var(--color-monthcal-today);
  border-radius: 50%;
}
.w2k-monthcal__grid { outline: none; }
.w2k-monthcal__today { position: relative; display: flex; align-items: center; gap: 4px; height: var(--metric-monthcal-cell-height); padding-left: 2px; font: var(--font-ui-bold); }
.w2k-monthcal__mark { position: relative; inset: auto; width: 16px; height: 10px; border-radius: 0; }

/* Date/time picker: a combo-like field box with fields, the drop-down button or (time) an up-down. */
.w2k-dtp {
  position: relative;
  display: inline-flex;
  box-sizing: border-box;
  height: var(--metric-combo-height);
  background: var(--sys-window);
  box-shadow: var(--edge-sunken);
  color: var(--sys-window-text);
  font: var(--font-ui);
  vertical-align: top;
}
.w2k-dtp[data-format="time"] { height: var(--metric-dtp-time-height); margin-right: var(--metric-updown-width); }
.w2k-dtp__fields { flex: 1; padding: calc(2px + var(--metric-edit-text-top)) var(--metric-edit-margin) 0; white-space: pre; outline: none; overflow: hidden; }
.w2k-dtp__fields:focus .w2k-dtp__field[data-caret] { background: var(--sys-hilight); color: var(--sys-hilight-text); }
.w2k-dtp[data-none] .w2k-dtp__fields { color: var(--sys-gray-text); }
.w2k-dtp__check { flex: none; margin: 4px 0 0 4px; width: var(--metric-checkbox-size); height: var(--metric-checkbox-size); }
.w2k-dtp__button { position: absolute; }
.w2k-dtp__updown { position: absolute; left: calc(100% + 1px); top: 0; height: calc(var(--metric-dtp-time-height) - 2px); }   /* 1px after the field box (Date/Time) */
/* In the 9px buttons the down arrow sits 1px higher than in a spin's 10px ones (Date/Time, measured). */
.w2k-dtp__updown .w2k-updown__button[data-dir="down"]::before { top: calc(var(--metric-updown-glyph-top) - 1px); }
.w2k-dtp__popup {
  position: absolute;
  z-index: 2000000;
  box-shadow: inset 0 0 0 1px var(--sys-window-frame);
  padding: 1px;
  background: var(--sys-window);
}
