/* Shared compact, responsive forms and UK/Singapore-style date entry. */
:where(main, form, fieldset, .sheet, .panel, .form-grid, .two-col, .compact-fields, .editor-form) { min-width: 0; }
:where(form, .kiosk) :is(label, fieldset, .field, .form-grid, .form-row, .two-col, .compact-field, .sheet) { min-width: 0; }
:where(form, .kiosk) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}
:where(form, .kiosk) :is(input, select, textarea, button) { overflow-wrap: anywhere; }
.sj-dmy-wrap {
  display: block !important;
  position: relative !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
.sj-dmy-wrap .sj-dmy-input {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 39px;
  padding: 9px 42px 9px 11px !important;
  border: 1px solid #cbd8d3;
  border-radius: 9px;
  background: #fff;
  color: #243a33;
  font: inherit;
  font-size: max(14px, 1em);
  letter-spacing: 0;
  line-height: 1.35;
  text-overflow: clip;
}
.sj-dmy-wrap .sj-dmy-input::placeholder { color: #73847d; opacity: 1; }
.sj-dmy-wrap .sj-dmy-input:focus {
  outline: 2px solid #237cbd;
  outline-offset: 1px;
}
.sj-dmy-wrap .sj-dmy-input:invalid:not(:placeholder-shown) { border-color: #b83c46; }
.sj-dmy-wrap .sj-dmy-input:disabled { background: #edf0ed; color: #6c7470; }
.sj-dmy-wrap .sj-dmy-picker {
  box-sizing: border-box;
  position: absolute;
  top: 50%;
  right: 2px;
  transform: translateY(-50%);
  width: 36px;
  height: calc(100% - 4px);
  display: grid;
  place-items: center;
  border: none;
  border-radius: 7px;
  padding: 6px;
  background: transparent;
  color: #23719a;
  cursor: pointer;
}
.sj-dmy-wrap .sj-dmy-picker:hover { background: #edf7fa; }
.sj-dmy-wrap .sj-dmy-picker:focus-visible { outline: 2px solid #237cbd; }
.sj-dmy-wrap .sj-dmy-picker:disabled { opacity: .45; cursor: not-allowed; }
.sj-dmy-wrap .sj-dmy-picker svg { width: 20px; height: 20px; }
.sj-dmy-wrap input.sj-dmy-native[type="date"] {
  position: absolute !important;
  left: auto !important;
  top: 0 !important;
  right: 0 !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  max-width: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  border: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}
@media (max-width: 640px) {
  :where(form, .kiosk) :is(.form-grid, .two-col) { grid-template-columns: minmax(0, 1fr) !important; }
  .sj-dmy-wrap .sj-dmy-input { font-size: 16px !important; min-height: 44px; }
  :where(form, .kiosk) :is(label, fieldset, .form-row, .compact-field) { max-width: 100%; }
}
@media (max-width: 420px) {
  .sj-dmy-wrap .sj-dmy-input { padding-right: 35px !important; font-size: 14px !important; }
  .sj-dmy-wrap .sj-dmy-picker { width: 31px; }
}


/* Celebration enquiry uses horizontal label + date/time controls; keep the date bounded. */
body.sj-brand-v2.sj-enquiry-only #booking #celebrateEnquiry .sj-enquiry-date-field > .sj-dmy-wrap {
  flex: 0 1 170px !important;
  width: 170px !important;
  min-width: 0 !important;
  max-width: min(170px, 100%) !important;
}
/* Dense Gantt table: make all ten date digits readable without a protruding picker. */
#panelList .sj-dmy-wrap .sj-dmy-input {
  padding: 7px 4px !important;
  font-size: 12px !important;
  text-align: center;
  min-height: 33px;
}
#panelList .sj-dmy-wrap .sj-dmy-picker { display: none; }
/* Compact kiosk child profiles remain within the name/date grid. */
.sj-child-row > .sj-dmy-wrap { min-width: 0; max-width: 100%; }
.sj-child-row > .sj-dmy-wrap .sj-dmy-input { font-size: 14px; }
@media (max-width: 520px) {
  .sj-child-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .sj-child-row > input,
  .sj-child-row > .sj-dmy-wrap { min-width: 0 !important; max-width: 100% !important; }
}


/* Shared calendar button popup: visible and clickable even when the actual
   ISO date input is visually hidden. Works on mobile Safari and desktop. */
.sj-dmy-calendar[hidden] { display:none!important; }
.sj-dmy-calendar {
  position:fixed!important;
  z-index:2147483000!important;
  box-sizing:border-box;
  max-width:calc(100vw - 16px);
  padding:12px;
  border:1px solid #cbd8d3;
  border-radius:15px;
  background:#fffefa;
  color:#253d32;
  font-family:Arial,Helvetica,sans-serif;
  font-size:14px;
  box-shadow:0 15px 45px rgba(22,49,41,.24);
}
.sj-dmy-calendar .sj-cal-head {
  display:grid;grid-template-columns:32px minmax(0,1.2fr) minmax(0,.8fr) 32px;
  align-items:center;gap:5px;margin-bottom:11px;
}
.sj-dmy-calendar button,.sj-dmy-calendar select {
  box-sizing:border-box;min-width:0;
  border:1px solid #dbe3dc;
  border-radius:8px;background:#fff;
  color:#273d34;font:inherit;cursor:pointer;
}
.sj-dmy-calendar .sj-cal-head select { width:100%;height:37px;padding:4px 2px; }
.sj-dmy-calendar .sj-cal-nav { height:37px;font-size:24px;line-height:1; }
.sj-dmy-calendar .sj-cal-weekdays,
.sj-dmy-calendar .sj-cal-grid {
  display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;
}
.sj-dmy-calendar .sj-cal-weekdays { margin-bottom:5px; }
.sj-dmy-calendar .sj-cal-weekdays span {
  padding:5px 0;text-align:center;font-size:11px;font-weight:800;color:#5b7366;
}
.sj-dmy-calendar .sj-cal-day {
  aspect-ratio:1;min-height:35px;padding:0;display:grid;place-items:center;
  font-size:14px;font-weight:700;
}
.sj-dmy-calendar .sj-cal-day.is-today { border-color:#009739; }
/* Selected date text stays white even with the global brand's green
   button styles, or when the selected day is also marked as today. */
.sj-dmy-calendar button.sj-cal-day.is-selected,
.sj-dmy-calendar button.sj-cal-day.is-selected.is-today,
.sj-dmy-calendar button.sj-cal-day.is-selected:hover,
.sj-dmy-calendar button.sj-cal-day.is-selected:focus {
  background:#0057b7!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  border-color:#0057b7!important;
}
.sj-dmy-calendar button:disabled { color:#a7b0ab;opacity:.45;cursor:not-allowed; }
.sj-dmy-calendar button:focus-visible,.sj-dmy-calendar select:focus-visible {
  outline:2px solid #0057b7;outline-offset:2px;
}
.sj-dmy-calendar .sj-cal-footer {
  display:flex;justify-content:space-between;gap:8px;margin-top:12px;
}
.sj-dmy-calendar .sj-cal-footer button {
  min-height:36px;padding:6px 13px;color:#0057b7;font-weight:800;
}
.sj-dmy-calendar .sj-cal-footer button:first-child {
  color:#fff!important;-webkit-text-fill-color:#fff!important;
  background:#0057b7;border-color:#0057b7;
}
@media(max-width:420px){
  .sj-dmy-calendar{padding:9px;border-radius:12px;}
  .sj-dmy-calendar .sj-cal-day{min-height:34px;}
  .sj-dmy-wrap .sj-dmy-picker{min-width:34px;}
}
