.report-editor-modal.report-entry-modal {
  --report-number-width: 88px;
  --report-note-width: 32px;
}

.report-editor-modal.report-entry-modal .report-editor-form {
  container-type: inline-size;
}

.report-editor-modal.report-entry-modal .dynamic-report-grid,
.report-editor-modal.report-entry-modal .report-editor-grid:has(> .ant-form-item .ant-input-number) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px 16px;
  align-items: start;
}

.report-editor-modal.report-entry-modal .dynamic-report-grid > div {
  min-inline-size: 0;
  grid-row: auto;
}

.report-editor-modal.report-entry-modal .dynamic-report-wide,
.report-editor-modal.report-entry-modal .dynamic-report-grid > .ant-form-item:has(textarea) {
  grid-column: 1 / -1;
  display: block;
}

.report-editor-modal.report-entry-modal .dynamic-report-grid > div:not(.ant-form-item, .dynamic-report-wide, .dynamic-report-shifts):has(
  .ant-input-number, .dynamic-report-value, [data-canonical-field], > .ant-input, > .ant-select, > .ant-picker
),
.report-editor-modal.report-entry-modal :is(.report-editor-grid, .dynamic-report-grid) > .ant-form-item:has(.ant-input-number),
.report-editor-modal.report-entry-modal .care-staffing-grid .care-staffing-field:has(.ant-input-number, output) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--report-number-width);
  grid-template-rows: minmax(32px, auto);
  grid-row: auto;
  gap: 0 12px;
  align-items: center;
  padding-inline-end: 8px;
  min-inline-size: 0;
}

.report-entry-modal :is(.ant-form-item-label, .dynamic-report-label, .care-staffing-label) {
  margin-block-end: 0;
  text-align: start;
  white-space: normal;
  overflow-wrap: anywhere;
}

.report-entry-modal .dynamic-report-wide > .dynamic-report-label {
  margin-block-end: 6px;
}

.report-entry-modal :is(.report-editor-grid, .dynamic-report-grid) > .ant-form-item:has(.ant-input-number) > .ant-form-item-row {
  display: contents;
}

.report-entry-modal :is(.report-editor-grid, .dynamic-report-grid) > .ant-form-item:has(.ant-input-number) .ant-form-item-control {
  min-width: 0;
  flex: none;
}

.report-entry-modal .ant-input-number {
  width: 100%;
  min-height: 32px;
}

.report-editor-modal.report-entry-modal .report-editor-form .ant-input-number-input,
.report-editor-modal.report-entry-modal .dynamic-report-value,
.report-editor-modal.report-entry-modal [data-canonical-field] {
  text-align: center;
}

.report-editor-modal.report-entry-modal .report-editor-form .ant-input-number-input {
  padding-inline: 8px;
  height: 30px;
}

.report-entry-modal .care-staffing-shift .care-staffing-grid,
.report-editor-modal.report-entry-modal .care-staffing-shifts {
  grid-template-columns: minmax(0, 1fr);
}

.report-editor-modal.report-entry-modal .report-editor-identity-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

.report-editor-modal.report-entry-modal .report-editor-identity-grid > .ant-form-item {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  padding-inline-end: 8px;
}

@media (max-width: 767px) {
  .report-editor-modal.report-entry-modal .report-editor-form .ant-input-number-input {
    height: 34px;
  }
}

.report-editor-modal.report-entry-modal .report-editor-identity-grid > .ant-form-item > .ant-form-item-row {
  display: contents;
}

.report-editor-modal.report-entry-modal .report-editor-identity-grid .ant-form-item-label {
  padding: 0;
  text-align: start;
  white-space: normal;
}

.report-entry-modal .report-editor-identity-grid :is(input, .ant-select-selection-item, .ant-select-selection-placeholder) {
  text-align: start;
}

.report-entry-modal .report-editor-identity-grid :is(.ant-select-selector, .ant-input, .ant-picker) {
  padding-inline: 10px;
}

