/* Lịch Việt v14.0.2 — iOS native date/time input sizing, shared layer.
 * Keep the native OS picker: do not replace date inputs with text or hide
 * native controls. Avoid clipping the enclosing forms or focus outlines.
 * WebKit iOS has a confirmed box-size issue with padded date/time inputs. */
:root { --lvg-v1402-native-field-height: 48px; }

/* A date input can have an intrinsic minimum larger than its CSS width.
 * Set the outer box and make its grid/flex ancestors shrinkable. */
body:not(.lvg-admin) :is(
  input[type="date"], input[type="time"], input[type="datetime-local"],
  input[type="month"], input[type="week"]
) {
  display: block;
  box-sizing: border-box !important;
  inline-size: 100% !important;
  min-inline-size: 0 !important;
  max-inline-size: 100% !important;
  min-block-size: var(--lvg-v1402-native-field-height);
  font-size: 16px !important;
  line-height: normal;
}
body:not(.lvg-admin) :is(
  .us-field, .us-panel, .us-two, .prayer-form-grid, .finder-filter,
  .departure-form, .departure-controls, .input-triple, .utility-card,
  .field, .form-row, .form-grid, .ak-pair, .studio-control-grid,
  .studio-tools, .controls, .v121-create-panel
) { min-inline-size: 0; max-inline-size: 100%; }
body:not(.lvg-admin) :is(
  .us-two, .prayer-form-grid, .departure-form, .input-triple,
  .form-row, .form-grid, .ak-pair, .studio-control-grid
) > * { min-inline-size: 0; }

/* WebKit uses these anonymous descendants for displayed localized date text.
 * Only constrain their content; preserve the OS picker and its indicator. */
body:not(.lvg-admin) :is(
  input[type="date"], input[type="time"], input[type="datetime-local"],
  input[type="month"], input[type="week"]
)::-webkit-date-and-time-value {
  min-inline-size: 0;
  max-inline-size: 100%;
  text-align: start;
}
body:not(.lvg-admin) :is(
  input[type="date"], input[type="time"], input[type="datetime-local"],
  input[type="month"], input[type="week"]
)::-webkit-datetime-edit { min-inline-size: 0; max-inline-size: 100%; padding: 0; }
body:not(.lvg-admin) :is(
  input[type="date"], input[type="time"], input[type="datetime-local"],
  input[type="month"], input[type="week"]
)::-webkit-datetime-edit-fields-wrapper { min-inline-size: 0; }

/* iOS WebKit issue #301648: padded native date/time controls can compute
 * content-box sizes even with box-sizing:border-box. Disabling only their
 * platform appearance lets the 100% outer box obey border-box. The type=date
 * semantics, calendar/timer dialog, min/max and submitted values are kept.
 * Never apply this block to checkbox/radio/select or non-iOS browsers. */
@supports (-webkit-touch-callout: none) {
  body:not(.lvg-admin) :is(
    input[type="date"], input[type="time"], input[type="datetime-local"],
    input[type="month"], input[type="week"]
  ) {
    -webkit-appearance: none;
    appearance: none;
    padding-inline: 12px !important;
    min-block-size: var(--lvg-v1402-native-field-height);
    border-radius: 12px;
    text-align: start;
  }
  body:not(.lvg-admin) :is(
    input[type="date"], input[type="time"], input[type="datetime-local"],
    input[type="month"], input[type="week"]
  )::-webkit-date-and-time-value { min-block-size: 1.5em; }
}

@media (max-width: 680px) {
  body:not(.lvg-admin) .us-two { grid-template-columns: minmax(0, 1fr); }
  body:not(.lvg-admin) .us-two > .us-field { min-inline-size: 0; }
}
