/* [전체 업무 화면] 독립된 섹션 사이와 구분선 이후의 작업 버튼에 여백을 둡니다. */
@media screen {
  #content {
    --section-space: 24px;
    --divider-action-space: 18px;
  }

  /* 카드 뒤에 목록·입력 그리드가 이어져도 섹션 경계가 붙지 않도록 합니다. */
  #content > .card + :is(.card, .operation-grid, .work-grid),
  #content > :is(.operation-grid, .work-grid) + .card {
    margin-block-start: var(--section-space);
  }

  /* 목록 마지막 행의 아래 구분선과 후속 작업 버튼을 분리합니다. */
  #content .card > :is(.record, .list-row, hr) + :is(.button, form) {
    margin-block-start: var(--divider-action-space);
  }

  /* 상세 문항·원본·선택 설정을 펼쳤을 때 제목과 실제 내용을 구분합니다. */
  #content .record details[open] > summary,
  #content details.card[open] > summary,
  #content details.spaced[open] > summary {
    margin-block-end: 14px;
  }

  /* 자료 문항의 제목과 수정 버튼을 같은 행에 두고 긴 제목은 행 안에서 줄바꿈합니다. */
  .resource-item-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-block-end: 14px;
  }
  .resource-item-heading > h3 {
    flex: 1;
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
  }
  .resource-item-heading > .button {
    flex: 0 0 auto;
    margin: 0;
  }
}

@media screen and (max-width: 600px) {
  #content {
    --section-space: 20px;
    --divider-action-space: 16px;
  }
  #content .record details[open] > summary,
  #content details.card[open] > summary,
  #content details.spaced[open] > summary {
    margin-block-end: 12px;
  }
}