.report-editor-modal.report-entry-modal .report-entry-identity dd {
  text-align: start;
  padding-inline: 10px;
}

.report-editor-modal.report-entry-modal .dynamic-report-grid > div:is(.dynamic-report-with-note, .dynamic-report-note-only):not(.dynamic-report-wide) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  grid-template-rows: minmax(32px, auto);
  grid-row: auto;
  gap: 0 12px;
  align-items: center;
  padding-inline-end: 8px;
}

.report-editor-modal.report-entry-modal .dynamic-report-grid > div.dynamic-report-with-note:not(.dynamic-report-wide) {
  grid-template-columns: minmax(0, 1fr) var(--report-note-width) var(--report-number-width);
  column-gap: 6px;
}

.report-entry-modal .dynamic-report-note-only > .dynamic-report-control { width: var(--report-note-width); }
.report-entry-modal .dynamic-report-grid > .dynamic-report-with-note:only-child { grid-column: 1 / -1; }
.report-entry-modal .report-note-button {
  width: var(--report-note-width);
  min-width: 0;
  min-height: 32px;
  padding-inline: 6px;
  gap: 4px;
  font-size: var(--report-entry-text-size);
}
.report-note-indicator {
  position: absolute;
  inset-block-start: 2px;
  inset-inline-end: 3px;
  line-height: 1;
  color: var(--color-primary);
}
.report-note-modal .ant-modal-title,
.report-note-modal :is(textarea, .ant-btn) { font-size: 13px; }
.report-note-modal textarea { text-align: start; }

@media (max-width: 767px) {
  .report-editor-modal.report-entry-modal { --report-note-width: 38px; }
  .report-entry-modal .report-note-button { min-height: 38px; }
  .report-note-modal .ant-modal-title,
  .report-note-modal :is(textarea, .ant-btn) { font-size: 16px; }
}

.report-editor-modal.report-entry-modal .dynamic-report-grid > .dynamic-report-shifts {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: none;
  grid-auto-flow: row;
  gap: 16px;
  align-items: start;
  padding: 0;
}

.report-entry-modal .dynamic-report-shift { min-inline-size: 0; }
.report-entry-modal .report-shift-title { margin: 0 0 8px; font: inherit; font-weight: 600; }
.report-entry-modal .report-shift-time { margin: -4px 0 10px; font: inherit; }
.report-entry-modal .dynamic-report-control > .dynamic-report-value {
  border: 1px solid var(--color-divider);
  padding-inline: 8px;
  box-sizing: border-box;
}
.report-editor-modal.report-entry-modal .dynamic-report-shift > .dynamic-report-grid.dynamic-report-shift-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

