/* ============================================================
   PetCare+ · 병원 기록 전용 CSS
   ============================================================ */

/* ── 섹션 헤더 ── */
.pv2-header-actions {
  gap: 8px;
}

#btn-add .material-symbols-rounded,
#btn-search .material-symbols-rounded {
  color: #0F2A1F;
  font-size: 25px;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.hosp-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 8px;
}
.hosp-section-title {
  font-size: 15px; font-weight: 800; color: var(--color-text-main);
}
.hosp-text-btn {
  font-size: 13px; font-weight: 600; color: var(--color-primary);
  border: none; background: none; cursor: pointer; padding: 4px 0;
}

/* ── 폼 섹션 ── */
.hosp-form-section {
  background: #fff;
  border-radius: var(--radius-lg);
  margin: 12px 0 0;
  padding: 20px 16px 8px;
}
.hosp-form-section-title {
  font-size: 16px; font-weight: 900; color: var(--color-text-main);
  margin-bottom: 20px;
}
.hosp-form-section .form-group {
  margin-bottom: 16px;
}
.hosp-form-section .form-group:last-child {
  margin-bottom: 0;
}
.hosp-section-desc {
  font-size: 13px; color: var(--color-text-sub); line-height: 1.5;
  margin-bottom: 14px;
}
.form-required {
  font-size: 11px; font-weight: 600; color: var(--color-primary);
  background: var(--color-primary-soft); border-radius: 4px;
  padding: 1px 5px; margin-left: 4px;
}
.form-opt {
  font-size: 11px; font-weight: 500; color: var(--color-text-light);
  margin-left: 4px;
}
.form-hint {
  font-size: 12px; color: var(--color-text-light); margin-top: 6px;
}
.hosp-label-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.hosp-clear-btn {
  font-size: 12px; color: var(--color-text-light); border: none;
  background: none; cursor: pointer; padding: 0; margin: 0 0 6px;
  line-height: 1.3; white-space: nowrap;
  display: none;
}
.hosp-clear-btn.show { display: inline-flex; }

/* ── 칩 그룹 ── */
.hosp-chip-group {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px;
}
.hosp-chip {
  padding: 7px 14px; border-radius: 999px;
  border: 1.5px solid var(--color-border);
  background: #fff; font-size: 13px; font-weight: 500;
  color: var(--color-text-sub); cursor: pointer;
  transition: all 0.15s;
}
.hosp-chip.active {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary); font-weight: 700;
}

/* ── 첨부 버튼 ── */
.hosp-attach-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: #FAFAFA; color: var(--color-text-sub);
  font-size: 14px; font-weight: 600; cursor: pointer;
  margin-bottom: 12px; transition: border-color 0.15s;
}
.hosp-attach-btn:active { border-color: var(--color-primary); }
.hosp-attach-btn .material-symbols-rounded { font-size: 20px; }

/* ── 첨부 자료 카드 ── */
.hosp-attach-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: #F8FAF8; border-radius: var(--radius-md);
  padding: 12px 14px; margin-bottom: 10px;
}
.hosp-attach-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--c-hospital-bg); color: var(--c-hospital);
}
.hosp-attach-icon.img { background: var(--c-photo-bg); color: var(--c-photo); }
.hosp-attach-icon .material-symbols-rounded {
  font-size: 20px; font-family: 'Material Symbols Rounded';
  font-style: normal; line-height: 1;
}
.hosp-attach-info { flex: 1; min-width: 0; }
.hosp-attach-title {
  font-size: 14px; font-weight: 700; color: var(--color-text-main);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hosp-attach-meta {
  font-size: 12px; color: var(--color-text-sub); margin-top: 3px;
}
.hosp-attach-actions {
  display: flex; gap: 4px; flex-shrink: 0;
}
.hosp-icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--color-text-light);
  transition: background 0.15s;
}
.hosp-icon-btn:active { background: var(--color-border); }
.hosp-icon-btn .material-symbols-rounded {
  font-size: 18px; font-family: 'Material Symbols Rounded';
  font-style: normal; line-height: 1;
}
.hosp-icon-btn.danger { color: #ef4444; }

/* ── 하단 고정 바 ── */
.hosp-bottom-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff; border-top: 1px solid var(--color-border);
}

