@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
  padding: 12px;
  max-width: 950px; 
  margin: auto;
  background: #f7f5f0; 
  color: #333333;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  overflow-x: hidden;
}

/* 게시판 영역은 드래그·복사 허용 */
#boardApp, #boardApp * {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}
/* 단, 버튼은 제외 */
#boardApp button {
  user-select: none;
  -webkit-user-select: none;
}

.header-area {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  position: relative;
}

h2 { margin: 0; color: #2c3e50; font-size: 20px; }

/* 공지사항 바 */

.search-filter-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
  position: relative;
}
.search-container {
  position: relative;
  flex-grow: 1;
}
input#search {
  width: 100%; 
  box-sizing: border-box; 
  padding: 12px 40px 12px 12px; 
  font-size: 14px; 
  border: 2px solid #3498db; 
  border-radius: 12px; 
  background: #ffffff; 
  color: #333;
}
input#search:focus { outline: none; box-shadow: 0 0 5px rgba(52,152,219,0.3); }

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #bdc3c7;
  color: white;
  border: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  display: none; 
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.search-clear-btn:hover { background: #95a5a6; }

/* 통합 검색창 아이템만/재료만 토글 */
.search-type-toggles {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.search-type-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
/* 미니 토글 슬라이더 */
.search-type-toggle-label input[type="checkbox"] { display: none; }
.search-type-toggle-slider {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 17px;
  background: #cbd5e1;
  border-radius: 17px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.search-type-toggle-slider:before {
  content: '';
  position: absolute;
  width: 11px;
  height: 11px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.search-type-toggle-label input:checked + .search-type-toggle-slider { background: #3b82f6; }
.search-type-toggle-label input:checked + .search-type-toggle-slider:before { transform: translateX(13px); }

.search-results-box {
  position: absolute; 
  top: 46px; 
  left: 0; 
  width: 100%; 
  max-height: 280px; 
  background: white; 
  border: 1px solid #ced4da; 
  border-radius: 8px; 
  box-shadow: 0 4px 10px rgba(0,0,0,0.15); 
  z-index: 1000; 
  overflow-y: auto; 
  display: none;
  box-sizing: border-box;
  padding: 4px 0; 
}

.search-row {
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 10px 14px; 
  border-bottom: 1px solid #f1f3f5; 
}
.search-row:last-child { border-bottom: none; }

.search-item-info { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  overflow: hidden; 
  text-overflow: ellipsis; 
  white-space: nowrap;
  flex-grow: 1;
  padding-right: 10px;
}

.search-item-name { 
  font-size: 11px; 
  font-weight: bold; 
  color: #2c3e50; 
}
.search-item-meta { 
  font-size: 11.5px; 
  color: #7f8c8d; 
  white-space: nowrap;
}

.search-row-actions { 
  display: flex; 
  gap: 12px; 
  align-items: center; 
  white-space: nowrap;
  flex-shrink: 0; 
}
.action-check-label { display: flex; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; user-select: none; }
.action-check-label input { width: 14px; height: 14px; margin: 0; accent-color: #3498db; cursor: pointer; }
.action-check-label.wish-label input { accent-color: #e74c3c; }

.btn-filter-trigger {
  background: #7f8c8d; 
  color: white; 
  border: none; 
  padding: 0 16px; 
  font-size: 13px; 
  font-weight: bold; 
  border-radius: 8px; 
  cursor: pointer; 
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-filter-trigger:hover { background: #6c7a7d; transform: translateY(-1px); }
.btn-filter-trigger:active { transform: translateY(0); }

/* 상세 필터 섹션 */
.filter-section {
  background: rgba(255, 255, 255, 0.75); 
  backdrop-filter: blur(6px); 
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(233, 236, 239, 0.8); 
  border-radius: 8px; 
  padding: 12px; 
  margin-bottom: 16px; 
  box-shadow: 0 4px 6px rgba(0,0,0,0.03); 
  text-align: center;
  display: none;
}
.filter-group-title { font-size: 13px; font-weight: bold; color: #495057; margin-bottom: 6px; }
.filter-buttons { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; justify-content: center; align-items: center; }
.break-line { flex-basis: 100%; height: 0; margin: 0; padding: 0; }
.btn-filter {
  width: auto; padding: 6px 12px; font-size: 12px; background: #ffffff; color: #495057; border: 1px solid #ced4da; border-radius: 18px; cursor: pointer; transition: all 0.2s;
}
.btn-filter.active { background: #495057; color: #ffffff; border-color: #495057; font-weight: bold; }
.btn-filter.grade-collabo-btn { border-color: #f3c6cf; color: #ba7a85; }
.btn-filter.grade-collabo-btn.active { background: #f3c6cf; border-color: #e8b0bc; color: #ffffff; }
.btn-reset { background: #3498db; color: #fff; font-weight: bold; border: 1px solid #2980b9; padding: 5px 10px; font-size: 11px; border-radius: 4px; cursor: pointer; display: inline-block; }
.btn-reset:hover { background: #2980b9; }

/* 내 페이지 컨텐츠 너비 제한 */
#mypageView > .search-filter-row,
#mypageView > .filter-section,
#mypageView > .section {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.section { margin-top: 20px; clear: both; }
.section h3 { font-size: 15px; margin-bottom: 10px; line-height: 24px; }
.count { color: #7f8c8d; font-size: 12px; margin-left: 4px; }

/* 매칭 전용 스타일 박스 */
.matching-box {
  background: #ebf5fb;
  border: 1px dashed #3498db;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}
.matching-sub-title {
  font-size: 13px;
  font-weight: bold;
  color: #2980b9;
  margin: 10px 0 6px 0;
}
.matching-sub-title:first-child { margin-top: 0; }

button.sort-btn, button.view-toggle-btn, button.toggle-display-btn, button.action-util-btn {
  width: auto; display: inline-block; padding: 3px 8px; margin-left: 4px; font-size: 11px; background: #e9ecef; color: #495057; border: 1px solid #ced4da; border-radius: 4px; cursor: pointer; vertical-align: middle;
}
button.action-util-btn { background: #2ecc71; color: white; font-weight: bold; border: none; display: none; }
button.action-util-btn.btn-capture { background: #9b59b6; }
.right-buttons { float: right; }

#haveList, #wishList, #matchGiveList, #matchTakeList {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 6px; padding: 4px;
}
#haveList.view-mode-photoonly, #wishList.view-mode-photoonly {
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)) !important; gap: 4px !important; background: #ffffff; border-radius: 8px;
}

/* 매칭 리스트 사진만 보기 */
#matchGiveList.view-mode-photoonly, #matchTakeList.view-mode-photoonly {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)) !important;
  gap: 4px !important;
  padding: 4px;
}
#matchGiveList.view-mode-photoonly .card, #matchTakeList.view-mode-photoonly .card {
  width: 56px !important;
  height: 56px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 4px !important;
  border-left-width: 4px !important;
  justify-content: center;
}
#matchGiveList.view-mode-photoonly .card-content-wrapper, #matchTakeList.view-mode-photoonly .card-content-wrapper {
  display: none !important;
}
#matchGiveList.view-mode-photoonly .item-img-box, #matchTakeList.view-mode-photoonly .item-img-box {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  background: transparent !important;
}

.card {
  background: #ffffff; border-left: 4px solid #ddd; border-radius: 12px; padding: 8px; min-height: 64px; display: flex; gap: 6px; align-items: stretch; box-sizing: border-box; position: relative; box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.card.prestige { border-left-color: #d8b4fe; } 
.card.legendary { border-left-color: #f39c12; } 
.card.unique { border-left-color: #8e63ff; }   
.card.rare { border-left-color: #3498db; }     
.card.normal { border-left-color: #95a5a6; }   
.card.collabo { border-left-color: #bdc3c7; } 
.card.collabo-mix { background: linear-gradient(to right, #ffffff 40%, #fff8f0 70%, #ffe0b2 100%); }

.item-img-box {
  width: 44px; height: 44px; min-width: 44px; border-radius: 4px; overflow: hidden; background: #f8f9fa; display: flex; align-items: center; justify-content: center; border: 1px solid #e9ecef; align-self: center;
}
.item-img-box img { width: 100%; height: 100%; object-fit: contain; }

.card-content-wrapper { flex-grow: 1; display: flex; justify-content: space-between; align-items: stretch; width: calc(100% - 50px); overflow: hidden; }
.card-info-left { display: flex; flex-direction: column; justify-content: flex-start; flex-grow: 1; overflow: hidden; padding-right: 4px; }
.item-name-txt { font-size: 12px; font-weight: bold; color: #2c3e50; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }

/* 아이템 이름 툴팁 */
#itemTooltip { position: fixed; background: #2c3e50; color: #fff; font-size: 11px; padding: 6px 10px; border-radius: 5px; white-space: nowrap; z-index: 10000; box-shadow: 0 2px 8px rgba(0,0,0,0.2); pointer-events: none; display: none; flex-direction: column; gap: 4px; }
#itemTooltip.has-usage { display: flex; }
.tooltip-usage { font-size: 10px; color: #bdc3c7; border-top: 1px solid rgba(255,255,255,0.15); padding-top: 4px; white-space: pre-wrap; max-width: 220px; word-break: keep-all; }
.grade-txt { font-size: 10px; font-weight: bold; margin-top: 2px; }
.grade-txt.prestige { color: #c084fc; } .grade-txt.legendary { color: #f39c12; } .grade-txt.unique { color: #8e63ff; } .grade-txt.rare { color: #3498db; } .grade-txt.normal { color: #95a5a6; } .grade-txt.collabo { color: #7f8c8d; }
.memo-txt { color: #7f8c8d; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.card-info-right { min-width: 45px !important; width: 45px !important; flex-shrink: 0 !important; display: flex !important; flex-direction: column !important; justify-content: flex-end !important; align-items: flex-end !important; overflow: hidden !important; }
.part-txt { color: #7f8c8d; font-size: 10px; font-weight: bold; white-space: nowrap; }
.remove-x-btn {
  position: absolute;
  top: 3px;
  right: 4px;
  background: none;
  border: none;
  color: #c0c0c0;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}
.remove-x-btn:hover { background: #e74c3c; color: #fff; border-radius: 3px; }

.pin-checkbox-container { display: flex; align-items: center; justify-content: flex-end; gap: 2px; font-size: 10px; color: #95a5a6; cursor: pointer; user-select: none; width: 100%; white-space: nowrap; }
.pin-checkbox-container input { width: 12px; height: 12px; margin: 0; cursor: pointer; accent-color: #9ce6d1; }
.card.pinned-card { border-right: 3px solid #9ce6d1; }

.view-mode-nameonly .item-img-box, .view-mode-nameonly .grade-txt, .view-mode-nameonly .memo-txt, .view-mode-nameonly .part-txt { display: none !important; }
.view-mode-nameonly .etc-qty-badge { display: none !important; }
.view-mode-nameonly .card { min-height: 32px !important; height: 32px !important; padding: 0 8px !important; }
.view-mode-nameonly .card-content-wrapper { width: 100% !important; align-items: center !important; }
.view-mode-nameonly .remove-x-btn { margin-top: 0 !important; }
/* 이름만 보기: 고정 체크박스가 X 앞으로 */
.view-mode-nameonly .pin-checkbox-container { position: relative; z-index: 2; }
.view-mode-nameonly .card-content-wrapper { padding-right: 22px !important; }
.view-mode-nameonly .remove-x-btn { z-index: 1; }

.view-mode-photoonly .card-content-wrapper { display: none !important; }
/* 캡처 중 X버튼 숨김 */
.capturing .remove-x-btn { display: none !important; }

/* 교환매칭 가리기 버튼: 카드 안 우상단 absolute */
.match-hide-btn {
  position: absolute !important;
  top: 3px !important;
  right: 4px !important;
  font-size: 13px !important;
  width: 16px !important;
  height: 16px !important;
  padding: 0 !important;
  color: #c0c0c0 !important;
  background: none !important;
  border: none !important;
  border-radius: 3px !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.match-hide-btn:hover { background: #e74c3c !important; color: #fff !important; }
.view-mode-photoonly .card { min-height: auto !important; width: 56px; height: 56px; padding: 0 !important; border-left-width: 4px !important; justify-content: center; border-radius: 4px; }
.view-mode-photoonly .item-img-box { width: 100%; height: 100%; border: none !important; background: transparent; }

.backup-btn { background: #4a5568; color: white; font-size: 11px; font-weight: bold; padding: 6px 10px; border-radius: 8px; cursor: pointer; border: none; }
.backup-btn:hover { background: #2d3748; }

/* 백업/불러오기 버튼 그룹 — 경계 없이 붙이기 */
.header-btn-group {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
}
.header-btn-group .backup-btn { border-radius: 0; }
.header-btn-group .group-left  { border-radius: 6px 0 0 6px; border-right: 1px solid rgba(255,255,255,0.2); }
.header-btn-group .group-right { border-radius: 0 6px 6px 0; }
.match-trigger-btn { background: #3498db; color: white; font-size: 11px; font-weight: bold; padding: 6px 10px; border-radius: 8px; cursor: pointer; border: none; margin-left: 4px; }
.match-trigger-btn:hover { background: #2980b9; }

/* 설정 버튼 + 톱니바퀴 애니메이션 */
.settings-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
  display: inline-block;
}
.settings-btn:hover { opacity: 1; background: #f1f3f5; }
@keyframes spin-once {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.settings-btn.spinning {
  animation: spin-once 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

/* 설정 패널 */
.settings-panel {
  position: fixed;
  top: 52px;
  right: 12px;
  width: 300px;
  background: #fdfcfa;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 2000;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  user-select: none;
}
.settings-panel-header {
  background: #34495e;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 18px;
  letter-spacing: 0.5px;
  cursor: grab;
}
.settings-panel-header:active { cursor: grabbing; }
/* X 버튼 PC/모바일 모두 표시 */
.settings-panel-inner { padding: 6px 0 4px; }
.settings-section {
  padding: 12px 18px;
  border-bottom: 1px solid #edf2f7;
  background: #fff;
  margin-bottom: 4px;
}
.settings-section:last-child { border-bottom: none; margin-bottom: 0; }
.settings-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.settings-section-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
  line-height: 1.5;
}
.settings-action-btn {
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.settings-action-btn:hover { background: #2980b9; }
.settings-action-btn.danger { background: #e74c3c; }
.settings-action-btn.danger:hover { background: #c0392b; }
.settings-cancel-btn {
  background: #f1f3f5;
  color: #495057;
  border: none;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.settings-cancel-btn:hover { background: #e2e6ea; }
.settings-backup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}
.settings-backup-label { color: #7f8c8d; min-width: 72px; flex-shrink: 0; font-size: 12px; }
.settings-backup-val { color: #2c3e50; font-weight: 600; flex: 1; word-break: break-all; font-size: 12px; }
.settings-backup-val.code-val { letter-spacing: 2px; font-size: 13px; }
.settings-edit-btn {
  background: none;
  border: 1px solid #ced4da;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 11px;
  color: #495057;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}
.settings-edit-btn:hover { background: #f1f3f5; }
.settings-match-edit { margin-top: 8px; }
.settings-match-edit input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1.5px solid #e9ecef;
  border-radius: 7px;
  font-size: 13px;
  outline: none;
}
.settings-match-edit input:focus { border-color: #3498db; }
.settings-backup-btns { display: flex; gap: 6px; }
.settings-match-unregistered {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6;
}
.settings-match-status {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.settings-match-status.active  { background: #d1fae5; color: #065f46; }
.settings-match-status.inactive { background: #f1f5f9; color: #94a3b8; }

/* 목록 초기화 — 하단 위험 영역 (타 사이트 탈퇴 버튼 스타일) */
.settings-danger-section {
  background: #fff8f8 !important;
  border-top: 1px solid #fee2e2 !important;
  padding: 10px 18px !important;
  display: flex;
  justify-content: flex-end;
}
.settings-danger-link {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  opacity: 0.7;
}
.settings-danger-link:hover { opacity: 1; }

/* 보기 설정 행 */
.settings-view-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
/* 기본 정렬/보기: 라벨 위, 칩 아래 */
.settings-view-block {
  margin-bottom: 10px;
}
.settings-view-block .settings-view-label {
  display: block;
  margin-bottom: 6px;
}
.settings-view-block .settings-chip-group {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
}
.settings-view-block .settings-chip {
  flex: 1;
  text-align: center;
}
.settings-view-label {
  font-size: 12px;
  color: #475569;
  flex-shrink: 0;
}

/* 아이폰 스타일 토글 스위치 */
.settings-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.settings-toggle input { opacity: 0; width: 0; height: 0; }
.settings-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 22px;
  transition: background 0.2s;
}
.settings-toggle-slider:before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.settings-toggle input:checked + .settings-toggle-slider { background: #3b82f6; }
.settings-toggle input:checked + .settings-toggle-slider:before { transform: translateX(18px); }

/* 칩 선택 버튼 그룹 */
.settings-chip-group { display: flex; gap: 4px; flex-wrap: wrap; }
.settings-chip {
  background: #f1f5f9;
  color: #64748b;
  border: 1.5px solid transparent;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.settings-chip:hover { background: #e2e8f0; }
.settings-chip.active {
  background: #eff6ff;
  color: #2563eb;
  border-color: #93c5fd;
}

.share-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(2px);
}
.share-modal-content {
  background: white;
  padding: 28px 24px 24px;
  border-radius: 18px;
  width: 340px;
  max-width: 92vw;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.share-modal-content h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
  color: #1a252f;
  font-weight: 800;
}
.share-modal-desc {
  font-size: 12px;
  color: #7f8c8d;
  line-height: 1.6;
  margin-bottom: 14px;
  text-align: left;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 3px solid #3498db;
}
.share-modal-desc.green  { border-left-color: #2ecc71; }
.share-modal-desc.purple { border-left-color: #9b59b6; }
.share-modal-content input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 14px;
  margin-top: 4px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #2c3e50;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}
.share-modal-content input:focus { border-color: #3498db; }
.share-modal-content input[readonly] {
  background: #f0f8ff;
  border-color: #aed6f1;
  color: #1a6fa3;
}
.share-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.share-buttons button {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}
.share-buttons .btn-primary {
  background: #3498db;
  color: white;
}
.share-buttons .btn-primary:hover { background: #2980b9; transform: translateY(-1px); }
.share-buttons .btn-secondary {
  background: #f1f3f5;
  color: #495057;
}
.share-buttons .btn-secondary:hover { background: #e2e6ea; }

/* 코드 찾기 링크 (불러오기 모달 하단) */
.find-code-link {
  margin-top: 14px;
  font-size: 12px;
  color: #3498db;
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
  opacity: 0.8;
}
.find-code-link:hover { opacity: 1; }

/* 텍스트 붙여넣기 가져오기 */
.paste-import-wrap {
  margin-top: 16px;
  border-top: 1px solid #f1f3f5;
  padding-top: 12px;
}
.paste-import-toggle {
  background: none;
  border: none;
  color: #3498db;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.paste-import-toggle:hover { opacity: 0.8; }
.paste-import-desc {
  font-size: 12px;
  color: #7f8c8d;
  margin: 8px 0 6px;
  line-height: 1.5;
}
#pasteImportText {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #e9ecef;
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  color: #2c3e50;
}
#pasteImportText:focus { border-color: #3498db; }

/* 파싱 결과 모달 */
.paste-result-desc {
  font-size: 12px;
  color: #7f8c8d;
  margin-bottom: 12px;
  line-height: 1.5;
}
.paste-result-section { margin-bottom: 12px; }
.paste-result-title {
  font-size: 12px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 6px;
}
.paste-result-count { color: #3498db; font-weight: 600; }
.paste-result-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}
.paste-result-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 4px 10px 4px 12px;
  font-size: 12px;
  color: #2c3e50;
}
.paste-result-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 12px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.paste-result-chip button:hover { color: #e74c3c; }

/* 파싱 결과 - 체크박스 기반 */
.paste-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.paste-all-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.paste-all-check-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #3498db;
  flex-shrink: 0;
}
.paste-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #2c3e50;
}
.paste-item-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  border: 1.5px solid transparent;
  border-radius: 20px;
  padding: 4px 12px 4px 8px;
  font-size: 12px;
  color: #2c3e50;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
  user-select: none;
}
.paste-item-chip:has(input:checked) {
  border-color: #93c5fd;
  background: #eff6ff;
}
.paste-item-chip input[type="checkbox"] {
  width: 13px;
  height: 13px;
  cursor: pointer;
  accent-color: #3498db;
  flex-shrink: 0;
}
.paste-item-name { font-size: 12px; }

/* 미분류 섹션 */
.paste-unclassified-btns { display: flex; gap: 4px; }
.paste-type-btn {
  background: #f1f5f9;
  color: #64748b;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.paste-type-btn.active {
  background: #3498db;
  color: #fff;
  border-color: #3498db;
}
.paste-unclassified-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
}

/* 백업 키워드 입력 */
.backup-keyword-wrap { margin: 4px 0 2px; text-align: left; }
.backup-keyword-hint {
  font-size: 11px;
  color: #adb5bd;
  margin-top: 5px;
  text-align: center;
}

/* 찾기 결과 */
.find-code-results { margin-top: 14px; text-align: left; }
.find-code-loading, .find-code-empty {
  text-align: center;
  font-size: 12px;
  color: #95a5a6;
  padding: 12px 0;
}
.find-code-list { display: flex; flex-direction: column; gap: 8px; }
.find-code-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 10px 12px;
  gap: 8px;
}
.find-code-item-info { display: flex; flex-direction: column; gap: 2px; }
.find-code-item-code {
  font-size: 15px;
  font-weight: 800;
  color: #2c3e50;
  letter-spacing: 2px;
}
.find-code-item-date { font-size: 11px; color: #95a5a6; }
.find-code-item-btn {
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.find-code-item-btn:hover { background: #2980b9; }

/* 공지 전용 팝업 */
.notice-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.notice-popup-box {
  background: #fff;
  border-radius: 18px;
  width: 92%;
  max-width: 520px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 76vh;
}
.notice-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  background: #fce492;
  border-bottom: 1px solid #f5d76e;
  flex-shrink: 0;
}
.notice-popup-badge {
  font-size: 14px;
  font-weight: 700;
  color: #1a252f;
  letter-spacing: 0.3px;
}
.notice-popup-close {
  background: none;
  border: none;
  font-size: 16px;
  color: #7f8c8d;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.notice-popup-close:hover { color: #2c3e50; }
.notice-popup-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}
.notice-popup-title {
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 12px;
  line-height: 1.4;
}
.notice-popup-content {
  font-size: 14px;
  color: #374151;
  line-height: 1.8;
  word-break: keep-all;
}
.notice-popup-img {
  width: 100%;
  border-radius: 8px;
  margin-top: 14px;
  border: 1px solid #e9ecef;
}
.notice-popup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid #f1f3f5;
  flex-shrink: 0;
  background: #fff;
}
.notice-popup-skip {
  background: none;
  border: none;
  font-size: 12px;
  color: #95a5a6;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.notice-popup-skip:hover { color: #7f8c8d; }
.notice-popup-confirm {
  background: #2c3e50;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.notice-popup-confirm:hover { background: #1a252f; }

/* =============================================
   첫 진입 랜딩 오버레이
============================================= */
.landing-overlay {
  position: fixed;
  inset: 0;
  background: #f7f5f0;
  z-index: 99999;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px 40px;
}
.landing-box {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.landing-header {
  text-align: center;
  padding: 8px 0 4px;
}
.landing-title {
  font-size: 22px;
  font-weight: 900;
  color: #2c3e50;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.landing-sub {
  font-size: 13px;
  color: #7f8c8d;
  line-height: 1.6;
}
/* 최신 공지 */
.landing-notice {
  background: #fffbea;
  border: 1px solid #f6e05e;
  border-radius: 12px;
  padding: 14px 16px;
}
.landing-notice-badge {
  font-size: 11px;
  font-weight: 700;
  color: #b7791f;
  margin-bottom: 6px;
}
.landing-notice-title {
  font-size: 14px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 6px;
}
.landing-notice-content {
  font-size: 13px;
  color: #4a5568;
  line-height: 1.7;
  white-space: pre-line;
}
/* 선택 버튼 */
.landing-btns {
  display: flex;
  gap: 12px;
}
.landing-btn {
  flex: 1;
  background: #fff;
  border: 2.5px solid #b0a898;
  border-radius: 16px;
  padding: 20px 16px 22px;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.landing-btn:hover {
  border-color: #2c3e50;
  background: #eeeae4;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.landing-btn:hover .landing-btn-name {
  color: #1a252f;
  font-size: 19px;
}
.landing-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.landing-btn-desc {
  font-size: 12px;
  color: #7f8c8d;
  line-height: 1.6;
  word-break: keep-all;
}
.landing-btn-name {
  font-size: 18px;
  font-weight: 900;
  color: #2c3e50;
  letter-spacing: -0.3px;
  order: -1;
  transition: font-size 0.18s, color 0.18s;
}
/* PC: mobile-desc 숨김 */
.pc-desc { display: block; }
.mobile-desc { display: none; }
/* 모바일 전용 버튼 (PC에서 숨김) */
.landing-btn-mobile-only { display: none; }
/* 공지사항 섹션 래퍼 */
.landing-all-notices-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.landing-section-title {
  font-size: 12px;
  font-weight: 800;
  color: #7f8c8d;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0 2px;
}
/* 나머지 공지 목록 */
.landing-all-notices {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* 최신 공지 미리보기 */
.landing-notice-preview {
  font-size: 13px;
  color: #4a5568;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.landing-notice-more {
  background: none;
  border: none;
  color: #b7791f;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-top: 2px;
  font-family: inherit;
}
.landing-notice-more:hover { opacity: 0.7; }
.landing-notice-item {
  border: 1px solid #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.landing-notice-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
  text-align: left;
  font-family: inherit;
  gap: 8px;
}
.landing-notice-item-btn:hover { background: #f8f9fa; }
.landing-notice-item-body {
  display: none;
  padding: 10px 16px 14px;
  font-size: 13px;
  color: #4a5568;
  line-height: 1.7;
  white-space: pre-line;
  border-top: 1px solid #f1f3f5;
  background: #fafbfc;
}
@media (max-width: 600px) {
  .landing-btn-mobile-only { display: flex; }
  .landing-btn-name { font-size: 15px; }
  .landing-btn-desc { font-size: 11px; }
  .landing-btn { padding: 16px 10px 18px; }
  .pc-desc { display: none; }
  .mobile-desc { display: block; }
}

/* 웹앱 최하단 푸터 스타일 */


/* =============================================
   콜렉션 북 좌측 패널 레이아웃
============================================= */
/* 콜렉션 북 좌측 패널 레이아웃 */
.cb-colbook-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
}
.cb-left-panel {
  width: 180px;
  flex-shrink: 0;
  background: #eeeae4;
  border-radius: 12px;
  padding: 14px 12px;
  border: 1px solid #ddd8d0;
  position: sticky;
  top: 12px;
}
.cb-center-col {
  flex-shrink: 0;
}
.cb-finder-title {
  font-size: 12px;
  font-weight: 800;
  color: #4a5568;
  margin-bottom: 10px;
}
.cb-finder-title {
  font-size: 12px;
  font-weight: 800;
  color: #4a5568;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.cb-finder-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.cb-finder-input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #dce1e7;
  border-radius: 7px;
  padding: 6px 24px 6px 8px;
  font-size: 11px;
  font-family: inherit;
  outline: none;
  background: #fff;
}
.cb-finder-input:focus { border-color: #3498db; }
.cb-finder-btn {
  background: #2c3e50;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.cb-finder-btn:hover { background: #1a252f; }
.cb-finder-result { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cb-finder-row {
  background: #fff;
  border-radius: 7px;
  padding: 7px 9px;
  border: 1px solid #e4dfd8;
}
.cb-finder-empty-row { opacity: 0.5; }
/* 카테고리 라벨 행: 살짝 짙은 배경으로 가독성 향상 */
.cb-finder-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #5a6a78;
  margin-bottom: 0;
  background: #e4dfd8;
  margin: -7px -9px 5px;
  padding: 4px 9px;
  border-radius: 6px 6px 0 0;
}
.cb-finder-val {
  display: block;
  font-size: 11px;
  color: #2c3e50;
  line-height: 1.4;
  word-break: keep-all;
}
/* 다중 값 줄바꿈 표시 */
.cb-finder-val-multi {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cb-finder-val-line {
  display: block;
}
.cb-finder-loading, .cb-finder-empty {
  font-size: 11px;
  color: #adb5bd;
  text-align: center;
  padding: 8px 0;
}
/* 자동완성 */
.cb-finder-ac-box {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: #fff;
  border: 1px solid #dce1e7;
  border-radius: 7px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 999;
  max-height: 180px;
  overflow-y: auto;
}
.cb-finder-ac-item {
  padding: 7px 10px;
  font-size: 11px;
  cursor: pointer;
  color: #2c3e50;
}
.cb-finder-ac-item:hover { background: #f0f8ff; }
/* 초기화 버튼 */
.cb-finder-x-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #adb5bd;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.cb-finder-x-btn:hover { color: #4a5568; }

/* 모바일 전용 획득처 검색 패널 (PC에서는 숨김) */
.cb-finder-mobile {
  display: none;
  margin-bottom: 12px;
}
.cb-finder-mobile-toggle {
  width: 100%;
  background: #eeeae4;
  border: 1px solid #ddd8d0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #4a5568;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.cb-finder-mobile-toggle.open {
  border-radius: 10px 10px 0 0;
  border-bottom-color: transparent;
}
#cbFinderMobileBody {
  background: #f8f9fa;
  border: 1px solid #ddd8d0;
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 0 12px 12px;
}

/* 모바일에서 좌측 패널 숨김 */
@media (max-width: 600px) {
  .cb-colbook-layout { flex-direction: column; gap: 0; }
  .cb-left-panel { display: none; }
}
/* =============================================
   메인 탭
============================================= */
.main-tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border-bottom: 2px solid #e9ecef;
  align-items: center;
}
/* 모바일 탭 설정 버튼 PC에서 숨김 */
.mobile-tab-settings { display: none !important; }
/* PC에서 탭 이모지 숨김 (모바일에선 이모지만 표시) */
@media (min-width: 601px) {
  .main-tab-sub .tab-icon { display: none; }
}
.main-tab {
  background: #f7f5f0;
  color: #7f8c8d;
  border: 1px solid #dde1e7;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  margin-right: 4px;
}
.main-tab:hover:not(.active) { background: #e9f4fd; color: #2980b9; }
.main-tab.active {
  background: #fff;
  color: #2c3e50;
  border-bottom: 2px solid #fff;
  margin-bottom: -2px;
}

/* =============================================
   콜렉션 북
============================================= */
/* 콜렉션 북 전체 중앙 정렬 wrapper */
#colbookView {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cb-center-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #eeeae4;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid #ddd8d0;
  width: fit-content;
}

/* 등급 필터 (상단) - 원본 콜렉션 북 스타일 */
.cb-grade-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin-bottom: 8px;
  padding: 0;
  background: none;
  border: none;
  width: 607px; /* 사이드바(59px) + grid-wrap(548px: padding20+grid528) */
}
.cb-filter-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  width: 100%;
}
.cb-filter-group .cb-filter-btn {
  flex: 1;
  min-width: 0;
}
.cb-filter-btn {
  background: #eef0f2;
  color: #4a5568;
  border: 2px solid #ced4da;
  border-radius: 16px;
  padding: 5px 8px;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.cb-filter-btn:hover { background: #dde1e6; }
.cb-filter-btn.active {
  /* 배경/색상은 JS에서 등급별로 직접 지정 */
  border-color: rgba(0,0,0,0.15);
  box-shadow: 0 2px 5px rgba(0,0,0,0.18);
}

/* 검색 + 드롭다운 */
.cb-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  width: 607px;
}
.cb-have-filter-wrap {
  display: flex;
  align-items: center;
  background: #2c3e50;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.cb-have-filter-icon {
  padding: 0 7px;
  color: #94a3b8;
  font-size: 12px;
  pointer-events: none;
}
.cb-have-select {
  border: none;
  padding: 7px 8px 7px 2px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: transparent;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.cb-have-select option { color: #2c3e50; background: #fff; }
.cb-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1.5px solid #dce1e7;
  border-radius: 8px;
  padding: 5px 9px;
  transition: border-color 0.15s;
}
.cb-search-wrap:focus-within { border-color: #3498db; }
.cb-search-icon { font-size: 11px; opacity: 0.4; flex-shrink: 0; }
.cb-search-input {
  flex: 1; border: none; outline: none;
  font-size: 12px; font-family: inherit;
  color: #2c3e50; background: transparent; min-width: 0;
}
.cb-search-input::placeholder { color: #bdc3c7; }
/* 콜렉션 점수 패널 */
.cb-score-panel {
  margin-top: 10px;
  background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
  border-radius: 10px;
  padding: 10px 16px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cb-score-rank {
  font-size: 15px;
  font-weight: 900;
  color: #f8d347;
  white-space: nowrap;
  flex-shrink: 0;
}
.cb-score-center {
  flex: 1;
  min-width: 0;
}
.cb-score-nums {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
}
.cb-score-cur { color: #fff; }
.cb-score-sep { color: #7f8c8d; margin: 0 3px; }
.cb-score-next { color: #adb5bd; }
.cb-score-max { color: #f8d347; font-size: 12px; }
.cb-score-bar-wrap {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}
.cb-score-bar {
  height: 100%;
  background: linear-gradient(90deg, #f8d347, #f39c12);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.cb-score-hint {
  font-size: 11px;
  color: #7f8c8d;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
  margin-left: auto;
}
.cb-score-hint b { color: #e67e22; }

.cb-reset-btn {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1.5px solid #dce1e7;
  background: #f8f9fa;
  color: #7f8c8d;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  padding: 0;
}
.cb-reset-btn:hover { background: #e9ecef; color: #2c3e50; border-color: #adb5bd; }

/* 바디: 사이드바 + 그리드 */
.cb-body {
  display: flex;
  gap: 0;
  align-items: flex-start;
  width: fit-content;
}
/* 부위 사이드바 */
.cb-part-sidebar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  width: 44px;
  padding-right: 15px;
}
.cb-part-btn {
  width: 100%;
  padding: 5px 3px;
  font-size: 11px;
  font-weight: 700;
  color: #5a6a78;
  background: #ffffff;
  border: 1.5px solid #c8c0b4;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.cb-part-btn:hover { background: #e9f4fd; color: #2980b9; border-color: #aed6f1; }
.cb-part-btn.active { background: #2c3e50; color: #fff; border-color: #2c3e50; }

/* 그리드 래퍼 */
.cb-grid-wrap {
  flex: 0 0 auto;
  background: #e0dbd3;
  border-radius: 12px;
  padding: 10px;
  width: fit-content;
}

/* 다중선택 툴바 */
.cb-multi-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}
.cb-multi-btn {
  background: #f7f5f0;
  border: 1.5px solid #dee2e6;
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #495057;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.cb-multi-btn:hover { background: #e9ecef; }
.cb-multi-btn.active {
  background: #2ecc71;
  border-color: #27ae60;
  color: #fff;
}
.cb-multi-hint {
  font-size: 11px;
  color: #adb5bd;
}

/* 그리드: 셀 크기 축소 */
.cb-grid {
  display: grid;
  grid-template-columns: repeat(7, 72px);
  gap: 4px;
  margin-bottom: 10px;
  width: fit-content;
}
.cb-cell {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  background: #ddd;
  border: none;
  outline: none;
  transition: transform 0.1s, filter 0.1s;
}
.cb-cell:hover { transform: scale(1.05); z-index: 5; filter: brightness(1.1); }
.cb-cell.cb-empty { cursor: default; background: transparent; }
.cb-cell.cb-empty:hover { transform: none; filter: none; }
/* 다중선택 모드 호버 */
.cb-grid.multi-mode .cb-cell:not(.cb-empty):hover { filter: brightness(1.15) saturate(1.2); }
/* 이미지 없을 때 */
.cb-no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: #adb5bd;
  background: #f0f0f0;
  text-align: center;
}

.cb-img-wrap {
  width: 100%; height: 100%;
  position: relative; overflow: hidden;
  border-radius: 0;
}
.cb-img-wrap img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}
.cb-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  pointer-events: none;
}
.cb-badge {
  position: absolute; top: 2px; right: 2px;
  font-size: 8px; font-weight: 800;
  border-radius: 2px; padding: 1px 3px;
  pointer-events: none; z-index: 2; line-height: 1.3;
}
.cb-badge-have { background: #27ae60; color: #fff; }
.cb-badge-wish { background: #e74c3c; color: #fff; }

/* 획득 + 버튼 (단일선택 모드에서만 표시) */
.cb-collect-btn {
  position: absolute;
  bottom: 2px; left: 2px;
  z-index: 4;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.35);
  color: rgba(255,255,255,0.8);
  font-size: 10px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1;
  transition: all 0.12s;
}
.cb-collect-btn:hover { background: rgba(39,174,96,0.85); border-color: #27ae60; color: #fff; }
/* 다중선택 모드에서 + 버튼 숨김 */
.cb-grid.multi-mode .cb-collect-btn { display: none; }

/* 획득방법 섹션 */
.cb-how-wrap {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
}
.cb-how-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.cb-how-title {
  font-weight: 700;
  color: #495057;
  font-size: 11px;
  letter-spacing: 0.5px;
}
.cb-how-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.cb-how-edit-btn:hover { opacity: 1; }
.cb-how-pending-dot {
  color: #e67e22;
  font-size: 10px;
  line-height: 1;
}
.cb-how-input-pending {
  color: #f1c40f;
  font-size: 10px;
  margin-left: 4px;
}
.cb-how-item {
  color: #5d6d7e;
  line-height: 1.8;
  font-size: 12px;
}
/* 획득방법 텍스트 래퍼 (획득불가 오버레이 포함) */
.cb-how-text-wrap {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
}
.cb-how-unavailable {
  opacity: 0.7;
}
.cb-how-overlay {
  position: absolute;
  inset: 0;
  background: rgba(40, 40, 40, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 6px;
  pointer-events: none;
}
/* 획득불가 단독 배지 */
.cb-how-unavailable-badge {
  font-size: 11px;
  color: #e74c3c;
  font-weight: 700;
  margin-bottom: 8px;
}
/* 검수 중 표시 */
.cb-how-user-pending {
  font-size: 11px;
  color: #e67e22;
  margin-top: 6px;
  padding: 5px 8px;
  background: #fef9f0;
  border-radius: 6px;
  border-left: 3px solid #e67e22;
}
/* 사용자 입력 UI */
.cb-how-input-wrap {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e9ecef;
}
.cb-how-input-label {
  font-size: 11px;
  font-weight: 700;
  color: #6c757d;
  margin-bottom: 4px;
}
.cb-how-input {
  flex: 1;
  border: 1.5px solid #dce1e7;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}
.cb-how-input:focus { border-color: #3498db; }
.cb-how-save-btn {
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.cb-how-save-btn:hover { background: #2980b9; }
.cb-how-del-btn {
  background: #fff;
  color: #e74c3c;
  border: 1.5px solid #e74c3c;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.cb-how-del-btn:hover { background: #fff5f5; }
.cb-how-avail-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #7f8c8d;
  margin-top: 8px;
  cursor: pointer;
}
.cb-how-avail-chk { accent-color: #e74c3c; width: 13px; height: 13px; cursor: pointer; }

/* 콜렉션 북 아이템 팝업 */
.cb-item-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 30, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}
.cb-item-modal-overlay[style*="flex"] { display: flex !important; }
.cb-item-modal-box {
  position: relative;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 24px 22px 20px;
  width: 300px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.6);
}
.cb-item-modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none; border: none;
  font-size: 16px; color: #95a5a6;
  cursor: pointer; line-height: 1; padding: 2px 6px;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}
.cb-item-modal-close:hover { background: #f0f0f0; color: #e74c3c; }
.cb-item-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.cb-item-modal-img {
  width: 72px; height: 72px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #f0f0f0;
  border: 1px solid rgba(0,0,0,0.08);
}
.cb-item-modal-info { flex: 1; min-width: 0; }
.cb-item-modal-name {
  font-size: 15px; font-weight: 800;
  color: #1a252f; line-height: 1.3;
  margin-bottom: 6px;
  word-break: keep-all;
}
.cb-item-modal-meta {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px;
}
.cb-item-modal-grade { font-weight: 700; }
.cb-item-modal-sep { color: #bdc3c7; }
.cb-item-modal-part { color: #7f8c8d; }
.cb-item-modal-btns {
  display: flex; flex-direction: column; gap: 8px;
}
.cb-modal-have-btn, .cb-modal-wish-btn {
  width: 100%;
  padding: 7px 0;
  border-radius: 8px;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  border: 2px solid;
  transition: all 0.15s;
  text-align: center;
}
.cb-modal-have-btn {
  background: #f8f9fa; color: #4a5568; border-color: #cbd5e0;
}
.cb-modal-have-btn:hover { background: #edf2f7; }
.cb-modal-have-btn.on { background: #4a5568; color: #fff; border-color: #4a5568; }
.cb-modal-wish-btn {
  background: #f8f9fa; color: #e74c3c; border-color: #feb2b2;
}
.cb-modal-wish-btn:hover { background: #fff5f5; }
.cb-modal-wish-btn.on { background: #e74c3c; color: #fff; border-color: #e74c3c; }

/* 페이지네이션 */
.cb-page-btns {
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  justify-content: center;
  margin-bottom: 10px;
  width: 100%;
  overflow: hidden;
}
.cb-page-btn {
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 11px;
  cursor: pointer;
  color: #495057;
  min-width: 26px;
  font-weight: 600;
  transition: all 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cb-page-btn:hover:not(.active) { background: #f0f8ff; color: #2980b9; }
.cb-page-btn.active {
  background: #3498db;
  color: #fff;
  border-color: #3498db;
  font-weight: 800;
}

/* =============================================
   정보글 & FAQ 탭
============================================= */
/* 탭 서브 스타일 (아이콘만 모바일) */
.main-tab-sub .tab-label { display: inline; }

/* 정보글 검색 */
/* 정보글 검색창+태그바 상단 고정 */
.info-sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #f7f5f0;
  padding-bottom: 4px;
  margin-bottom: 2px;
}
.info-search-bar {
  margin-bottom: 8px;
}
.info-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1.5px solid #dce1e7;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.info-search-input:focus { border-color: #3498db; }

/* 태그 바 */
.info-tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.info-tag-btn {
  padding: 4px 12px;
  border: 1.5px solid #dee2e6;
  border-radius: 14px;
  background: #f8f9fa;
  color: #495057;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.info-tag-btn:hover { background: #e9ecef; }
.info-tag-btn.active { background: #2c3e50; color: #fff; border-color: #2c3e50; }

/* 정보글 카드 그리드 */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 10px;
}
.info-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
  position: relative;
}
.info-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); transform: translateY(-1px); }

/* 작성자 이름: 카드 우측 하단에 은은하게 */
.info-card-author {
  position: absolute;
  bottom: 5px;
  right: 7px;
  font-size: 9px;
  font-family: 'Georgia', serif;
  font-style: italic;
  color: rgba(100, 100, 100, 0.35);
  pointer-events: none;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* 작성자 그룹 래퍼 - 배경 없이 일반 그리드처럼 */
.info-author-group {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

/* 이미지 없을 때 텍스트 표시 */
.info-card-img-text {
  font-size: 10px;
  color: #5a6a78;
  padding: 6px 8px;
  text-align: left;
  align-items: flex-start;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.info-card-img {
  width: 100%;
  aspect-ratio: 3/1;
  object-fit: cover;
  background: #f0f0f0;
}
.info-card-img-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: #f4f6f8;
  aspect-ratio: 3/1;
}
.info-card-body { padding: 4px 7px; }
.info-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 3px;
  line-height: 1.4;
}
.info-card-desc {
  font-size: 11px;
  color: #7f8c8d;
  line-height: 1.5;
  margin-bottom: 4px;
}
.info-card-tags {
  font-size: 11px;
  color: #3498db;
  font-weight: 600;
}
.info-loading {
  text-align: center;
  color: #adb5bd;
  padding: 40px 0;
  font-size: 13px;
}

/* ── 정보글 캐러셀 ── */
.info-carousel-section {
  margin-bottom: 24px;
}
.info-carousel-title {
  font-size: 13px;
  font-weight: 800;
  color: #4a5568;
  margin-bottom: 10px;
  padding-left: 2px;
  letter-spacing: 0.3px;
}
.info-carousel-static {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.info-carousel-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: grab;
}
.info-carousel-wrap:active { cursor: grabbing; }
.info-carousel-track {
  display: flex;
  gap: 10px;
  will-change: transform;
  user-select: none;
}
.info-carousel-track .info-card {
  flex: 0 0 calc((100%) / 3 - 10px);
  min-width: 180px;
}
.info-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(44,62,80,0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background 0.15s;
}
.info-carousel-btn:hover { background: rgba(44,62,80,0.95); }
.info-carousel-prev { left: 4px; }
.info-carousel-next { right: 4px; }

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.faq-item {
  border: 1px solid #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #2c3e50;
  font-family: inherit;
  gap: 0;
}
.faq-question:hover { background: #f8f9fa; }
.faq-question.faq-open { background: #f0f8ff; color: #2980b9; }
.faq-category {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #3498db;
  border-radius: 4px;
  padding: 3px 0;
  flex: 0 0 72px;
  width: 72px;
  text-align: center;
  overflow: hidden;
}
/* 카테고리 비어있으면 투명하게 (자리는 유지) */
.faq-category:empty { background: transparent; }
.faq-question-text {
  flex: 1;
  text-align: left;
  padding-left: 40px;
}
.faq-arrow { flex-shrink: 0; font-size: 12px; color: #adb5bd; transition: transform 0.2s; margin-left: 12px; }
.faq-open .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  padding: 14px 24px 12px 28px;
  border-top: 1px solid #e9ecef;
  background: #fafbfc;
}
.faq-answer-text {
  font-size: 13.5px;
  color: #2c3e50;
  line-height: 2.0;
  white-space: pre-wrap;
  margin-bottom: 8px;
  letter-spacing: 0.2px;
  word-break: keep-all;
}
.faq-answer-img {
  width: 100%;
  border-radius: 8px;
  margin-top: 8px;
}

/* 1:1 채팅 버튼 */
.faq-kakao-wrap {
  text-align: center;
  padding: 24px 20px 16px;
}
.faq-kakao-desc {
  font-size: 14px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 14px;
}
.faq-kakao-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px 9px 14px;
  background: #F9E000;
  color: #1a0a00;
  font-size: 14px;
  font-weight: 800;
  border-radius: 10px;
  text-decoration: none;
  transition: opacity 0.15s;
  letter-spacing: 0.2px;
}
.faq-kakao-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.faq-kakao-btn:hover { opacity: 0.88; }

/* 모바일: 탭 아이콘만 표시 */
@media (max-width: 600px) {
  .main-tab-sub .tab-label { display: none; }
  .main-tab-sub { padding: 9px 12px; min-width: 0; }
  .info-grid { grid-template-columns: repeat(2, 1fr); gap: 4px; }
  /* 모바일 정보글 탭에서만 획득처 검색 표시 */
  #infoView .cb-finder-mobile { display: block; }
}
.app-footer {
  margin-top: 40px;
  padding: 20px 0 10px 0;
  border-top: 1px solid #e9ecef;
  text-align: center;
  font-size: 11px;
  color: #a0aec0;
  line-height: 1.6;
  letter-spacing: 0.3px;
}

.custom-alert { position: fixed; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); display: none; z-index: 99999; }
.custom-alert-content { background: white; width: 90%; max-width: 420px; margin: 100px auto; padding: 22px; border-radius: 12px; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,0.18); box-sizing: border-box; }
.alert-msg { 
  font-size: 14px; 
  line-height: 1.6; 
  margin-bottom: 15px; 
  text-align: center;
  color: #2c3e50; 
  max-height: 350px; 
  overflow-y: auto; 
  white-space: pre-line;
}
.alert-msg img { max-width: 100%; height: auto; border-radius: 6px; margin-top: 10px; display: block; border: 1px solid #e9ecef; }
.alert-btns { display: flex; gap: 10px; justify-content: center; margin-top: 15px; }
.alert-btns button { padding: 8px 20px; border-radius: 6px; font-size: 13px; cursor: pointer; border: none; font-weight: bold; }

.more-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 16px;
  margin-top: 12px;
  border: 1px solid #ced4da;
  background: #ffffff;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #495057;
  transition: all 0.18s;
  box-shadow: none;
  white-space: nowrap;
}
.more-btn:hover { background: #3498db; color: white; border-color: #3498db; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(52,152,219,0.25); }

/* ══════════════════════════════════════
   게시판 탭 버튼 (헤더)
══════════════════════════════════════ */
.board-tab-btn {
  background: #ecf0f1; color: #4a5568;
  border: 1px solid #ced4da; border-radius: 5px;
  padding: 4px 10px; font-size: 11px; font-weight: bold;
  cursor: pointer; white-space: nowrap;
}
.board-tab-btn:hover { background: #dce1e7; }

/* ══════════════════════════════════════
   게시판 전체 레이아웃
══════════════════════════════════════ */
.bd-topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; padding-bottom: 10px;
  border-bottom: 1px solid #e9ecef;
}
.bd-topbar-title {
  margin: 0; font-size: 17px; color: #2c3e50; font-weight: bold;
}
.bd-topbar-right {
  display: flex; align-items: center; gap: 10px;
}
/* 닉네임 인라인 (헤더 우측) */
.bd-nick-inline {
  display: flex; align-items: center; gap: 5px; font-size: 12px;
}
.bd-nick-label { color: #7f8c8d; }
.bd-nick-name { font-weight: bold; color: #2980b9; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-nick-edit-btn {
  background: none; border: 1px solid #ced4da; border-radius: 5px;
  font-size: 11px; padding: 2px 6px; cursor: pointer; color: #495057;
}
.bd-nick-edit-btn:hover { background: #f0f8ff; border-color: #aed6f1; }
.board-back-btn {
  background: #4a5568; color: white;
  font-size: 12px; font-weight: bold;
  padding: 6px 12px; border: none; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.board-back-btn:hover { background: #2d3748; }

/* 공지 고정행 스타일 */
.bd-pinned-notice-row { background: #fffbea !important; cursor: pointer; }
.bd-pinned-notice-row:hover { background: #fef9c3 !important; }

/* 툴바 */
.bd-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.bd-write-btn {
  background: #3498db; color: white;
  border: none; border-radius: 6px;
  padding: 7px 14px; font-size: 12px; font-weight: bold; cursor: pointer;
  white-space: nowrap;
}
.bd-write-btn:hover { background: #2980b9; }

/* 탭 바 - 탭+글쓰기 한 줄 */
.bd-tab-bar {
  display: flex; align-items: center;
  margin-bottom: 8px; gap: 8px; flex-wrap: nowrap;
  border-bottom: 2px solid #e9ecef; padding-bottom: 8px;
}
.bd-tabs { display: flex; gap: 0; flex-shrink: 0; }
.bd-tab {
  background: #f7f5f0; color: #7f8c8d;
  border: 1px solid #dde1e7; border-radius: 0;
  padding: 7px 16px; font-size: 13px; font-weight: bold; cursor: pointer;
  white-space: nowrap; transition: all 0.15s;
}
.bd-tabs .bd-tab:first-child { border-radius: 6px 0 0 6px; }
.bd-tabs .bd-tab:last-child  { border-radius: 0 6px 6px 0; border-left: none; }
.bd-tab.active { background: #3498db; color: #fff; border-color: #3498db; }
.bd-tab:hover:not(.active) { background: #e9f4fd; color: #2980b9; }
/* 탭바 안 전체글 수 - 탭 바로 옆에 자연스럽게 */
.bd-total { font-size: 12px; color: #adb5bd; margin-left: 2px; flex-shrink: 0; }
/* 글쓰기 버튼은 우측 끝으로 */
.bd-write-btn { margin-left: auto; }

/* 인라인 공지 바 (목록 상단, 테이블 위) */
.bd-inline-notice {
  display: flex; align-items: center; gap: 8px;
  background: #fffbea; border: 1px solid #f6e05e;
  border-radius: 6px; padding: 8px 12px;
  margin-bottom: 8px; cursor: pointer;
  transition: background 0.15s;
}
.bd-inline-notice:hover { background: #fef9c3; }
.bd-inline-notice-badge {
  font-size: 11px; font-weight: bold; color: #b7791f;
  background: #fef3c7; border: 1px solid #f6d860;
  border-radius: 4px; padding: 2px 7px; white-space: nowrap; flex-shrink: 0;
}
.bd-inline-notice-title {
  font-size: 13px; color: #744210; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.bd-inline-notice-arrow { font-size: 16px; color: #b7791f; flex-shrink: 0; }

/* 목록 테이블 - 디시인사이드 스타일 */
.bd-table-wrap {
  background: #fff;
  border: 1px solid #e4dfd8;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
}
.bd-table {
  width: 100%; border-collapse: collapse; table-layout: fixed;
}
.bd-table thead tr {
  background: #f7f5f0; border-bottom: 2px solid #d0d5dc;
}
.bd-table th {
  padding: 9px 10px; font-size: 12px; font-weight: bold;
  color: #495057; text-align: center; white-space: nowrap;
}
.bd-table th:nth-child(3) { text-align: center; padding-left: 0; }
.bd-table tbody tr {
  border-bottom: 1px solid #f1f3f5; transition: background 0.1s;
}
.bd-table tbody tr:last-child { border-bottom: none; }
.bd-table tbody tr:hover { background: #f0f7ff; cursor: pointer; }
.bd-table td {
  padding: 10px 8px; font-size: 13px; color: #333; text-align: center;
  vertical-align: middle; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.bd-table td.bd-title-cell {
  text-align: left; font-weight: 500; cursor: pointer; padding-left: 12px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.bd-table td.bd-title-cell:hover { color: #2980b9; }
.bd-table td.bd-name-cell {
  white-space: nowrap; overflow: visible; text-overflow: clip; max-width: none;
  font-size: 12px; color: #555;
}
.bd-table td.bd-date-cell {
  white-space: nowrap; overflow: visible; text-overflow: clip; max-width: none;
  font-size: 11px; color: #95a5a6;
}
.bd-table td.bd-no-cell { white-space: nowrap; }
.bd-admin-badge {
  display: inline-block; background: #e74c3c; color: #fff;
  font-size: 10px; font-weight: bold; padding: 1px 5px; border-radius: 3px;
  margin-right: 4px; vertical-align: middle;
}
.bd-comment-badge {
  display: inline-block; color: #3498db; font-weight: bold;
  font-size: 11px; margin-left: 4px;
}
.bd-no-cell { color: #95a5a6; font-size: 12px; }
.bd-loading, .bd-empty {
  text-align: center !important; color: #bdc3c7 !important;
  padding: 28px 0 !important; font-size: 13px;
}

/* 페이징 */
.bd-paging {
  display: flex; justify-content: center; gap: 4px; margin: 10px 0;
}
.bd-paging button {
  background: #fff; border: 1px solid #dde1e7; border-radius: 5px;
  padding: 5px 10px; font-size: 12px; cursor: pointer; color: #495057;
  min-width: 32px;
}
.bd-paging button.active {
  background: #3498db; color: white; border-color: #3498db; font-weight: bold;
}
.bd-paging button:hover:not(.active) { background: #f0f8ff; }

/* 상세 */
.bd-detail-box {
  background: #fff; border: 1px solid #e4dfd8; border-radius: 12px;
  padding: 16px; margin-bottom: 12px;
}
.bd-detail-title {
  font-size: 17px; font-weight: bold; color: #2c3e50;
  border-bottom: 1px solid #e9ecef; padding-bottom: 10px; margin-bottom: 8px;
}
.bd-detail-meta { font-size: 11px; color: #95a5a6; margin-bottom: 14px; display: flex; gap: 12px; flex-wrap: wrap; }
.bd-detail-content {
  font-size: 14px; line-height: 1.8; color: #34495e;
  white-space: pre-line; min-height: 80px;
  border-top: 1px solid #f1f3f5; padding-top: 14px;
}
/* 상세 하단 액션바 */
.bd-detail-action-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid #e9ecef;
  gap: 8px;
}
.bd-action-bar-btn {
  border: none; border-radius: 6px;
  padding: 7px 16px; font-size: 12px; font-weight: bold; cursor: pointer;
  transition: background 0.15s;
}
.bd-action-list { background: #ecf0f1; color: #555; }
.bd-action-list:hover { background: #dce1e7; }
.bd-action-edit { background: #3498db; color: white; }
.bd-action-edit:hover { background: #2980b9; }
.bd-action-del  { background: #e74c3c; color: white; }
.bd-action-del:hover  { background: #c0392b; }

/* 댓글 섹션 */
.bd-comment-section { background: #fff; border: 1px solid #e4dfd8; border-radius: 12px; padding: 14px; }
.bd-comment-title { font-size: 14px; font-weight: bold; color: #2c3e50; margin-bottom: 12px; }
.bd-comment-cnt { font-size: 12px; font-weight: normal; color: #95a5a6; }

.bd-comment-item {
  border-bottom: 1px solid #f1f3f5; padding: 10px 4px;
}
.bd-comment-item:last-of-type { border-bottom: none; }
.bd-comment-item.bd-reply {
  padding-left: 20px; background: #f8fafc;
  border-left: 3px solid #aed6f1; border-radius: 0 4px 4px 0;
  margin: 4px 0;
}
.bd-cmt-name { font-size: 12px; font-weight: bold; color: #2980b9; }
.bd-cmt-name.admin { color: #e74c3c; }
.bd-cmt-time { font-size: 10px; color: #bdc3c7; margin-left: 6px; }
.bd-cmt-body { font-size: 13px; color: #34495e; margin: 5px 0 4px; white-space: pre-line; line-height: 1.6; }
.bd-cmt-actions { display: flex; gap: 10px; }
.bd-cmt-reply-btn, .bd-cmt-del-btn {
  background: none; border: none; font-size: 11px; cursor: pointer;
  color: #95a5a6; padding: 0;
}
.bd-cmt-reply-btn:hover { color: #3498db; }
.bd-cmt-del-btn:hover { color: #e74c3c; }

/* 댓글 작성 - 가로형: 닉네임/비번 왼쪽 + 내용 오른쪽 + 등록 버튼 */
.bd-cmt-write {
  margin-top: 14px; border-top: 1px solid #e9ecef; padding-top: 12px;
}
.bd-cmt-write-row {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid #ced4da; border-radius: 6px; overflow: hidden; background: #fff;
  min-height: 72px;
}
.bd-cmt-left {
  width: 110px; flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid #ced4da;
}
.bd-cmt-nick-box {
  padding: 6px 8px; font-size: 11px; font-weight: bold; color: #2980b9;
  border-bottom: 1px solid #ced4da; background: #f0f7ff; min-height: 32px;
  display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bd-cmt-pw-input {
  border: none !important; border-radius: 0 !important;
  padding: 6px 8px; font-size: 11px; width: 100%; box-sizing: border-box;
  background: #fff; font-family: inherit; outline: none; flex: 1;
}
.bd-cmt-content-area {
  flex: 1; display: flex; flex-direction: column;
}
.bd-cmt-content-area textarea {
  flex: 1; border: none; outline: none; resize: none;
  padding: 8px 10px; font-size: 13px; font-family: inherit;
  min-height: 60px; background: transparent;
}
.bd-cmt-submit-btn {
  background: #3498db; color: white; border: none; border-left: 1px solid #2980b9;
  padding: 0 16px; font-size: 13px; font-weight: bold; cursor: pointer;
  white-space: nowrap; min-width: 52px; flex-shrink: 0;
}
.bd-cmt-submit-btn:hover { background: #2980b9; }

/* 대댓글 입력 박스 */
.bd-reply-box {
  margin: 6px 0 6px 20px; background: #eaf4fd;
  border: 1px solid #aed6f1; border-radius: 6px;
  padding: 10px; display: none;
}
.bd-reply-box textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid #aed6f1; border-radius: 5px;
  padding: 6px 8px; font-size: 12px; resize: vertical; min-height: 48px;
  font-family: inherit; margin-bottom: 6px;
}
.bd-reply-box-footer {
  display: flex; gap: 7px; align-items: center; flex-wrap: wrap;
}
.bd-reply-box-footer input[type=text] {
  border: 1px solid #aed6f1; border-radius: 5px;
  padding: 4px 7px; font-size: 11px; width: 90px; font-family: inherit;
}

/* 모달 */
.bd-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 9999;
  justify-content: center; align-items: center;
  backdrop-filter: blur(2px);
}
.bd-modal-content {
  background: #fff; border-radius: 12px; padding: 20px;
  width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  margin: 0 12px;
}
.bd-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; font-size: 15px; font-weight: bold; color: #2c3e50;
}
.bd-modal-close {
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: #7f8c8d; line-height: 1; padding: 0;
}
.bd-modal-close:hover { color: #2c3e50; }
.bd-modal-input {
  width: 100%; box-sizing: border-box;
  border: 1px solid #ced4da; border-radius: 7px;
  padding: 9px 11px; font-size: 13px; font-family: inherit;
  margin-bottom: 10px;
}
.bd-modal-input:focus { outline: none; border-color: #3498db; }
.bd-modal-textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid #ced4da; border-radius: 7px;
  padding: 9px 11px; font-size: 13px; font-family: inherit;
  resize: vertical; margin-bottom: 10px; min-height: 280px;
}
.bd-modal-textarea:focus { outline: none; border-color: #3498db; }
.bd-modal-footer {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.bd-submit-btn {
  background: #27ae60; color: white; border: none; border-radius: 7px;
  padding: 9px 20px; font-size: 13px; font-weight: bold; cursor: pointer;
  margin-left: auto;
}
.bd-submit-btn:hover { background: #219a52; }

@media (max-width: 600px) {
  body { padding: 8px; }

  /* 헤더 - 두 번째 미디어쿼리에서 처리 */

  /* 검색 - 두 번째 미디어쿼리에서 처리 */

  /* 섹션 헤더 */
  .section h3 { font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
  .right-buttons { float: none; display: flex; gap: 3px; margin-left: auto; }
  .sort-btn, .view-toggle-btn, .toggle-display-btn, .action-util-btn { font-size: 10px; padding: 2px 6px; }

  /* 카드 그리드 */
  #haveList:not(.view-mode-nameonly):not(.view-mode-photoonly),
  #wishList:not(.view-mode-nameonly):not(.view-mode-photoonly),
  #matchGiveList:not(.view-mode-nameonly):not(.view-mode-photoonly),
  #matchTakeList:not(.view-mode-nameonly):not(.view-mode-photoonly) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }
  #haveList.view-mode-nameonly, #wishList.view-mode-nameonly { grid-template-columns: 1fr !important; }
  #haveList.view-mode-photoonly, #wishList.view-mode-photoonly,
  #matchGiveList.view-mode-photoonly, #matchTakeList.view-mode-photoonly {
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)) !important;
  }

  /* 카드 내부 */
  .card { padding: 6px; gap: 5px; }
  .item-img-box { width: 38px; height: 38px; min-width: 38px; }
  .item-name-txt { font-size: 11px; }
  .card-info-right { min-width: 36px !important; width: 36px !important; }

  /* 교환 매칭 */
  .matching-box { padding: 8px; }
  #matchSection h3 { font-size: 13px; flex-wrap: wrap; gap: 4px; }
  #matchSection h3 > div { margin-left: 0 !important; width: 100%; justify-content: flex-end; }

  /* 페이지 버튼 */
  .more-btn { font-size: 11px; padding: 5px 12px; }

  /* 게시판 */
  .bd-table col:nth-child(1) { width: 30px; }
  .bd-table col:nth-child(3) { width: 56px; }
  .bd-table col:nth-child(4) { width: 46px; }
  .bd-table col:nth-child(5) { width: 26px; }
  .bd-table td, .bd-table th { padding: 7px 4px; font-size: 11px; }
  .bd-nick-hint { display: none; }
  .bd-modal-content { margin: 0 8px; }

  /* 검색 드롭다운 */
  .search-item-meta { display: none; }

  /* 모달 */
  .share-modal-content { width: calc(100vw - 32px); }


  /* 헤더의 설정버튼 숨기고 탭바 설정버튼 표시 */
  #collectionHeaderBtns .settings-btn { display: none !important; }
  .mobile-tab-settings { display: block !important; margin-left: auto; }
  .main-tab-bar { border-bottom: 2px solid #e9ecef; }

  /* ═══════════════════════════════
     헤더 모바일 (공통)
  ═══════════════════════════════ */
  /* 1행: 타이틀 + [게시판][공지] 오른쪽 정렬 + 설정 */
  .header-area {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .header-area > div:first-child {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 6px;
  }
  .header-area > div:first-child h2 { font-size: 15px; white-space: nowrap; flex-shrink: 0; }

  /* 2행: 저장/불러오기/교환매칭/설정 한 줄 */
  /* 저장/불러오기/교환매칭 균등 배분 */
  #collectionHeaderBtns {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    width: 100% !important;
    align-items: center !important;
  }
  #collectionHeaderBtns .header-btn-group { flex: 1 !important; display: flex !important; min-width: 0 !important; }
  #collectionHeaderBtns .header-btn-group .backup-btn { flex: 1 !important; padding: 6px 2px !important; font-size: 10px !important; text-align: center !important; white-space: nowrap !important; }
  #collectionHeaderBtns .match-dropdown-wrap { flex: 1.8 !important; min-width: 0 !important; }
  #collectionHeaderBtns .match-trigger-btn { width: 100% !important; padding: 6px 2px !important; font-size: 10px !important; text-align: center !important; white-space: nowrap !important; margin-left: 0 !important; }
  #collectionHeaderBtns .settings-btn { display: none !important; }

  /* ═══════════════════════════════
     콜렉션 북 모바일
  ═══════════════════════════════ */
  #colbookView { width: 100%; overflow-x: hidden; }
  .cb-colbook-layout { width: 100%; overflow-x: hidden; }
  .cb-center-col { width: 100%; min-width: 0; overflow-x: hidden; }
  .cb-center-wrap { width: 100% !important; box-sizing: border-box; padding: 10px; border-radius: 12px; overflow-x: hidden; }
  .cb-body { width: 100% !important; overflow-x: hidden; }
  .cb-grid-wrap { width: 100% !important; padding: 8px !important; box-sizing: border-box; overflow-x: hidden; }
  .cb-search-row { width: 100% !important; box-sizing: border-box; }

  /* 등급/부위 드롭다운 행 */
  .cb-mobile-filter-row {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-bottom: 8px;
  }
  .cb-mobile-grade-btn, .cb-mobile-part-btn {
    flex: 1;
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 700;
    border: 1.5px solid #ced4da;
    border-radius: 10px;
    background: #eef0f2;
    color: #4a5568;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cb-mobile-grade-btn.has-selection { background: #3498db; color: #fff; border-color: #2980b9; }
  .cb-mobile-part-btn.has-selection  { background: #2c3e50; color: #fff; border-color: #1a252f; }

  /* 드롭다운 패널 */
  .cb-mobile-dropdown {
    position: absolute;
    z-index: 9000;
    background: #fff;
    border: 1px solid #dde1e7;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    max-width: calc(100vw - 32px);
  }
  .cb-mobile-dropdown-item {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    border: 1.5px solid #dee2e6;
    border-radius: 16px;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
  }
  .cb-mobile-dropdown-item.active { background: #2c3e50; color: #fff; border-color: #2c3e50; }

  /* 검색행: 검색창 축소, 초기화 버튼 짙게 */
  .cb-search-row { width: 100% !important; }
  .cb-search-wrap { flex: 1; min-width: 0; }
  .cb-reset-btn {
    background: #4a5568 !important;
    color: #fff !important;
    border-color: #2c3e50 !important;
    flex-shrink: 0;
  }
  /* 보유중 셀렉트 박스 축소 */
  .cb-have-filter-icon { padding: 0 4px !important; font-size: 10px !important; }
  .cb-have-select { font-size: 10px !important; padding: 6px 4px 6px 0 !important; }

  /* grade-bar, 사이드바 모바일에서 숨김 */
  .cb-grade-bar { display: none !important; }
  .cb-part-sidebar { display: none !important; }

  /* 그리드: 4열 */
  .cb-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    width: 100% !important;
  }
  .cb-cell { width: auto !important; height: auto !important; aspect-ratio: 1; }
  .cb-grid-wrap { width: 100% !important; padding: 8px !important; box-sizing: border-box; }
  .cb-body { width: 100% !important; }

  /* 콜렉션 북 카드 툴팁 비활성화 (팝업과 겹침 방지) - JS에서 처리 */

  /* 그리드 하단 안내 멘트 (빈 셀 자리) */
  .cb-mobile-notice-cell {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    aspect-ratio: unset !important;
    height: 72px !important;
    width: auto !important;
    font-size: 10px;
    font-style: italic;
    color: #b8b0a5;
    text-align: right;
    padding: 0 6px;
    line-height: 1.4;
    word-break: keep-all;
    background: transparent !important;
  }

  /* 페이지네이션 */
  .cb-page-btns { flex-wrap: nowrap; overflow-x: auto; }




  /* 점수 패널 */
  .cb-score-panel { width: 100% !important; box-sizing: border-box; margin-top: 8px; }
  .cb-score-center { min-width: 0; }

  /* 다중선택 툴바 */
  .cb-multi-toolbar { flex-wrap: wrap; gap: 6px; }

  /* ═══════════════════════════════
     내 페이지 모바일
  ═══════════════════════════════ */
  /* 섹션 헤더 한줄 */
  .section h3 { flex-wrap: nowrap !important; overflow: hidden; }
  .right-buttons { flex-wrap: nowrap !important; flex-shrink: 0; }
  .sort-btn, .view-toggle-btn, .toggle-display-btn, .action-util-btn {
    font-size: 10px !important; padding: 2px 5px !important; white-space: nowrap;
  }
  /* 정렬: 버튼만 data-sort-label로 표시 (핀 버튼 제외) */
  #haveSortBtn, #wishSortBtn { font-size: 0 !important; }
  #haveSortBtn::after, #wishSortBtn::after { font-size: 10px; content: attr(data-sort-label); }

  /* 미니 검색창 축소 */
  .list-search-wrap { width: 80px !important; }

  /* 아이템만/재료만/필터 한 줄 - 실제 구조: search-filter-row > search-container, search-type-toggles, btn-filter-trigger */
  .search-filter-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px;
  }
  .search-filter-row .search-container { order: 0; }
  /* 아이템만+재료만+필터를 한 줄로 */
  .search-filter-row .search-type-toggles {
    order: 1;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 12px;
    flex: 1;
  }
  .search-filter-row .btn-filter-trigger {
    order: 1;
    flex-shrink: 0;
    width: auto !important;
    padding: 5px 10px !important;
    font-size: 0 !important;
  }
  .search-filter-row .btn-filter-trigger::after { content: "필터"; font-size: 12px; }
  /* 아이템만+재료만+필터를 같은 행에 (flex-row로 묶기) */
  .search-filter-row {
    flex-wrap: wrap !important;
  }
  .search-filter-row .search-container { flex: 0 0 100%; }
  .search-filter-row .search-type-toggles { flex: 1; }

}

/* ── 모바일 게시판 컬럼 최적화 (480px 이하) ── */
@media (max-width: 480px) {
  .col-num    { width: 15px !important; }
  .col-prefix { width: 20px !important; }
  .col-name   { width: 34px !important; }
  .col-date   { width: 23px !important; }
  .bd-table th { padding: 8px 3px; font-size: 10px; }
  .bd-table td { padding: 9px 3px; font-size: 11px; }
  .bd-table td.bd-title-cell { padding-left: 5px; }
}

/* =============================================
   랜덤매칭 드롭다운
============================================= */
.match-dropdown-wrap {
  position: relative;
  display: inline-block;
  margin-left: 4px;
}
.match-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 1000;
  min-width: 140px;
  overflow: hidden;
}
.match-dropdown-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid #f1f3f5;
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
  cursor: pointer;
  transition: background 0.15s;
}
.match-dropdown-menu button:last-child { border-bottom: none; }
.match-dropdown-menu button:hover { background: #f0f8ff; color: #2980b9; }

/* =============================================
   랜덤매칭 모달 내부 전용 스타일
============================================= */
.rm-label {
  display: block;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #495057;
  margin: 7px 0 3px 0;
}
.rm-contact-type-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 6px 0 2px 0;
  font-size: 13px;
}
.rm-contact-type-row label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
/* 랜덤매칭 결과 카드 */
.rm-result-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  text-align: left;
}
.rm-result-rank {
  font-size: 13px;
  font-weight: 800;
  color: #2980b9;
  margin-bottom: 6px;
}
.rm-result-score {
  font-size: 11px;
  color: #7f8c8d;
  margin-left: 6px;
  font-weight: normal;
}
.rm-result-contact {
  font-size: 12px;
  color: #34495e;
  margin: 4px 0;
}
.rm-result-items {
  font-size: 11px;
  color: #7f8c8d;
  margin-top: 6px;
  line-height: 1.6;
}
.rm-result-items b { color: #495057; }
.rm-no-result {
  text-align: center;
  color: #bdc3c7;
  padding: 24px 0;
  font-size: 13px;
}

/* 랜덤매칭 유도 배너 */
.rm-invite-banner { margin-top:20px; padding:15px; background:#fef9e7; border:1px solid #f1c40f; border-radius:8px; text-align:center; }
.rm-invite-icon { font-size:30px; margin-bottom:5px; }
.rm-invite-text { font-size:13px; color:#5d6d7e; }
.rm-invite-notice { text-align:left; font-size:11px; color:#95a5a6; margin:10px 0; padding-left:20px; }
.rm-invite-actions { display:flex; gap:10px; justify-content:center; }
.rm-invite-agree-btn { background:#f39c12; color:white; border:none; padding:8px 16px; border-radius:5px; cursor:pointer; }

/* 랜덤매칭 등록 모달 - 너비 확대 */
.rm-join-modal-content {
  max-width: 460px !important;
  width: 92% !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  padding: 18px 20px 18px !important;
}

/* 통합 안내 박스 */
.rm-join-notice-box {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid #e0e0e0;
  text-align: left;
}
.rm-join-notice-row {
  font-size: 11.5px;
  line-height: 1.5;
  padding: 7px 11px;
}
.rm-join-notice-row + .rm-join-notice-row {
  border-top: 1px solid rgba(0,0,0,0.06);
}
.rm-join-notice-info {
  background: #f8f9fa;
  color: #7f8c8d;
}
.rm-join-notice-warn {
  background: #fff8e1;
  color: #7b5800;
  line-height: 1.7;
}

/* 연락 방법 라디오 버튼 - 한 줄 유지 */
.rm-contact-type-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 6px 0 2px 0;
  font-size: 13px;
}
.rm-contact-type-row label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  background: #f8f9fa;
}
.rm-contact-type-row label:has(input:checked) {
  border-color: #3498db;
  background: #eaf4fd;
  color: #2980b9;
  font-weight: 700;
}

/* 기억 안내 배너 */
.rm-remember-notice {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: #7b5800;
  line-height: 1.7;
  margin: 10px 0 4px;
  text-align: left;
}

/* =============================================
   랜덤매칭 결과 모달 - 투 패널 구조
============================================= */
.rm-result-modal-wrap {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  width: 92%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.rm-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
}

.rm-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
}
.rm-panel-title {
  font-size: 15px;
  font-weight: 800;
  color: #2c3e50;
  flex: 1;
}
.rm-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #95a5a6;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.rm-close-btn:hover { background: #f0f0f0; color: #e74c3c; }
.rm-back-btn {
  background: none;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: #495057;
  cursor: pointer;
  white-space: nowrap;
}
.rm-back-btn:hover { background: #f8f9fa; }

.rm-panel-desc {
  font-size: 12px;
  color: #95a5a6;
  padding: 8px 18px 4px;
  flex-shrink: 0;
}

.rm-filter-bar {
  padding: 4px 18px 2px;
  display: flex;
  align-items: center;
}
.rm-filter-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #7f8c8d;
  cursor: pointer;
  user-select: none;
}
.rm-filter-label input[type="checkbox"] {
  width: 13px;
  height: 13px;
  cursor: pointer;
  accent-color: #3498db;
}

/* 리스트 스크롤 영역 */
.rm-list-scroll {
  overflow-y: auto;
  flex: 1;
  padding: 8px 14px 14px;
}

/* 리스트 아이템 버튼 */
.rm-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: #fdfcfa;
  border: 1px solid #e4dfd8;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.rm-list-item:hover {
  background: #eaf4fd;
  border-color: #3498db;
}
.rm-list-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.rm-list-medal {
  font-size: 12px;
  font-weight: 700;
  color: #95a5a6;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.rm-list-nick {
  font-size: 14px;
  font-weight: 800;
  color: #2c3e50;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rm-list-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.rm-list-score {
  font-size: 12px;
  font-weight: 700;
  color: #2980b9;
  background: #eaf4fd;
  padding: 2px 8px;
  border-radius: 10px;
}
.rm-list-summary {
  font-size: 11px;
  color: #95a5a6;
}
.rm-list-arrow {
  font-size: 20px;
  color: #bdc3c7;
  flex-shrink: 0;
  margin-left: 4px;
}

/* 상세 패널 */
.rm-panel-detail {
  display: flex;
  flex-direction: column;
}
.rm-detail-score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 10px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.rm-detail-score-label { font-size: 12px; color: #95a5a6; }
.rm-detail-score-val {
  font-size: 16px;
  font-weight: 900;
  color: #2980b9;
}
.rm-detail-contact-type {
  font-size: 12px;
  background: #eaf4fd;
  color: #2980b9;
  border-radius: 8px;
  padding: 2px 8px;
  margin-left: auto;
}

.rm-detail-body {
  overflow-y: auto;
  flex: 1;
  padding: 10px 18px 14px;
}

/* 연락처 노출 영역 */
.rm-detail-contact-area {
  margin-top: 12px;
  background: #f0faf4;
  border: 1px solid #27ae60;
  border-radius: 10px;
  padding: 12px 16px;
  animation: rmFadeIn 0.25s ease;
}
@keyframes rmFadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
.rm-contact-reveal-label {
  font-size: 11px;
  color: #27ae60;
  font-weight: 700;
  margin-bottom: 4px;
}
.rm-contact-reveal-value {
  font-size: 14px;
  font-weight: 700;
  color: #2c3e50;
  word-break: break-all;
}

/* 매칭 조건 안내 */
.rm-match-condition-notice {
  background: #fdf2f2;
  border: 1px solid #f5c6cb;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 12px;
  color: #c0392b;
  margin-bottom: 10px;
  line-height: 1.5;
}
/* 추가 연락처 체크박스 */
.rm-add-contact-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  font-size: 12px;
  color: #7f8c8d;
  cursor: pointer;
}
.rm-add-contact-label input[type="checkbox"] {
  width: 14px; height: 14px; cursor: pointer;
}
/* 연락처 블록 */
.rm-contact-block + .rm-contact-block {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #dce1e7;
}
/* 연락방법 구분선 (다중) */
.rm-contact-divider {
  border: none;
  border-top: 1px dashed #dce1e7;
  margin: 10px 0;
}

/* ── 기타-재료 필터 버튼 ── */
.btn-filter.grade-etc-btn {
  border-color: #a0785a;
  color: #7a5230;
  background: #fdf6f0;
  margin-left: 20px; /* 콜라보 버튼과 시각적 구분 */
  padding-left: 10px;
  padding-right: 10px;
}
.btn-filter.grade-etc-btn.active {
  background: #8b5e3c;
  border-color: #6b4423;
  color: #ffffff;
}

/* 이미지 없을 때 준비중 표시 */
.item-img-box.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #bdc3c7;
  background: #f8f9fa;
  border: 1px dashed #dee2e6;
  border-radius: 4px;
  text-align: center;
  word-break: keep-all;
}

/* 수량 + 연필 한 줄 */
.etc-qty-row {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 2px;
}

/* ── 기타-재료 구분선 (보유/위시 리스트 내) ── */
.etc-section-divider {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 800;
  color: #a0785a;
  background: #fdf6f0;
  border: 1px solid #e8d5c4;
  border-radius: 5px;
  padding: 4px 10px;
  margin: 10px 0 2px;
  letter-spacing: 0.5px;
}
.etc-card {
  border-left: 4px solid #a0785a !important;
}
.etc-card .card-info-right { overflow: visible !important; }
.etc-grade {
  color: #8b5e3c !important;
}

/* 수량 표시 + 연필 버튼 */
.etc-qty-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 2px;
}
.etc-qty-display {
  font-size: 12px;
  font-weight: 700;
  color: #7a5230;
}
/* 수량 badge: card 직속 absolute — NAME_ONLY·PHOTO_ONLY 모두에서 보임 */
.etc-qty-badge {
  position: absolute;
  bottom: 3px;
  left: 3px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
  padding: 1px 4px;
  pointer-events: none;
  line-height: 1.4;
  z-index: 3;
  white-space: nowrap;
}
/* PHOTO_ONLY에서 이미지 없는 재료카드 no-image 표시 */
.view-mode-photoonly .item-img-box.no-image {
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #999;
  background: #f0f0f0 !important;
  word-break: keep-all;
  text-align: center;
  line-height: 1.2;
}
.etc-qty-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  padding: 0 2px;
  opacity: 0.6;
  line-height: 1;
}
.etc-qty-edit-btn:hover { opacity: 1; }

/* 수량 조절 에디터 — 카드 위 플로팅 팝업 */
.etc-qty-editor {
  position: absolute;
  bottom: calc(100% + 4px);
  right: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px;
  background: #fdf6f0;
  border: 1px solid #c4956a;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 100;
  white-space: nowrap;
}
.etc-qty-btn {
  width: 16px; height: 16px;
  border: 1px solid #c4956a;
  border-radius: 3px;
  background: #fff;
  color: #7a5230;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}
.etc-qty-btn:hover { background: #f5e6d8; }
.etc-qty-input {
  width: 30px;
  text-align: center;
  border: 1px solid #c4956a;
  border-radius: 3px;
  padding: 1px 2px;
  font-size: 11px;
  font-weight: 700;
  color: #7a5230;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}
.etc-qty-input::-webkit-inner-spin-button,
.etc-qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.etc-qty-done {
  padding: 1px 5px;
  background: #8b5e3c;
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.etc-qty-done:hover { background: #6b4423; }

/* ── 사용자 제안 폼 ── */
.etc-suggest-box {
  margin-top: 20px;
  background: #fdf6f0;
  border: 1.5px dashed #c4956a;
  border-radius: 10px;
  padding: 14px 16px;
}
.etc-suggest-title {
  font-size: 13px;
  font-weight: 800;
  color: #7a5230;
  margin-bottom: 4px;
}
.etc-suggest-desc {
  font-size: 11.5px;
  color: #a0785a;
  margin-bottom: 10px;
}
.etc-suggest-box input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #d4a97a;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  color: #2c3e50;
  outline: none;
  margin-bottom: 6px;
  background: #fff;
  font-family: inherit;
}
.etc-suggest-box input:focus { border-color: #8b5e3c; }
.etc-suggest-btn {
  width: 100%;
  padding: 9px;
  background: #8b5e3c;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.etc-suggest-btn:hover { background: #6b4423; }
.etc-suggest-btn:disabled { background: #bdc3c7; cursor: not-allowed; }

/* 검색 결과 없을 때 추가 링크 버튼 */
.etc-add-link-btn {
  background: none;
  border: none;
  color: #3498db;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  opacity: 0.8;
}
.etc-add-link-btn:hover { opacity: 1; }
/* ── end 기타-재료 ── */
.list-nav-row {
  display: flex;
  align-items: center;
  margin-top: 10px;
  position: relative;
  min-height: 32px;
}
.list-search-wrap {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1.5px solid #dce1e7;
  border-radius: 6px;
  padding: 4px 8px;
  transition: border-color 0.15s;
  width: 150px;
  flex-shrink: 0;
}
.list-search-wrap:focus-within {
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52,152,219,0.10);
}
.list-search-icon {
  font-size: 11px;
  flex-shrink: 0;
  opacity: 0.45;
}
.list-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 11px;
  color: #2c3e50;
  background: transparent;
  font-family: inherit;
  min-width: 0;
}
.list-search-input::placeholder { color: #bdc3c7; }
.list-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: #bdc3c7;
  color: #fff;
  font-size: 9px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}
.list-search-clear:hover { background: #e74c3c; }
.list-page-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: 100%;
}
.list-search-count {
  font-size: 12px;
  color: #7f8c8d;
  margin: 8px 0 4px;
}
.list-search-empty {
  font-size: 13px;
  color: #bdc3c7;
  padding: 16px 0;
  text-align: center;
}
.list-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 6px;
}
/* ── end 검색창 ── */
#rmDetailGiveList, #rmDetailGetList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 6px;
  padding: 4px;
}
#rmDetailGiveList.view-mode-photoonly,
#rmDetailGetList.view-mode-photoonly {
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)) !important;
  gap: 4px !important;
}
#rmDetailGiveList.view-mode-photoonly .card,
#rmDetailGetList.view-mode-photoonly .card {
  width: 56px !important;
  height: 56px !important;
  padding: 0 !important;
  border-radius: 4px !important;
  border-left-width: 4px !important;
  justify-content: center;
}
#rmDetailGiveList.view-mode-photoonly .card-content-wrapper,
#rmDetailGetList.view-mode-photoonly .card-content-wrapper {
  display: none !important;
}
#rmDetailGiveList.view-mode-photoonly .item-img-box,
#rmDetailGetList.view-mode-photoonly .item-img-box {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  background: transparent !important;
}
/* 가리기 버튼 - 모든 보기 모드에서 표시 */
/* 랜덤매칭 가리기 버튼 */
.rm-hide-btn {
  position: absolute !important;
  top: 3px !important;
  right: 4px !important;
  font-size: 13px !important;
  width: 16px !important;
  height: 16px !important;
  padding: 0 !important;
  color: #c0c0c0 !important;
  background: none !important;
  border: none !important;
  border-radius: 3px !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}
.rm-hide-btn:hover { background: #e74c3c !important; color: #fff !important; }

/* ── 랜덤매칭 상세 패널 추가 스타일 ── */

/* 뷰모드 툴바 */
.rm-detail-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px 8px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafbfc;
  flex-shrink: 0;
}
.rm-view-toggle-btn {
  background: #eaf4fd;
  border: 1px solid #aed6f1;
  color: #2980b9;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.rm-view-toggle-btn:hover { background: #d6eaf8; }
.rm-util-btn {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #495057;
  border-radius: 6px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s;
}
.rm-util-btn:hover { background: #e9ecef; }
.rm-util-btn-capture { color: #8e44ad; border-color: #d2b4de; background: #f9f0ff; }
.rm-util-btn-capture:hover { background: #f0e0ff; }

/* 소제목 (이모티콘 없이, 볼드+컬러) */
.rm-matching-sub-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #2c3e50;
  margin: 4px 0 8px;
  letter-spacing: -0.2px;
}

/* 하단 액션 버튼 리디자인 */
.rm-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: center;
  flex-shrink: 0;
  padding-bottom: 4px;
}
.rm-action-contact-btn {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(52,152,219,0.3);
  transition: opacity 0.15s, transform 0.1s;
}
.rm-action-contact-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.rm-action-contact-btn:active { transform: translateY(0); }

.rm-action-back-btn {
  background: #f0f2f5;
  color: #5d6d7e;
  border: 1px solid #dce1e7;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.rm-action-back-btn:hover { background: #e2e8f0; }

/* 연락처 표시 — 닉네임 + 안내 문구 */
.rm-contact-nick {
  font-size: 15px;
  font-weight: 900;
  color: #2c3e50;
  margin-right: 6px;
}
.rm-contact-guide {
  font-size: 12.5px;
  color: #5d6d7e;
}

/* 연락처 — 링크 버튼 */
.rm-contact-link-btn {
  display: inline-block;
  background: linear-gradient(135deg, #27ae60, #1e8449);
  color: white !important;
  text-decoration: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(39,174,96,0.25);
  transition: opacity 0.15s;
}
.rm-contact-link-btn:hover { opacity: 0.88; }

/* 링크 복사 힌트 */
.rm-contact-link-hint {
  font-size: 11px;
  color: #95a5a6;
  margin-top: 8px;
  line-height: 1.5;
}
.rm-contact-link-raw {
  display: inline-block;
  margin-top: 3px;
  color: #3498db;
  word-break: break-all;
  cursor: pointer;
  text-decoration: underline;
  font-size: 11.5px;
}
.rm-contact-link-raw:hover { color: #2980b9; }

/* ── end 랜덤매칭 추가 스타일 ── */

/* 랜덤매칭 모달 위치 강제 고정 */
#randomMatchJoinModal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}

@media (max-width: 600px) {
  .match-dropdown-wrap { display: block; margin-left: 0; }
  .match-dropdown-menu { width: 100%; }
}
