/* ============================================================
   첨부파일 — 기존 카드 위에 덧붙이는 요소만 정의한다 (카드 기본 스타일은 건드리지 않음)
   ============================================================ */

/* 접힌 카드의 첨부 개수 배지 (태그 줄에 붙음) */
.attach-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 20px;
  border: 1px solid rgba(33, 110, 118, 0.35);
  border-radius: 999px;
  background: rgba(33, 110, 118, 0.08);
  color: var(--primary-dark);
  padding: 0 7px 0 5px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.attach-badge svg,
.attach-add svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.task-meta-line .attach-badge,
.history-meta .attach-badge { margin-left: 6px; }

/* 펼친 카드의 첨부 영역 (상세 내용 아래) */
.attach-panel {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  cursor: default;
}
.attach-head { color: var(--muted); font-size: 12px; font-weight: 700; }
.attach-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.attach-item { position: relative; }

.attach-thumb {
  display: block;
  width: 76px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
}
.attach-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.attach-thumb:hover { border-color: var(--primary); }

.attach-file {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 58px;
  max-width: 220px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 10px;
  color: var(--text);
  text-decoration: none;
}
.attach-file:hover { border-color: var(--primary); }
.attach-file-icon {
  flex: 0 0 auto;
  border-radius: 4px;
  background: rgba(179, 59, 59, 0.1);
  color: var(--danger);
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 900;
}
.attach-file-text { min-width: 0; display: grid; line-height: 1.3; }
.attach-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.attach-file-text small { color: var(--muted); font-size: 11px; }

.attach-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 0;
  font-size: 13px;
  line-height: 1;
}
.attach-remove:hover { border-color: rgba(179, 59, 59, 0.45); color: var(--danger); }

.attach-uploading { color: var(--muted); font-size: 12px; font-weight: 700; }

.attach-add-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.attach-add.mini-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.attach-hint { color: var(--muted); font-size: 11px; }

/* 팀 진행 보고 목록: 상세 아래에 작게 */
.team-column li .attach-panel { margin-top: 6px; }
.team-column li .attach-head { display: none; }
.team-column li .attach-thumb { width: 60px; height: 46px; }
.team-column li .attach-file { height: 46px; }

/* 파일을 끌고 카드 위에 올렸을 때 */
.task-card.attach-drop-target { outline: 2px dashed var(--primary); outline-offset: 2px; background: rgba(33, 110, 118, 0.05); }

/* 업무 조회 창 */
.attach-view-week { display: grid; gap: 4px; margin-bottom: 8px; }
.attach-view-week small { color: var(--muted); font-size: 11px; font-weight: 700; }
dd.attach-panel { margin-top: 0; }

/* 사진 크게 보기 */
.attach-viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  background: rgba(15, 24, 33, 0.82);
}
.attach-viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  color: #fff;
  font-size: 13px;
}
.attach-viewer-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.attach-viewer-open { color: #bfe3e6; white-space: nowrap; }
.attach-viewer-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 18px;
  line-height: 1;
}
.attach-viewer-img {
  max-width: 100%;
  max-height: calc(100vh - 90px);
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}