/* ── 병원 방문 카드 ── */
.hosp-visit-card {
  background: #fff; border-radius: var(--radius-lg);
  margin: 0 0 10px; padding: 16px;
  cursor: pointer; transition: opacity 0.15s;
}
.hosp-visit-card:active { opacity: 0.75; }
.hosp-visit-header {
  display: flex; align-items: flex-start; gap: 12px;
}
.hosp-visit-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px;
  font-family: 'Material Symbols Rounded'; font-style: normal; line-height: 1;
}
.hosp-visit-body { flex: 1; min-width: 0; }
.hosp-visit-name {
  font-size: 15px; font-weight: 700; color: var(--color-text-main);
}
.hosp-visit-meta {
  font-size: 12px; color: var(--color-text-sub); margin-top: 3px;
}
.hosp-visit-content {
  font-size: 12px; color: var(--color-text-light);
  margin-top: 6px; line-height: 1.5;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.hosp-visit-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--color-border);
}
.hosp-visit-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.hosp-tag {
  font-size: 11px; font-weight: 600; padding: 3px 8px;
  border-radius: 999px; background: var(--color-primary-soft);
  color: var(--color-primary);
}
.hosp-tag.orange { background: #FEF0E4; color: var(--color-orange); }
.hosp-tag.blue { background: var(--c-hospital-bg); color: var(--c-hospital); }
.hosp-visit-actions {
  display: flex; gap: 4px;
}

/* ── 검사 자료 카드 ── */
.hosp-test-card {
  background: #fff; border-radius: var(--radius-lg);
  margin: 0 0 10px; padding: 14px 16px;
}
.hosp-test-header {
  display: flex; align-items: center; gap: 10px;
}
.hosp-test-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--c-hospital-bg); color: var(--c-hospital);
  font-size: 18px; font-family: 'Material Symbols Rounded';
  font-style: normal; line-height: 1;
}
.hosp-test-title {
  font-size: 14px; font-weight: 700; color: var(--color-text-main);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.hosp-test-meta {
  font-size: 12px; color: var(--color-text-sub); margin-top: 3px;
}
.hosp-test-btns {
  display: flex; gap: 6px; margin-top: 12px;
}

/* ── 처방 카드 ── */
.hosp-rx-card {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: var(--radius-md);
  margin: 0 0 8px; padding: 12px 14px;
}
.hosp-rx-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: var(--c-med-bg); color: var(--c-med);
  font-size: 18px; font-family: 'Material Symbols Rounded';
  font-style: normal; line-height: 1;
}
.hosp-rx-body { flex: 1; min-width: 0; }
.hosp-rx-name {
  font-size: 14px; font-weight: 700; color: var(--color-text-main);
}
.hosp-rx-desc {
  font-size: 12px; color: var(--color-text-sub); margin-top: 2px;
}
.hosp-rx-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── 다음 진료 카드 ── */
.hosp-next-card {
  margin: 12px 0 0;
  background: linear-gradient(135deg, #3F7A4D 0%, #2E6B3E 100%);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  color: #fff; position: relative; overflow: hidden;
}
.hosp-next-card::before {
  content: ''; position: absolute;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(255,255,255,.07);
  top: -40px; right: -30px; pointer-events: none;
}
.hosp-dday {
  font-size: 32px; font-weight: 800; letter-spacing: -1px;
  margin: 6px 0 12px;
}
.hosp-next-info {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.hosp-next-hospital-ic {
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-family: 'Material Symbols Rounded';
  font-style: normal; line-height: 1; flex-shrink: 0;
}

/* ── 임시 저장 아이콘 ── */
.hosp-draft-ic {
  font-size: 22px; color: #E5A800;
  font-family: 'Material Symbols Rounded'; font-style: normal; line-height: 1;
  flex-shrink: 0;
}
/* ── 계속 작성 버튼 ── */
.hosp-draft-cont-btn { padding: 7px 12px; font-size: 12px; }

/* ── 임시 저장 카드 ── */
.hosp-draft-card {
  margin: 12px 0 0;
  background: #FFFBF0;
  border: 1.5px solid #F5D87A;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.hosp-draft-body { flex: 1; min-width: 0; }
.hosp-draft-title {
  font-size: 13px; font-weight: 700; color: #6B5800;
}
.hosp-draft-meta {
  font-size: 12px; color: #9B7E00; margin-top: 2px;
}
.hosp-draft-actions { display: flex; gap: 6px; }

/* ── 빈 상태 ── */
.hosp-empty {
  text-align: center; padding: 28px 20px;
  color: var(--color-text-light); font-size: 13px;
  background: #fff; border-radius: var(--radius-lg);
  margin: 0 0 10px;
}
.hosp-empty-icon {
  font-size: 36px; font-family: 'Material Symbols Rounded';
  font-style: normal; line-height: 1;
  color: var(--color-border); display: block; margin-bottom: 10px;
}

/* ── 상세 페이지 ── */
.detail-summary-card {
  background: linear-gradient(135deg, #3F7A4D 0%, #2E6B3E 100%);
  margin: 0; border-radius: var(--radius-xl);
  padding: 20px; color: #fff;
}
.detail-section {
  background: #fff; border-radius: var(--radius-lg);
  margin: 12px 0 0; overflow: hidden;
}
.detail-section-title {
  font-size: 13px; font-weight: 700; color: var(--color-text-light);
  padding: 14px 16px 6px; text-transform: uppercase; letter-spacing: .04em;
}
.detail-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--color-border);
}
.detail-row:first-of-type { border-top: none; }
.detail-row-label {
  font-size: 12px; color: var(--color-text-light);
  flex-shrink: 0; width: 80px; padding-top: 1px;
}
.detail-row-value {
  font-size: 14px; color: var(--color-text-main);
  font-weight: 500; flex: 1; line-height: 1.5;
}

/* ── 더보기 메뉴 ── */
.hosp-menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 14px 16px;
  border: none; background: transparent;
  font-size: 15px; font-weight: 600; color: var(--color-text-main);
  cursor: pointer; border-radius: var(--radius-md);
  transition: background 0.12s;
}
.hosp-menu-item:active { background: var(--color-border); }
.hosp-menu-item .material-symbols-rounded {
  font-size: 20px; font-family: 'Material Symbols Rounded';
  font-style: normal; line-height: 1;
}

/* ── 검색 결과 ── */
.hosp-search-result {
  font-size: 13px; color: var(--color-text-light);
  text-align: center; padding: 28px 20px;
}

/* ── 검색 바 ── */
.hosp-search-bar {
  display: none;
  padding: 8px 16px 12px;
  background: #fff;
  border-bottom: 0;
}
.hosp-search-bar.open { display: block; }
.hosp-search-inner {
  display: flex; align-items: center; gap: 8px;
  background: #EEF1F5; border-radius: 6px; padding: 10px 14px;
}
.hosp-search-ic { font-size: 18px; color: var(--color-text-light); font-family: 'Material Symbols Rounded'; font-style: normal; line-height: 1; }
.hosp-search-input {
  flex: 1; border: none; background: transparent;
  font-size: 14px; outline: none; color: var(--color-text-main);
  font-family: inherit;
}
.hosp-search-close {
  border: none; background: none; padding: 0; cursor: pointer;
  display: flex; align-items: center;
}
.hosp-search-close .material-symbols-rounded { font-size: 18px; color: var(--color-text-light); font-family: 'Material Symbols Rounded'; font-style: normal; line-height: 1; }

/* ── 임시 저장 래퍼 ── */
.hosp-draft-wrap { display: none; margin: 0 0 4px; }
.hosp-draft-wrap.show { display: block; }

/* ── 목록 래퍼 ── */
.hosp-list-wrap { padding: 0; }

/* ── 페이지 하단 여백 ── */
.hosp-page-bottom { height: 8px; }

/* ── 폼 스크롤 영역 ── */
.app .scroll.hosp-form-scroll {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ── 상세 스크롤 영역 ── */
.hosp-detail-scroll { padding-bottom: 32px; }

/* ── 텍스트에어리어 크기 ── */
.hosp-textarea-sm { min-height: 72px; }
.hosp-textarea-md { min-height: 80px; }

/* ── "기타" 직접입력 인풋 ── */
.hosp-other-input { display: none; margin-top: 8px; }
.hosp-other-input.show { display: block; }

/* ── 하단 버튼 취소 너비 ── */
.hosp-cancel-btn { flex: 0 0 90px; }

/* ── 시트 버튼 행 ── */
.hosp-sheet-btns { display: flex; gap: 10px; margin-top: 6px; }
.hosp-sheet-close-btn { flex: 0 0 90px; }

/* ── 시트 삭제 버튼 ── */
.hosp-sheet-del-wrap { margin-top: 10px; }
.hosp-del-btn {
  background: transparent; color: #ef4444;
  border: 1px solid #ef4444; font-size: 13px; padding: 10px;
}
.hosp-del-ic { font-size: 16px; vertical-align: -3px; }

/* ── 검사 시트 ── */
.hosp-test-sheet { max-height: 88vh; overflow: auto; }

/* ── 이미지 미리보기 모달 ── */
.hosp-img-modal {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.88);
  align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
}
.hosp-img-preview {
  max-width: 92%; max-height: 80vh;
  border-radius: 12px; object-fit: contain; display: block;
}
.hosp-img-modal-btns { display: flex; gap: 12px; }
.hosp-img-btn {
  padding: 10px 20px; border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,.3);
  background: transparent; color: #fff;
  font-size: 14px; cursor: pointer; font-family: inherit;
}
.hosp-img-btn.primary {
  border: none; background: #fff; color: #333; font-weight: 600;
}