@container (max-width: 659px) {
  .report-editor-modal.report-entry-modal .dynamic-report-grid > .dynamic-report-shifts {
    grid-template-columns: minmax(0, 1fr);
  }
  .report-editor-modal.report-entry-modal .dynamic-report-grid,
  .report-editor-modal.report-entry-modal .report-editor-grid:has(> .ant-form-item .ant-input-number) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@container (max-width: 400px) {
  .report-editor-modal.report-entry-modal .report-editor-identity-grid > .ant-form-item {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 8px;
  }
}

/* Use the same frame for stored and calculated values in report details. */
.dynamic-report-fields[data-read-only="true"] .dynamic-report-control > :is([data-canonical-field], .dynamic-report-value),
.report-mobile-detail :is(.report-mobile-detail-identity, .reports-mobile-counts, .report-mobile-detail-safety) dd {
  box-sizing: border-box;
  min-block-size: 32px;
  padding: 4px 8px;
  border: 1px solid var(--color-divider);
  display: grid;
  align-content: center;
  overflow-wrap: anywhere;
}
.dynamic-report-fields[data-read-only="true"] .dynamic-report-control > :is([data-canonical-field], .dynamic-report-value),
.report-mobile-detail :is(.reports-mobile-counts, .report-mobile-detail-safety) dd {
  text-align: center;
}

@media (max-width: 767px) {
  .dynamic-report-fields[data-read-only="true"] .dynamic-report-control > :is([data-canonical-field], .dynamic-report-value),
  .report-mobile-detail :is(.report-mobile-detail-identity, .reports-mobile-counts, .report-mobile-detail-safety) dd {
    min-block-size: 36px;
  }
}


.report-editor-modal.report-create-compact { --report-number-width: 76px; }
.report-editor-modal:is(.report-create-compact, .report-detail-modal) .ant-modal-header .ant-modal-title {
  font-size: 21px !important;
}
.report-editor-modal.report-create-compact .ant-modal-header .ant-modal-title {
  font-weight: 650 !important;
}
.report-create-compact .report-editor-section-card-primary { padding-block-end: 10px; border-bottom: 1px solid var(--color-divider); }
.report-create-compact .report-editor-section-card-primary .report-editor-identity-grid:empty { display: none; }
.report-create-compact .report-editor-entry-context { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.report-create-context { min-width: 0; color: var(--color-text-secondary); }
.report-create-context p { margin: 0; overflow-wrap: anywhere; }
.report-create-compact .report-editor-entry-context .ant-form-item { margin: 0; }
.report-create-compact .report-editor-entry-context .ant-form-item-row { flex-flow: row wrap; align-items: center; gap: 6px; }
.report-create-compact .report-editor-entry-context .ant-form-item-label { padding: 0; }
.report-create-compact .report-editor-entry-context .ant-form-item-control { flex: 0 0 138px; }
.report-create-compact .report-dynamic-section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.report-create-compact .dynamic-report-fields > :is(section, details):first-child { border-top: 0; padding-top: 0; }
.report-create-compact .dynamic-report-fields .dynamic-report-grid { row-gap: 0; }
.report-editor-modal.report-create-compact .dynamic-report-grid > [data-report-field]:not(.dynamic-report-wide) {
  grid-template-rows: minmax(30px, auto);
  border-bottom: 1px solid var(--color-divider);
  padding-block: 4px;
  padding-inline-end: 0;
}
.report-create-compact .dynamic-report-control > .dynamic-report-value,
.report-create-compact .dynamic-report-control > [data-canonical-field] > span[data-field-code] {
  display: grid;
  place-content: center;
  min-block-size: 32px;
  padding: 3px;
  border: 1px solid var(--color-divider);
  border-radius: 3px;
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface));
  color: var(--color-primary);
  font-weight: 600;
}
.report-create-compact details.report-entry-staffing:not([open]) { display: block; }
.report-create-compact .report-entry-staffing > summary { padding-block: 4px; color: var(--color-primary); font-weight: 650; cursor: pointer; }
.report-create-compact .report-entry-staffing[open] > summary { margin-bottom: 8px; }

