/* T-140 — THE date control's look (src/core/date-field.js), for every surface: the website, the guest card, the extension's side
   panel (the build copies this file to lib/date-field.css unchanged), the admin pages. The field itself keeps its page's own input
   style; this file only lays out [field + picker button inside it] / the picker (day · month · year) / the message. Colours are the pages' own
   tokens (light and dark), with fallbacks. --dt-size: the button's side (44 px touch target; the compact extension sets 36 px). */
.dt { display: grid; gap: 6px; min-width: 0; }
/* the field with the picker button inside its right end (like a native date field) — the whole "12 Feb 2036" stays visible in a
   150 px field (T-99 #2); the button is the field's full height and at least 44 px wide/tall (T-61 touch targets) */
.dt-row { position: relative; display: block; min-width: 0; }
.dt .dt-row > input.dt-text { display: block; width: 100%; min-width: 0; min-height: var(--dt-size, 44px); padding-right: calc(var(--dt-size, 44px) + 2px); box-sizing: border-box; font-variant-numeric: tabular-nums; }
.dt-btn { position: absolute; top: 0; right: 0; bottom: 0; display: grid; place-items: center; width: var(--dt-size, 44px); min-height: var(--dt-size, 44px); padding: 0; margin: 0;
  border: 0; border-radius: 0 var(--radius-s, 8px) var(--radius-s, 8px) 0; background: transparent; color: var(--ink-2); cursor: pointer; transition: color .2s ease, background-color .2s ease; }
.dt-btn svg { width: 20px; height: 20px; pointer-events: none; }
.dt-btn:hover { color: var(--brand-text); }
.dt-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.dt-btn[aria-expanded="true"] { color: var(--brand-text); background: var(--brand-soft); }
/* T-175 (his ask 10-12: "a simple calendar pop up"): the picker FLOATS over the page (position: fixed, placed by date-field.js under the
   field — above it when there is no room below) and never moves the layout; every word and year in it is OURS (Gregorian on every device) */
.dt-pick { position: fixed; z-index: 1000; display: grid; gap: 6px; padding: 10px; margin: 0; box-sizing: border-box; max-width: calc(100vw - 16px);
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-date); }
.dt-pick[hidden] { display: none; }
/* T-175 (his ruling 13 Oct): ONE calendar for every date — ‹ October 2026 › · Mo … Su · 40 px days; a birth date / an expiry shows month +
   year selectors in its header instead of the title (far years in one step); a birth date adds "Day not known" / "Day and month not known" */
.dt-pop-cal { width: max-content; }
.dt-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.dt-cal-title { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.dt-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dt-cal-pickers { display: flex; gap: 6px; min-width: 0; }
.dt-hsel { font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-s, 8px); min-height: 40px; padding: 4px 6px; font-variant-numeric: tabular-nums; cursor: pointer; }
.dt-hsel:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.dt-cal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 296px; }
.dt-unk { font: inherit; font-size: 13px; font-weight: 600; min-height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-s, 8px);
  background: transparent; color: var(--brand-text); cursor: pointer; }
.dt-unk:hover { background: var(--surface-2); }
.dt-unk:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.dt-nav { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-s, 8px);
  background: transparent; color: var(--ink); font: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.dt-nav:hover { background: var(--surface-2); }
.dt-nav:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.dt-cal { display: grid; gap: 2px; }
.dt-cal-days { display: grid; gap: 2px; }
.dt-cal-row { display: grid; grid-template-columns: repeat(7, 40px); gap: 2px; }
.dt-wd { display: grid; place-items: center; height: 24px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.dt-cell { display: grid; }
.dt-day { width: 40px; height: 40px; padding: 0; margin: 0; border: 0; border-radius: var(--radius-s, 8px); background: transparent; color: var(--ink);
  font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; }
.dt-day:hover { background: var(--surface-2); }
.dt-day[aria-current="date"] { box-shadow: inset 0 0 0 1.5px var(--brand-text); font-weight: 600; }
.dt-day[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.dt-day[aria-disabled="true"] { color: var(--ink-2); opacity: .45; cursor: not-allowed; background: transparent; }
.dt-day:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; position: relative; z-index: 1; }
.dt-note { grid-column: 1 / -1; font-size: 12px; font-weight: 400; color: var(--ink-2); }
.dt-msg { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--bad); }
.dt-msg:empty { display: none; }
.dt.dt-bad .dt-row > input.dt-text { border-color: var(--bad); }
/* T-175: an open picker no longer takes the whole row (it floats) — nothing in the form moves when it opens */
@media (prefers-reduced-motion: reduce) { .dt-btn { transition: none; } }
/* T-187 E3 / D2 / D3: on a touch screen every day, arrow and picker is a 44 px target; a press answers; the calendar eases in */
@media (pointer: coarse) {
  .dt-cal-row { grid-template-columns: repeat(7, 44px); }
  .dt-day, .dt-nav { width: 44px; height: 44px; }
  .dt-hsel, .dt-unk { min-height: 44px; }
}
@media (prefers-reduced-motion: no-preference) {
  .dt-day, .dt-nav { transition: background-color 120ms ease, transform 80ms ease-out; }
  .dt-day:active:not([aria-disabled="true"]), .dt-nav:active { transform: scale(.94); }
  .dt-pick:not([hidden]) { animation: dtIn 120ms cubic-bezier(.2, .7, .2, 1); transform-origin: top left; }
}
@keyframes dtIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
