/* ── 단추 크기 3단계 (포탈 · 홈페이지 공통, 휴대폰도 같은 크기) ──
   1단계 주요 동작   46px · 글자 15px  (로그인, 저장, 신청, 확인 같은 화면의 주된 단추 — 2026-11-29 후원 페이지 단추 높이를 기본으로, 예전 36px)
   2단계 보통         32px · 글자 13px  (편집 · 인쇄 · 내려받기 · 탭 · 보조 단추)
   3단계 작은 단추·칩 28px · 글자 12px  (거르기 칩, 정렬, 태그, 표 안의 작은 단추)
   모서리는 모두 8px. 페이지마다 따로 정한 크기보다 우선하도록 :root:root 와 !important 를 쓴다.
   새 단추를 만들 때는 아래 목록에 클래스를 더하거나, 마크업에 .wb-1 / .wb-2 / .wb-3 을 붙인다.
   동그란 아이콘 단추 · 달력 칸 · 언어 토글 · 옆 메뉴는 여기에 넣지 않는다(각자 크기를 쓴다). */
:root {
  --wb-1-h: 46px; --wb-1-fs: 15px; --wb-1-lh: 22px; --wb-1-px: 18px;
  --wb-2-h: 32px; --wb-2-fs: 13px; --wb-2-lh: 18px; --wb-2-px: 12px;
  --wb-3-h: 28px; --wb-3-fs: 12px; --wb-3-lh: 16px; --wb-3-px: 10px;
  --wb-radius: 8px;
  /* 한 줄 입력칸 높이와, 입력칸 바로 옆에 붙은 단추의 높이 — 1단계를 46px 로 올릴 때 입력칸은 그대로 두었다 */
  --wb-in-h: 36px; --wb-in-fs: 14px; --wb-in-lh: 20px; --wb-in-px: 16px;
}

/* 1단계 — 주요 동작
   우선순위: 1단계 > 2단계 > 3단계 순으로 셉니다(목록 안 가장 센 선택자 기준). 두 단계에 다 걸리는 단추는 원하는 단계 쪽만 남기고 다른 쪽에서 :not 으로 뺀다. */
:root:root:root :is(
  .wb-1,
  /* 포탈 첫 화면 · 로그인 */
  .login-btn, .login-link-btn, .login-signup-btn, .auth-secondary-btn, .hub-reset-btn, .hub-install-confirm, .hub-prayer-save,
  /* 동의서 · 섬김 신청 · 캠프 자료 · 캠프 스태프 (페이지 안의 .primary/.secondary 단추) */
  /* 쪽마다 쓰는 primary/secondary/ghost — 지우기(danger)는 옆 단추와 짝이 제각각이라 넣지 않는다. 아이콘 단추 · 업무관리 메뉴 · 2단계로 정한 단추는 뺀다 */
  :is(button.primary, button.secondary, button.ghost):not(.btn, .pt-btn, .sm, .sa-btn, .ap-btn, .mt-btn, .ex-btn, .wolko-vnlp-btn, .car-card-btn, .sc-card-btn, .camp-rename-btn, .camp-manage-btn, .upload-placeholder-btn, .menu-actions button), .master-open, .gs-mricbtn,
  /* 차량 · 운전 · 주방 · 차량일지 · 기도 · 복음 통계 */
  .car-btn, .log-primary, .log-secondary:not(.mat-report-btn), .gs-primary,
  /* CRS */
  .btn-primary, .btn-save, .btn-cancel, .btn-visit-save, .btn-visit-cancel, .btn-approve, .btn-reject-user,
  /* 경비 · 마이페이지 */
  .ex-btn:not(.sm, .ex-x), .ex-tab-new,
  /* 일정 */
  .sc-modal-btn, .sc-fab, .car-fab,
  /* 자료실 */
  .save-resource, .cancel-resource,
  /* ── 홈페이지 ── 쪽마다 머리 그림 아래 큰 단추 · 문의 · 후원 · 신청 */
  .ph-cta, .hm-btn, .ch-btn, .mh-btn, .wj-btn, .wr-btn, .jr-btn, .gv-btn, .pp-btn, .mp-btn, .cf-btn, .btn-contact, .wh-promo-btn,
  .crp-btn-contact, .crp-reg-btn, .crp-staff-open-btn, .crp-submit, .crp-cancel-btn, .crp-refund-agree-btn, .staff-ms-done, .staff-draft-btn,
  .ct-form-btn, .inv-btn, .inv-share button, .rv-rsvp-btn, .rv-share-btn, .ap-btn, .cs-submit, .lo-map-btn, .download-btn, .primary-btn, .ghost-btn, .mt-btn,
  .sa-btn, .tv-save, .tv-btn,
  /* 신청자 관리 · 행사 */
  .account-submit, .account-cancel, .rsvp-add-save, .rsvp-add-cancel
) {
  box-sizing: border-box !important;
  height: auto !important;
  min-height: var(--wb-1-h) !important;
  padding-block: 2px !important;
  align-content: center;   /* 블록으로 놓인 <a> 단추도 글자가 세로 가운데에 오게 */
  padding-inline: var(--wb-1-px) !important;
  font-size: var(--wb-1-fs) !important;
  line-height: var(--wb-1-lh) !important;
  border-radius: var(--wb-radius) !important;
}