@container (max-width: 659px) {
  .report-editor-modal.report-entry-modal .dynamic-report-grid > .dynamic-report-shifts {
    grid-template-columns: minmax(0, 1fr);
  }
  .report-editor-modal.report-entry-modal .dynamic-report-grid,
  .report-editor-modal.report-entry-modal .report-editor-grid:has(> .ant-form-item .ant-input-number) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@container (max-width: 400px) {
  .report-editor-modal.report-entry-modal .report-editor-identity-grid > .ant-form-item {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 8px;
  }
}

.report-compact-detail {
  container: report-detail / inline-size;
  display: grid;
  gap: 12px;
  padding-inline-end: 8px;
  color: var(--color-text-primary);
  font-size: var(--report-entry-text-size);
}

.report-editor-modal.report-detail-modal .ant-modal-header .ant-modal-title {
  color: var(--color-primary);
}

.report-detail-heading {
  display: grid;
  gap: 4px;
  padding-block-end: 12px;
  border-bottom: 1px solid var(--color-divider);
}

.report-detail-heading :is(h2, p) { margin: 0; overflow-wrap: anywhere; }
.report-detail-heading h2 { font-size: inherit; line-height: 1.3; font-weight: 650; }
.report-detail-heading p, .report-detail-footer { color: var(--color-text-secondary); }
.report-detail-context { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.report-detail-draft { color: var(--color-text-primary); font-weight: 600; }

.report-compact-detail .dynamic-report-fields { display: grid; gap: 12px; }
.report-compact-detail :is(.dynamic-report-fields > section, .report-detail-section) {
  display: grid;
  gap: 5px;
  padding-block: 0 4px;
}
.report-compact-detail .dynamic-report-fields > section + section {
  padding-block-start: 10px;
  border-top: 1px solid var(--color-divider);
}
.report-compact-detail :is(.report-editor-section-title.ant-typography, .report-detail-section > h3) {
  margin: 0;
  color: var(--color-primary);
  font-weight: 650;
}

.report-editor-modal.report-detail-modal .report-compact-detail :is(
  .ant-typography, .report-detail-section > h3, .ant-alert-message, .ant-alert-description,
  .ant-table, .ant-table-cell, .care-staffing-shift h4, .report-detail-footer a
) { font-size: var(--report-entry-text-size) !important; }

.report-compact-detail :is(.dynamic-report-grid, .report-detail-grid) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 20px;
  margin: 0;
}
.report-detail-modal .report-compact-detail :is(.dynamic-report-grid, .report-detail-grid) {
  column-gap: 24px;
}
.report-compact-detail .dynamic-report-shifts {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px 20px;
}
.report-compact-detail .report-shift-title { margin: 4px 0 0; font-weight: 600; }
.report-compact-detail .report-shift-time { margin: 0; color: var(--color-text-secondary); }
.report-compact-detail :is(.report-shift-title, .report-shift-time, [data-calculated="true"]) {
  font-size: var(--type-body-size, 14px);
}

.report-compact-detail .dynamic-report-grid > [data-report-field]:not(.report-detail-note-row, .dynamic-report-wide),
.report-detail-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) fit-content(55%);
  align-items: baseline;
  gap: 4px 10px;
  min-height: 34px;
  padding-block: 6px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--color-divider);
  overflow-wrap: anywhere;
}
.report-compact-detail .dynamic-report-grid .dynamic-report-label { margin: 0; }
.report-compact-detail .dynamic-report-control { min-width: 0; text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; }
.report-compact-detail .dynamic-report-control > :is([data-canonical-field], .dynamic-report-value) {
  min-height: 0;
  padding: 0;
}
.report-compact-detail [data-report-field="hienCon"] { color: var(--color-primary); font-weight: 650; }
.report-compact-detail .dynamic-report-wide > .dynamic-report-control { text-align: start; font-weight: inherit; }
.report-detail-extra, .report-detail-pair dd { margin: 0; }
.report-detail-pair dd { font-variant-numeric: tabular-nums; font-weight: 600; text-align: end; }
.report-detail-note-row { grid-column: 1 / -1; padding-block: 3px; }
.report-detail-note { grid-column: 1 / -1; overflow-wrap: anywhere; }
.report-detail-note summary { width: fit-content; max-width: 100%; padding-block: 4px; color: var(--color-primary); cursor: pointer; }
.report-detail-note p { margin: 2px 0 7px; white-space: pre-wrap; }
.report-detail-footer { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-block-start: 8px; }

@container report-detail (min-width: 550px) {
  .report-compact-detail :is(.dynamic-report-grid:not(.dynamic-report-shift-grid), .report-detail-grid, .dynamic-report-shifts) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (pointer: coarse) {
  .report-detail-note summary { min-height: 44px; align-content: center; }
}

.report-compact-detail .dynamic-report-fields[data-read-only="true"] .dynamic-report-control > :is([data-canonical-field], .dynamic-report-value) {
  border: 0;
  display: block;
  min-block-size: 0;
  padding: 0;
  text-align: end;
}
