/* v262: isolated entry/exit frames, independent counters and compact actions.
   No fixed heights or global font reduction; dates retain the v261 fit policy. */
@media screen {
  html body.hm185-app .app-shell .page-content .stay-v105-fields-grid {
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:none!important;gap:16px!important;align-items:start!important;
  }
  html body.hm185-app .app-shell .page-content .stay-v105-fields-grid :is(.stay-v105-heading-time,.stay-v105-heading-count,.stay-v105-check-in-date,.stay-v105-check-in-time,.stay-v105-check-out-date,.stay-v105-check-out-time,.stay-v105-family-count,.stay-v105-guest-count) {
    grid-area:auto!important;grid-column:auto!important;grid-row:auto!important;order:0!important;
  }
  .hm262-timing-group,.hm262-pilgrims,.hm262-moments,.hm262-counts {min-width:0;max-width:100%;}
  html body.hm185-app .app-shell .page-content .hm262-moments {
    display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr));gap:12px;align-items:start;
  }
  html body.hm185-app .app-shell .page-content fieldset.hm262-moment-frame {
    display:block;min-width:0;min-inline-size:0;width:100%;box-sizing:border-box;
    margin:0;padding:4px 12px 12px;border:1px solid #cfddee;border-radius:15px;background:#fafdff;
  }
  html body.hm185-app .app-shell .page-content fieldset.hm262-moment-frame > legend {
    width:auto;float:none;max-width:calc(100% - 24px);margin-inline:auto;padding:0 12px;
    border:0;background:#fafdff;color:#324762;font-size:max(14px,calc(14px * var(--ds-body-scale,1)));
    font-weight:800;line-height:1.7;white-space:normal;
  }
  html body.hm185-app .app-shell .page-content .hm262-moment-fields {
    display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);gap:10px 12px;align-items:end;min-width:0;
  }
  html body.hm185-app .app-shell .page-content .hm262-moment-fields > label {min-width:0;margin:0;display:grid;gap:6px;}
  html body.hm185-app .app-shell .page-content .hm262-field-caption {display:flex;align-items:baseline;justify-content:space-between;gap:6px;flex-wrap:wrap;}
  html body.hm185-app .app-shell .page-content .hm262-field-caption .stay-v59-required {float:none;margin:0;position:static;}
  html body.hm185-app .app-shell .page-content .hm262-counts {
    display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,calc(100px + 3em)),1fr));gap:10px;max-width:760px;font-size:max(16px,calc(16px * var(--ds-body-scale,1)));
  }
  .hm262-counts > fieldset {align-self:stretch;min-width:0;}
  .hm262-pilgrims h3,.hm262-timing-group h3 {margin:0 0 10px!important;}
  fieldset.hm262-moment-frame[hidden],.stay-v58-admin .hm201-primary-action[hidden] {display:none!important;}
  .hm262-moment-frame:focus-within {border-color:#7799d3!important;}
  .stay-v58-owner-hint {white-space:normal!important;overflow-wrap:anywhere;line-height:1.65!important;}
  .stay-v58-owner-hint:empty {display:none;}
  .hm262-counts input[data-stepper-input] {padding-inline:1px!important;}
  .stay-v58-detection.waiting {display:block!important;padding:6px 0!important;min-height:0!important;background:none!important;border:0!important;}
  .stay-v58-detection.waiting :is(.detect-icon,p) {display:none;}
  .stay-v58-detection.waiting b {font-size:13px;color:#60728d;}
  html body.hm185-app .app-shell .page-content .hm201-stays-pagebar {
    display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;
    padding:10px 12px!important;min-height:0;
  }
  html body.hm185-app .app-shell .page-content .hm201-stays-pagebar :is(.hm201-status-list,.hm201-pagebar-actions) {
    display:flex;flex-wrap:wrap;align-items:center;gap:8px;flex:0 1 auto;width:auto;min-width:0;
  }
  html body.hm185-app .app-shell .page-content .hm201-stays-pagebar .hm201-status-pill {width:auto;min-height:34px;padding:5px 10px;}
  html body.hm185-app .app-shell .page-content .hm201-stays-pagebar .hm201-rate-disclosure {width:auto;min-width:0;max-width:100%;}
  html body.hm185-app .app-shell .page-content .hm201-stays-pagebar .hm201-rate-disclosure > summary {
    display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:5px;min-height:44px;line-height:1.6;
    width:auto;min-width:0;max-width:100%;padding:7px 10px;
  }
  .hm262-rate-date {white-space:nowrap;direction:ltr;unicode-bidi:isolate;font-variant-numeric:tabular-nums;}
  .hm227-correction-form .hm262-moment-frame {margin-bottom:12px!important;}
  /* JS shows a 24-hour representation without replacing the native value/control. */
  .hm262-clock {position:relative;min-width:0;display:block;}
  .hm262-clock > input {width:100%;}
  .hm262-clock-value {display:none;}
  @supports selector(input::-webkit-datetime-edit) {
    .hm262-clock:not(:focus-within) > input::-webkit-datetime-edit {opacity:0;}
    .hm262-clock:not(:focus-within) > .hm262-clock-value {
      display:flex;align-items:center;justify-content:center;position:absolute;inset:0 38px 0 10px;
      direction:ltr;pointer-events:none;color:#253950;font-size:1rem;font-weight:750;
      font-variant-numeric:tabular-nums;line-height:1.5;
    }
    .hm262-clock:not(:focus-within) > input:disabled + .hm262-clock-value {color:#8a98aa;}
  }
}
@media screen and (max-width:767px) {
  html body.hm185-app .app-shell .page-content .hm262-moments {grid-template-columns:minmax(0,1fr);gap:10px;}
  html body.hm185-app .app-shell .page-content fieldset.hm262-moment-frame {padding-inline:10px;}
  html body.hm185-app .app-shell .page-content .stay-v58-admin :is(.stay-v58-new,.stay155-new-entry-body) {min-width:0;}
  html body.hm185-app .app-shell .page-content .hm262-moment-fields input {font-size:max(16px,1rem)!important;min-height:48px;}
  html body.hm185-app .app-shell .page-content .stay155-new-entry-toggle {padding-block:12px!important;}
  html body.hm185-app .app-shell .page-content .stay155-new-entry-toggle small {font-size:13px;line-height:1.7;}
}

/* v263: management check-in only, using the existing setMode() attribute.
   Query the usable form width, not the viewport (sidebar/insets/zoom matter).
   Unsupported container-query browsers retain the safe, stacked v262 layout.
   Owner, correction and complete-stay forms keep their existing presentation. */
@media screen {
  #stayFormV26 > .stay-v105-visit-fields {
    container-name: hm263-entry-layout;
    container-type: inline-size;
    min-width: 0;
  }
}
@media screen {
  @container hm263-entry-layout (min-width: 54rem) {
    html body.hm185-app .app-shell .page-content #stayFormV26[data-initial-mode="checkin"] .stay-v105-fields-grid {
      grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr)!important;
      column-gap: 16px!important;
      align-items: stretch!important;
    }
    #stayFormV26[data-initial-mode="checkin"] .stay-v105-fields-grid > :is(.hm262-timing-group, .hm262-pilgrims) {
      display: grid;
      grid-template-rows: auto 1fr;
      align-self: stretch;
    }
    html body.hm185-app .app-shell .page-content #stayFormV26[data-initial-mode="checkin"] .hm262-moments {
      grid-template-columns: minmax(0, 1fr);
      align-items: stretch;
    }
    #stayFormV26[data-initial-mode="checkin"] .hm262-counts {
      max-width: none;
      align-items: stretch;
    }
    #stayFormV26[data-initial-mode="checkin"] .hm262-counts > fieldset {
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding-block: 4px 12px;
      margin-block: 0;
    }
  }
}