/* 입력칸 바로 옆에 붙은 단추 — 입력칸(36px)과 같은 높이. 1 · 2단계보다 세게(:root 넷) 써서 어느 단계에 걸려도 이 크기 */
:root:root:root:root :is(
  .cal-month-picker .sc-btn, .log-mileage button:not(.log-link), .mat-tools button, .pt-row:has(.pt-in) .pt-btn, li:has(> .pt-rename-in) .pt-btn, .camp-filter-wrap :is(.camp-rename-btn, .camp-manage-btn),
  .managers-add button, .tv-verse-ref .tv-btn, .admin-form-grid .field-actions .primary,
  /* 경비: 새 리포트(옆의 36px 구분 탭과 같은 높이) · 항목 추가 · 합계 막대의 단추는 이 화면의 36px 줄에 맞춘다 */
  .ex-tab-new, .ex-wrap .ex-btn[data-act="add-row"], .ex-wrap .ex-total-bar .ex-btn
) {
  box-sizing: border-box !important;
  height: auto !important;
  min-height: var(--wb-in-h) !important;
  padding-block: 2px !important;
  align-content: center;
  padding-inline: var(--wb-in-px) !important;
  font-size: var(--wb-in-fs) !important;
  line-height: var(--wb-in-lh) !important;
  border-radius: var(--wb-radius) !important;
}

/* 2단계 — 보통 */
:root:root:root :is(
  .wb-2,
  /* 포탈 첫 화면 */
  .hub-notice-edit, .hub-prayer-edit, .hub-prayer-del, .hub-prayer-cancel, .hub-pray-btn, .hub-pending-approve, .hub-pending-reject, .pt-btn,
  /* 캠프 자료 · 캠프 스태프 · 동의서 · 섬김 신청 */
  .main-tab-btn, .season-toggle-btn, .edit-toggle, .camp-manage-btn, .camp-rename-btn, .upload-placeholder-btn,
  button.tab,
  /* 운전 · 주방 · 차량일지 · 자료실 신고 */
  .drive-manage, .drive-today, .drive-times-reset, .log-manage, .log-secondary.mat-report-btn,
  /* 차량 · 일정 */
  .cal-today-btn, .sc-btn, .car-tab,
  /* CRS */
  .view-tab, .btn-add, .btn-add-visit, .btn-edit, .btn-layout-reset, .map-search-btn, .btn-addr-search, .danger-go,
  /* 경비 · 마이페이지 */
  :where(.ex-btn.sm:not(.ex-x)), .ex-tab:not(.ex-tab-new), .ex-seg-btn,   /* :where — 2단계가 1단계보다 더 세지 않게(둘 다 걸리는 단추는 1단계 목록에서 뺀다) */
  /* 복음 통계 */
  .gs-small, .gs-tab, .gs-viewtoggle button,
  /* 자료실 */
  .add-resource, .delete-resource, .file-btn, .docx-download-button, .notes-trash-toggle, .viewer-notes-toggle, .viewer-annotate-toggle, .note-reply-submit,
  /* 신청자 관리 · 행사 */
  .btn-confirm,   /* 신청자 · 스태프 표 안의 확정 · 입금 · 수락 — 옆의 되돌리기 · 다시 보내기(2단계)와 같은 크기 */
  .btn-edit-mode, .btn-print, .btn-csv, .btn-team-panel-edit, .btn-staff-secondary, .btn-revert, .btn-cm-add, .trash-restore, .trash-purge,
  .group-notes-toggle, .campus-tab, .events-tab, .events-manage, .events-add,
  /* ── 홈페이지 ── 탭 · 보조 단추 */
  .sa-need-btn, .admin-toggle, .btn-translate, .pdf-upload-btn, .file-picker-btn,
  .mp-bio-toggle, .gv-pick-toggle, .crp-acct-copy, .crp-recent-clear, .staff-draft-discard, .tv-photo-btn, .delete-btn,
  .pp-seg button, .pp-chips button, .page-header-actions :is(.btn-preview, .btn-logout)
) {
  box-sizing: border-box !important;
  height: auto !important;
  min-height: var(--wb-2-h) !important;
  padding-block: 2px !important;
  align-content: center;   /* 블록으로 놓인 <a> 단추도 글자가 세로 가운데에 오게 */
  padding-inline: var(--wb-2-px) !important;
  font-size: var(--wb-2-fs) !important;
  line-height: var(--wb-2-lh) !important;
  border-radius: var(--wb-radius) !important;
}

