#attendance-panel-shifts .attendance-shifts-workspace td .domain-detail-button {
  display: inline-flex;
  flex-flow: column nowrap;
  align-items: center;
  justify-content: center;
  gap: 2px;
  block-size: auto;
  min-inline-size: 0;
  max-inline-size: 100%;
  padding: 2px 4px !important;
  line-height: 16px;
  white-space: nowrap;
}

#attendance-panel-shifts .attendance-shifts-workspace dialog.paya-ant-table-detail[open] {
  --shift-detail-gutter: clamp(8px, 2vw, 24px);
  --shift-detail-height: calc(100dvh - 2 * var(--shift-detail-gutter));

  /* Center the native dialog in the viewport after the global margin reset. */
  position: fixed;
  inset: 0;
  margin: auto;
  inline-size: min(740px, calc(100% - 2 * var(--shift-detail-gutter)));
  max-inline-size: none;
  max-block-size: var(--shift-detail-height);
  overflow: hidden;
}

#attendance-panel-shifts .attendance-shifts-workspace .paya-ant-table-detail > .domain-detail-content {
  max-block-size: calc(var(--shift-detail-height) - 2px);
}

#attendance-panel-shifts .attendance-shifts-workspace .paya-ant-table-detail .domain-detail-body {
  min-block-size: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px clamp(12px, 2vw, 24px);
}

#attendance-panel-shifts .attendance-shifts-workspace .paya-ant-table-detail:has(.paya-shift-detail) .domain-detail-content > header {
  align-items: flex-start;
}

#attendance-panel-shifts .attendance-shifts-workspace .paya-ant-table-detail:has(.paya-shift-detail) .domain-detail-content > header h2 {
  overflow-wrap: anywhere;
}

.paya-shift-detail {
  container-type: inline-size;
  font-variant-numeric: tabular-nums;
}

.paya-shift-detail__identity,
.paya-shift-detail__values {
  display: grid;
  gap: 12px;
  margin: 0;
}

.paya-shift-detail__identity {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-secondary);
}

.paya-shift-detail__groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-block-start: 12px;
}

.paya-shift-detail__group {
  min-inline-size: 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.paya-shift-detail__group:nth-child(2) {
  background: var(--accent-soft);
  color: var(--accent-soft-foreground);
}

.paya-shift-detail__group h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}

.paya-shift-detail__values {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.paya-shift-detail__values:has(> :nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.paya-shift-detail dt {
  color: var(--muted);
  font-size: 12px;
}

.paya-shift-detail dd {
  margin: 4px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

#attendance-panel-shifts .attendance-shifts-workspace .paya-ant-table-detail:has(.paya-shift-detail) .domain-detail-body > .domain-card-actions {
  margin-block-start: 16px;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--border);
}

/* The assignment shortcut is the text-only button immediately before edit. */
#attendance-panel-shifts .attendance-shifts-workspace .paya-ant-table-detail
  .domain-detail-body:has(> .paya-shift-detail) > .domain-card-actions > .flex
  > button.paya-outline:first-child:not(:has([data-paya-icon])):has(+ button.paya-outline [data-paya-icon="edit"]) {
  display: none;
}

@container (max-width: 560px) {
  .paya-shift-detail__groups { grid-template-columns: 1fr; }
}

@container (max-width: 320px) {
  .paya-shift-detail__group,
  .paya-shift-detail__identity { padding-inline: 12px; }

  .paya-shift-detail__values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
