/* [AUTOMATED_WORKER] Capability fallbacks over frozen u3. Root HTML only.
   No :has(), container query or dynamic viewport unit is required by these rules. */

/* The live client clears the static body class. This root-only stylesheet uses
   the exact owned attendance backdrop/dialog identity, independent of app-shell. */
.attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] {
  grid-template-columns:minmax(0,1fr);
  min-width:0;
  min-height:0;
}
.attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] > header,
.attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] > .attendance-detail-body,
.attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] > footer,
.attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] > header > div {
  min-width:0;
  max-width:100%;
}
.attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] header h2,
.attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] header p,
.attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] .attendance-detail-body {
  overflow-wrap:break-word;
  overflow-wrap:anywhere;
}
.attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] input,
.attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] select,
.attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] textarea {
  min-width:0;
  max-width:100%;
}
.attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] .attendance-detail-body {
  min-height:0;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
/* Keep the intrinsic 24H date/time editor on a full row through the drawer range. */
@media (max-width:920px) {
  .attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] .attendance-detail-note,
  .attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] .attendance-detail-warning,
  .attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] .attendance-manual-time-form,
  .attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] .attendance-manual-workday-form {
    grid-template-columns:minmax(0,1fr);
    min-width:0;
    max-width:100%;
  }
}

/* Safari15.0 and engines without dvh need an explicit height cap. A fixed inset
   backdrop supplies the mobile percentage height; its middle row owns scrolling. */
@supports not (height:100dvh) {
  .attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] {
    max-height:calc(100vh - 36px);
  }
  .app-shell.tm-ui-full .tm-ui-header-tools-content {
    max-height:calc(100vh - var(--tm-ui-topbar-height) - var(--tm-ui-mobile-nav-height) - env(safe-area-inset-bottom) - 1.5rem);
  }
  .app-shell.tm-ui-full .modal-card,
  .app-shell.tm-ui-full .sheet,
  .app-shell.tm-ui-full .tm-photo-viewer {
    max-height:calc(100vh - 1.25rem);
  }
  @media (max-width:760px) {
    .attendance-detail-backdrop {
      grid-template-rows:minmax(0,1fr);
      min-height:0;
    }
    .attendance-detail-backdrop > .attendance-detail-dialog[aria-labelledby="attendance-detail-title"] {
      height:100%;
      max-height:100%;
      align-self:stretch;
    }
  }
}

/* Conservative viewport proxy for the90rem panel query: reserve room for the
  15rem desktop rail and page/panel gutters. This may regroup slightly earlier
   than a container query; it keeps the month field readable and leaves3387px wide. */
@supports not (container-type:inline-size) {
  @media (max-width:112rem) {
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-head {flex-direction:column;align-items:stretch;}
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-head > div:first-child {min-width:0;}
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-actions {display:flex;flex-wrap:wrap;align-items:flex-end;gap:.5rem;min-width:0;}
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-actions > * {max-width:100%;}
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-action-import {flex:1 1 100%;}
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-action-period {flex:1 1 14rem;min-width:0;}
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-action-period input {width:100%;min-width:0;max-width:100%;font-size:1rem;line-height:1.4;}
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-action-previous,
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-action-next,
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-action-refresh {flex:0 0 3rem;}
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-action-today,
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-action-calendar {flex:1 1 9rem;}
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-overview {flex-wrap:wrap;align-items:stretch;}
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-overview > span {flex:1 1 12rem;min-width:0;}
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-legend {flex:1 1 100%;min-width:0;justify-content:flex-start;gap:.5rem .75rem;}
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-legend > span {min-width:0;max-width:100%;font-size:.8125rem;line-height:1.4;}
    .app-shell.tm-ui-full .attendance-summary-panel .attendance-summary-legend i {flex:none;}
  }
}