/* 3단계 — 작은 단추 · 칩 */
:root:root:root :is(
  .wb-3,
  .pt-tag, .sort-btn, .camp-team-filter button, .row-toggle-btn,
  .ex-chip, .ex-cf-toggle,
  .gc-chip, .day-toggle, .car-selected-date-bar button, .car-view-tab, .rr-filter, .docx-version-button, .viewer-layout-toggle,
  .steps-toggle,
  [data-filter]:is(button),
  /* ── 홈페이지 */
  .wh-promo-dismiss
) {
  box-sizing: border-box !important;
  height: auto !important;
  min-height: var(--wb-3-h) !important;
  padding-block: 2px !important;
  align-content: center;   /* 블록으로 놓인 <a> 단추도 글자가 세로 가운데에 오게 */
  padding-inline: var(--wb-3-px) !important;
  font-size: var(--wb-3-fs) !important;
  line-height: var(--wb-3-lh) !important;
  border-radius: var(--wb-radius) !important;
}

/* <a> 단추는 글자를 가운데에 둔다(button 은 원래 가운데) */
:root:root a:is(.wb-1, .wb-2, .wb-3) { display: inline-flex; align-items: center; justify-content: center; }

/* 단추 안의 숫자 표시가 단추를 키우지 않게 */
:root:root .campus-tab .campus-tab-count { padding-block: 0 !important; line-height: 18px !important; }
:root:root .page-header-actions :is(.btn-preview, .btn-logout) { white-space: nowrap; letter-spacing: 0 !important; }
:root:root .add-resource span[data-t] { font-size: inherit; }

/* ── 입력칸은 36px(--wb-in-h) ── (한 줄 입력 · 선택 칸 · 국가번호 · 직접 만든 선택 단추)
   여러 줄 입력(textarea) · 체크 · 라디오 · 파일 · 범위 · 색 입력과 업무관리 화면 안의 칸은 그대로 둔다. */
:root:root:root :is(
  input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"],
  input[type="search"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], input[data-datepick],
  select, .ip-cc, .ct-dd-btn, .staff-ms-btn
):not(#tkApp *, table *, body > header *, .ap-honey, [name="website"], [aria-hidden="true"], [aria-hidden="true"] *,
  .wl-cal-sel, .edit-input, .edit-input-wide, .camper-select, .group-participant-select, .group-participant-input, .teacher-assign-select,
  .camp-role-select, .cm-reg-select, .cm-select, .stage-pct-select) {   /* 달력 머리의 연 · 월 선택, 표 · 명단 안의 촘촘한 편집 칸은 각자 크기 */
  box-sizing: border-box;
  height: var(--wb-in-h) !important;
  min-height: var(--wb-in-h) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* ── 휴대폰: 나란한 두 단추를 세로로 길게 쌓지 않고 한 줄에 반씩 ── */
@media (max-width: 740px) {
  :root:root :is(.hm-actions, .mh-closing-actions, .mp-cta-row, .wj-accred-links, .gv-involve-cta, .pp-join-btns) {
    flex-direction: row !important; flex-wrap: nowrap !important; gap: 8px !important; width: 100%; max-width: 480px;
    contain: inline-size;   /* 글자 길이가 바깥 칸을 넓히지 않게 — 칸 너비 안에서 반씩 */
  }
  :root:root :is(.hm-actions, .mh-closing-actions, .mp-cta-row, .wj-accred-links, .gv-involve-cta, .pp-join-btns) > :is(a, button) {
    flex: 1 1 0 !important; min-width: 0 !important; width: auto !important;
    justify-content: center !important; gap: 6px; padding-inline: 10px !important; white-space: normal; text-align: center;   /* 칸보다 긴 글자는 두 줄로(두 단추는 함께 늘어나 높이가 같다) */
  }
}
@media (max-width: 640px) {   /* 쪽마다 머리 그림의 단추 줄(.ph-actions) — PageHero 가 640px 이하에서 세로 배치로 바뀔 때만 한 줄에 반씩 */
  :root:root .ph-actions { flex-direction: row !important; flex-wrap: nowrap !important; gap: 8px !important; width: 100%; max-width: 480px; contain: inline-size; }
  :root:root .ph-actions > :is(a, button) {
    flex: 1 1 0 !important; min-width: 0 !important; width: auto !important;
    justify-content: center !important; gap: 6px; padding-inline: 10px !important; white-space: normal; text-align: center;
  }
}
@media (max-width: 360px) {   /* 아주 좁은 폰: 글자가 넘치지 않게 화살표를 뺀다 */
  :root:root :is(.hm-actions, .mh-closing-actions, .mp-cta-row, .wj-accred-links, .gv-involve-cta, .pp-join-btns, .ph-actions) > :is(a, button) > svg { display: none; }
  :root:root :is(.hm-actions, .mh-closing-actions, .mp-cta-row, .wj-accred-links, .gv-involve-cta, .pp-join-btns, .ph-actions) > :is(a, button) { white-space: normal; text-align: center; line-height: 1.25 !important; }
}
/* 캠프 스태프 지원서 아래 줄: 좁은 칸(96px)의 '임시 저장'이 두 줄로 꺾여 옆 단추까지 키우지 않게 */
:root:root:root:root .staff-form-actions .staff-draft-btn { padding-inline: 8px !important; white-space: nowrap; }