/* ── hidden input ── */
.hosp-hidden-input { display: none; }

/* ── 더보기 메뉴 목록 ── */
.hosp-menu-list { display: flex; flex-direction: column; gap: 4px; padding: 4px 0 8px; }
.hosp-menu-item.danger { color: #ef4444; }

/* ── choice 행 ── */
.hosp-choice-row { justify-content: flex-start; margin-top: 4px; }

/* ── 상세 다음진료 D-day ── */
.hosp-detail-dday-badge {
  display: inline-block; margin-top: 8px;
  background: rgba(255,255,255,.2); border-radius: 99px;
  padding: 4px 12px; font-size: 12px; font-weight: 600;
}
.hosp-detail-next {
  margin-top: 12px; font-size: 12px; opacity: .75;
}

/* ── 상세 요약 카드 내부 ── */
.hosp-detail-date { font-size: 11px; opacity: .65; margin-bottom: 4px; }
.hosp-detail-name { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.hosp-detail-doctor { font-size: 13px; opacity: .75; }

/* ── 상세 첨부 아이콘 ── */
.hosp-detail-attach-ic {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: var(--c-hospital-bg);
}
.hosp-detail-attach-ic.img { background: var(--c-photo-bg); }
.hosp-detail-attach-ic .material-symbols-rounded { font-size: 17px; color: var(--c-hospital); }
.hosp-detail-attach-ic.img .material-symbols-rounded { color: var(--c-photo); }
.hosp-detail-attach-name {
  flex: 1; min-width: 0;
  font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-left: 12px;
}
.hosp-detail-attach-meta { font-size: 12px; color: var(--color-text-sub); margin-top: 2px; }
.hosp-detail-attach-btns { display: flex; gap: 2px; flex-shrink: 0; }
