/* ═══════════════════════════════════════════════════════════════
 *  skins/board/character/style.css
 *  캐릭터 도감 갤러리 스킨
 *
 *  - 모든 폭/색/간격은 core.css 의 CSS 변수 사용 (--content-max, --paper, --hair, --accent, --ink 등)
 *  - 캐릭터별 메인컬러는 --ch-accent 로 inline 주입 (테두리/호버 액센트로만)
 *  - 댓글/post-actions 은 공통 partial 그대로 사용
 * ═══════════════════════════════════════════════════════════════ */

/* ─── 그리드 ─── */
.ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 22px;
}

/* ─── 카드 ─── */
.ch-card {
  --ch-accent: var(--accent);  /* 폴백 */
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--paper-2);
  border: 1px solid var(--hair-soft);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.ch-card:hover {
  transform: translateY(-2px);
  border-color: var(--ch-accent);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--ch-accent) 18%, transparent);
}
.ch-card.has-accent { border-top: 3px solid var(--ch-accent); }

/* ─── 썸네일 (정사각) ─── */
.ch-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--hair-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ch-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ch-initial {
  font-size: 56px;
  font-weight: 800;
  color: var(--ink-mute);
  line-height: 1;
  user-select: none;
}
.ch-lock {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 28px;
  color: var(--ink-mute);
  background: color-mix(in srgb, var(--ink) 6%, var(--paper-2));
}
.ch-badge-secret {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--ch-accent, var(--accent));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .5px;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

/* ─── 카드 정보 ─── */
.ch-info {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.ch-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  word-break: break-word;
}

/* ─── 빈 상태 ─── */
.ch-grid + .empty-msg,
.ch-grid .empty-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-mute);
  font-size: 13px;
}

/* ─── 모바일 ─── */
@media (max-width: 768px) {
  .ch-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 14px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .ch-info { padding: 10px 12px 12px; }
  .ch-name { font-size: 13px; }
  .ch-initial { font-size: 44px; }
}

/* ═══════════════════════════════════════════════════════════════
 *  플래시 / 빈 안내
 * ═══════════════════════════════════════════════════════════════ */
.ch-flash {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
}
.ch-flash.success { background: color-mix(in srgb, var(--accent) 10%, var(--paper)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.ch-flash.error   { background: #fff0f0; color: #c1272d; border: 1px solid #f4c2c2; }

/* ═══════════════════════════════════════════════════════════════
 *  작성/수정 폼 (별도 페이지 모드)
 * ═══════════════════════════════════════════════════════════════ */
.ch-form-page {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 28px;
}

.ch-form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hair-soft);
}
.ch-form-head h2 {
  font-size: 20px;
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}
.ch-form-cancel {
  font-size: 12px;
  color: var(--ink-mute);
  text-decoration: none;
}
.ch-form-cancel:hover { color: var(--ink); }

/* ═══════════════════════════════════════════════════════════════
 *  상단 메타 바 — 카테고리 + 비밀글 토글
 * ═══════════════════════════════════════════════════════════════ */
.ch-meta-bar {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 18px;
}
/* 메타 바 안의 ch-private-toggle 은 flex 1 로 남은 공간 채움 */
.ch-meta-bar .ch-private-toggle {
  flex: 1 !important;
}

/* ═══════════════════════════════════════════════════════════════
 *  폼 — 메인컬러 작게 (label 폭 제한)
 * ═══════════════════════════════════════════════════════════════ */
.ch-flex-grow  { flex: 1 1 auto !important; }
.ch-flex-color { flex: 0 0 180px !important; }

/* ═══════════════════════════════════════════════════════════════
 *  폼 — 메타 바 (카테고리 + 비밀글)
 *  fieldset 위에 단독 영역
 * ═══════════════════════════════════════════════════════════════ */
.ch-meta-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--paper-2);
  border: 1px solid var(--hair-soft);
  border-radius: 10px;
  flex-wrap: wrap;
}
.ch-fs {
  border: 1px solid var(--hair-soft);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 14px;
}
.ch-fs > legend {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 0 8px;
}
.ch-fs > legend small {
  font-weight: 400;
  color: var(--ink-mute);
}

.ch-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  align-items: flex-start;
}
.ch-row:last-child { margin-bottom: 0; }
.ch-row label {
  flex: 1;
  min-width: 0;
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.4;
}
.ch-row label > input,
.ch-row label > select,
.ch-row label > .ch-color-pick,
.ch-row label > textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  box-sizing: border-box;
}
.ch-row .req { color: #c1272d; margin-left: 2px; }
.ch-row-5 label { flex: 1 1 0; }

.ch-row input[type="text"],
.ch-row input[type="file"],
.ch-row select,
.ch-form textarea {
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--ink);
}
.ch-form textarea {
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
.ch-row input:focus,
.ch-row select:focus,
.ch-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.ch-check {
  flex: 0 0 auto !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 13px !important;
  padding-top: 18px;
}

.ch-sub-label {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 10px 0 6px;
  font-weight: 600;
}

.img-row, .rel-row {
  margin-bottom: 6px !important;
}
.rel-row input[name="rel_name[]"]   { flex: 0 0 200px; }
.rel-row input[name="rel_target[]"] { flex: 1; }
.img-row input  { flex: 1; }

.ch-mini-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--hair);
  border-radius: 5px;
  background: var(--paper-2);
  color: var(--ink-soft);
  cursor: pointer;
  flex: 0 0 auto;
}
.ch-mini-btn:hover { background: var(--paper); border-color: var(--accent); color: var(--ink); }
.ch-add-btn { margin-top: 4px; }

.ch-form-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--hair-soft);
}
.ch-form-actions .btn-cancel,
.ch-form-actions .btn-submit {
  padding: 10px 28px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition: opacity .15s, background .15s;
}
.ch-form-actions .btn-cancel {
  background: var(--paper-2);
  color: var(--ink-soft);
  border: 1px solid var(--hair);
}
.ch-form-actions .btn-cancel:hover { background: var(--paper); color: var(--ink); }
.ch-form-actions .btn-submit {
  background: var(--accent);
  color: #fff;
}
.ch-form-actions .btn-submit:hover { opacity: .9; }

/* ═══════════════════════════════════════════════════════════════
 *  프로필 시트 (view.php)
 * ═══════════════════════════════════════════════════════════════ */
.character-view {
  --ch-accent: var(--accent);  /* 폴백 */
}

.ch-sheet {
  display: flex;
  flex-direction: column;
  gap: 32px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 32px;
}

.ch-sheet-grid {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 32px;
}

.ch-sheet-bottom {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ch-sheet-images {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ch-main-image {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: var(--hair-soft);
}
/* 이미지 없을 때 (placeholder) — 3:4 박스 */
.ch-main-image.no-img {
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 이미지 있을 때 — 자연 비율 그대로, 잘림 없음 */
.ch-main-image img {
  width: 100%;
  height: auto;
  display: block;
}
.ch-initial-lg {
  font-size: 96px;
  font-weight: 800;
  color: var(--ink-mute);
  line-height: 1;
}
.ch-sub-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ch-sub-images a {
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--hair-soft);
}
.ch-sub-images img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .2s;
}
.ch-sub-images a:hover img { transform: scale(1.05); }

.ch-sheet-info { min-width: 0; }

.ch-sheet-head {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--ch-accent);
}
.ch-sheet-head .post-cat-chip {
  display: inline-block;
  margin-bottom: 8px;
}
.ch-sheet-name {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ch-name-en {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-mute);
}
.ch-oneliner {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 8px 0 0;
  font-style: italic;
}
.ch-sheet-name .ch-badge-secret {
  position: static;
  font-size: 11px;
  padding: 3px 7px;
}

/* ═══════════════════════════════════════════════════════════════
 *  폼 — 컬러픽커 (작은 사이즈)
 * ═══════════════════════════════════════════════════════════════ */
.ch-color-label {
  flex: 0 0 180px !important;
}
.ch-color-pick {
  display: flex;
  gap: 4px;
  align-items: center;
}
.ch-color-pick input[type="color"] {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 2px;
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: var(--paper-2);
  cursor: pointer;
  margin-top: 0 !important;  /* label > input 의 margin-top 4px 무효화 */
}
.ch-color-pick input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.ch-color-pick input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
.ch-color-pick input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  margin-top: 0 !important;  /* 동일 */
}

/* ═══════════════════════════════════════════════════════════════
 *  폼 — 게시글 비밀글 토글 (방명록 .private-toggle 패턴 차용)
 * ═══════════════════════════════════════════════════════════════ */
.ch-private-toggle {
  flex: 1 !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 7px;
  padding: 10px 14px !important;
  font-size: 12px !important;
  color: var(--ink-soft) !important;
  cursor: pointer;
  transition: border-color .15s;
}
.ch-private-toggle:hover { border-color: var(--accent); }
.ch-private-toggle input { accent-color: var(--accent); flex: 0 0 auto; }
.ch-private-toggle .ico {
  font-size: 13px;
  color: var(--ink-mute);
  display: inline-flex;
  flex: 0 0 auto;
}
.ch-private-toggle input:checked ~ .ico { color: var(--accent); }
.ch-private-toggle .lbl {
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}
.ch-private-toggle .lbl small {
  font-weight: 400;
  color: var(--ink-mute);
  margin-left: 6px;
}

/* ═══════════════════════════════════════════════════════════════
 *  폼 — 이미지 블록 (썸네일/두상/전신)
 *  URL 행 + 파일 박스 행 (본체 .write-upload 패턴 차용)
 * ═══════════════════════════════════════════════════════════════ */
.ch-img-block {
  background: var(--paper-2);
  border: 1px solid var(--hair-soft);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.ch-img-block-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.ch-img-block-head strong {
  font-size: 13px;
  color: var(--ink);
  font-weight: 700;
}
.ch-img-block-head small {
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 400;
}
.ch-img-block-cur {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 6px 8px;
  background: var(--paper);
  border-radius: 6px;
  font-size: 11px;
  color: var(--ink-mute);
}
.ch-img-block-cur img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--hair);
}
.ch-img-url-input {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  border: 1px solid var(--hair);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  margin-bottom: 8px;
  box-sizing: border-box;
}
.ch-img-url-input:focus { outline: none; border-color: var(--accent); }

/* 파일 박스 — 본체 캡처 패턴: [파일 선택] | 파일명 */
.ch-file-input {
  display: flex;
  align-items: stretch;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s;
}
.ch-file-input:hover { border-color: var(--accent); }
.ch-file-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.ch-file-input-btn {
  flex: 0 0 auto;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 700;
  border-right: 1px solid var(--hair);
  display: inline-flex;
  align-items: center;
  transition: background .15s;
}
.ch-file-input:hover .ch-file-input-btn {
  background: color-mix(in srgb, var(--accent) 18%, var(--paper));
}
.ch-file-input-name {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 12px;
  color: var(--ink-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════
 *  폼 — 자유 설정 textarea 라벨 (공개/비공개)
 * ═══════════════════════════════════════════════════════════════ */
.ch-textarea-label {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin-bottom: 12px;
}
.ch-textarea-label:last-child { margin-bottom: 0; }
.ch-ta-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.ch-ta-head .ch-ta-ico {
  color: var(--accent);
  font-size: 11px;
}
.ch-ta-head strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.ch-ta-head small {
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════
 *  폼 — 옷장 안내 문구 (수정 시)
 * ═══════════════════════════════════════════════════════════════ */
.ch-wardrobe-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--accent) 6%, var(--paper-2));
  border: 1px dashed color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}
.ch-wardrobe-note small { color: var(--ink-soft); }

/* ═══════════════════════════════════════════════════════════════
 *  view — 신상/특성 탭 + 두상 옆 (ch-info-tabs-section)
 * ═══════════════════════════════════════════════════════════════ */
.ch-info-grid {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 18px;
  align-items: start;
  padding: 16px 18px;
}
.ch-info-grid:not(:has(.ch-info-head)) {
  grid-template-columns: 1fr;
}
.ch-info-tabs-section .ch-tab-panel {
  display: none;
  padding: 0;  /* 그리드 안에서는 자체 padding 제거 */
}
.ch-info-tabs-section .ch-tab-panel.is-active { display: block; }
.ch-info-panels {
  min-width: 0;
}
.ch-info-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.ch-info-head a {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
}
.ch-info-head img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .2s;
}
.ch-info-head a:hover img { transform: scale(1.05); }
.ch-info-head figcaption {
  text-align: center;
  font-size: 10px;
  color: var(--ink-mute);
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
 *  view — 옷장 (좌측 컬럼, 인라인 관리)
 * ═══════════════════════════════════════════════════════════════ */
.ch-wardrobe {
  background: var(--paper-2);
  border: 1px solid var(--hair-soft);
  border-radius: 12px;
  padding: 14px 16px;
}
.ch-wardrobe-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.ch-wardrobe-head h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.ch-wardrobe-toggle {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.ch-wardrobe-toggle:hover {
  background: var(--ch-accent);
  border-color: var(--ch-accent);
  color: #fff;
}

/* 빈 상태 */
.ch-wardrobe-empty {
  text-align: center;
  padding: 24px 12px;
  font-size: 12px;
  color: var(--ink-mute);
}

/* 옷장 그리드 */
.ch-wardrobe-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.ch-cloth {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--hair-soft);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.ch-cloth:hover {
  border-color: var(--ch-accent);
  transform: translateY(-2px);
}
.ch-cloth-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--hair-soft);
  overflow: hidden;
}
.ch-cloth-img img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.ch-cloth-name {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 호버시 액션 버튼 표시 */
.ch-cloth-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.ch-cloth:hover .ch-cloth-actions { opacity: 1; }
.ch-cloth-edit,
.ch-cloth-del {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  line-height: 1;
}
.ch-cloth-edit:hover { background: var(--ch-accent); }
.ch-cloth-del:hover  { background: #c1272d; }
.ch-cloth-del-form { display: inline; margin: 0; }

/* 추가/수정 폼 */
.ch-wardrobe-form {
  display: none;
  background: var(--paper);
  border: 1px solid var(--ch-accent);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.ch-wardrobe-form.open { display: block; }
.ch-wardrobe-form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hair-soft);
}
.ch-wardrobe-form-head strong {
  font-size: 12px;
  color: var(--ink);
  font-weight: 700;
}
.ch-wardrobe-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--ink-mute);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.ch-wardrobe-close:hover { color: var(--ink); }
.ch-wardrobe-form-row {
  margin-bottom: 8px;
}
.ch-wardrobe-form-row:last-of-type { margin-bottom: 0; }
.ch-wardrobe-form-row input[type="text"] {
  width: 100%;
  padding: 7px 10px;
  font-size: 12px;
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--ink);
  box-sizing: border-box;
}
.ch-wardrobe-form-row input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}
.ch-file-input-row .ch-file-input {
  border-radius: 6px;
}
.ch-file-input-row .ch-file-input-btn {
  padding: 7px 14px;
  font-size: 11px;
}
.ch-file-input-row .ch-file-input-name {
  padding: 0 10px;
  font-size: 11px;
}
.ch-wardrobe-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
.ch-wardrobe-form-actions .btn-submit {
  padding: 7px 18px;
  font-size: 12px;
  font-weight: 700;
  background: var(--ch-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
}
.ch-wardrobe-form-actions .btn-submit:hover { opacity: .9; }

/* (구) placeholder — 더이상 사용 안 함, 호환용으로 남김 */
.ch-wardrobe-placeholder {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
 *  view — 로그 섹션 (서브 보드, 풀폭 하단)
 * ═══════════════════════════════════════════════════════════════ */
.ch-logs {
  background: var(--paper-2);
  border: 1px solid var(--hair-soft);
  border-radius: 12px;
  padding: 18px 22px;
}
.ch-logs-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.ch-logs-head h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.ch-logs-head h2 small {
  font-weight: 400;
  color: var(--ink-mute);
  font-size: 12px;
}
.ch-logs-toggle {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.ch-logs-toggle:hover {
  background: var(--ch-accent);
  border-color: var(--ch-accent);
  color: #fff;
}

.ch-logs-empty {
  text-align: center;
  padding: 32px 16px;
  font-size: 13px;
  color: var(--ink-mute);
}

/* 로그 카드 그리드 */
.ch-logs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.ch-log-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--hair-soft);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.ch-log-card:hover {
  border-color: var(--ch-accent);
  transform: translateY(-2px);
}
.ch-log-body {
  display: block;
  text-decoration: none;
  color: inherit;
}
.ch-log-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--hair-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ch-log-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.ch-log-no-thumb {
  font-size: 32px;
  opacity: .3;
}
.ch-log-info {
  padding: 10px 12px 12px;
}
.ch-log-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.ch-log-date {
  font-size: 10px;
  color: var(--ink-mute);
  font-weight: 500;
}

/* 로그 카드 호버 액션 */
.ch-log-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.ch-log-card:hover .ch-log-actions { opacity: 1; }
.ch-log-edit,
.ch-log-del {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  line-height: 1;
}
.ch-log-edit:hover { background: var(--ch-accent); }
.ch-log-del:hover  { background: #c1272d; }
.ch-log-del-form { display: inline; margin: 0; }

/* 로그 작성/편집 폼 */
.ch-log-form {
  display: none;
  background: var(--paper);
  border: 1px solid var(--ch-accent);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.ch-log-form.open { display: block; }
.ch-log-form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hair-soft);
}
.ch-log-form-head strong {
  font-size: 13px;
  color: var(--ink);
  font-weight: 700;
}
.ch-log-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--ink-mute);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.ch-log-close:hover { color: var(--ink); }
.ch-log-form-row {
  margin-bottom: 10px;
}
.ch-log-form-row:last-of-type { margin-bottom: 0; }
.ch-log-form-row > input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  border: 1px solid var(--hair);
  border-radius: 7px;
  background: var(--paper-2);
  color: var(--ink);
  box-sizing: border-box;
}
.ch-log-form-row > input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}
.ch-log-thumb-row .ch-log-thumb-label {
  display: block;
  font-size: 11px;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.ch-log-thumb-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ch-log-thumb-inputs input[type="text"] {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--ink);
  box-sizing: border-box;
}
.ch-log-thumb-inputs input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}
.ch-log-thumb-inputs .ch-file-input {
  flex: 0 0 auto;
}
.ch-log-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hair-soft);
}
.ch-log-form-actions .btn-submit {
  padding: 8px 22px;
  font-size: 12px;
  font-weight: 700;
  background: var(--ch-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
}
.ch-log-form-actions .btn-submit:hover { opacity: .9; }

.ch-section { margin-bottom: 22px; }
.ch-section:last-child { margin-bottom: 0; }
.ch-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ch-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hair-soft);
}
.ch-section-title small {
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-mute);
  margin-left: 6px;
}

.ch-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 0;
  font-size: 13px;
}
.ch-dl dt {
  color: var(--ink-mute);
  font-weight: 600;
}
.ch-dl dd {
  margin: 0;
  color: var(--ink);
}
.ch-dl-stacked dt { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding-top: 2px; }

/* ═══════════════════════════════════════════════════════════════
 *  view — 관계 (헤더 안 우측 정렬 인라인 칩)
 * ═══════════════════════════════════════════════════════════════ */
.ch-rel-inline {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.ch-rel-inline li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  background: var(--paper-2);
  border: 1px solid var(--hair-soft);
  border-radius: 999px;
  color: var(--ink);
}
.ch-rel-inline .rel-name {
  font-weight: 700;
  color: var(--ch-accent);
}
.ch-rel-inline .rel-arrow {
  color: var(--ink-mute);
  font-size: 10px;
}
.ch-rel-inline .rel-target {
  color: var(--ink);
}

/* ═══════════════════════════════════════════════════════════════
 *  view — 자유 설정 탭 (공개/비공개 토글)
 * ═══════════════════════════════════════════════════════════════ */
.ch-tabs-section {
  background: var(--paper-2);
  border: 1px solid var(--hair-soft);
  border-radius: 10px;
  overflow: hidden;
}
.ch-tabs {
  display: flex;
  background: var(--paper);
  border-bottom: 1px solid var(--hair-soft);
}
.ch-tab {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ch-tab:hover { color: var(--ink); background: var(--paper-2); }
.ch-tab.is-active {
  color: var(--ch-accent);
  border-bottom-color: var(--ch-accent);
  background: var(--paper-2);
}
.ch-tab .ico { font-size: 11px; }
.ch-tab-panel {
  display: none;
  padding: 16px 18px;
}
.ch-tab-panel.is-active { display: block; }
.ch-free-content {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}
/* markdown-body 가 함께 적용된 경우 본체의 markdown CSS 가 실제 렌더링 처리 */
.ch-free-content.markdown-body {
  color: var(--ink);
}

.ch-sheet-meta {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--hair-soft);
  font-size: 11px;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ch-sheet-meta .dot { opacity: .5; }

/* ─── 모바일 (프로필 시트) ─── */
@media (max-width: 768px) {
  .ch-sheet {
    gap: 20px;
    padding: 18px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .ch-sheet-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .ch-sheet-images { max-width: 280px; margin: 0 auto; width: 100%; }
  .ch-sheet-name { font-size: 22px; }
  .ch-dl { grid-template-columns: 80px 1fr; gap: 4px 12px; font-size: 12px; }
  .ch-info-grid { grid-template-columns: 1fr 120px; gap: 14px; padding: 12px 14px; }
  .ch-info-grid:not(:has(.ch-info-head)) { grid-template-columns: 1fr; }
  .ch-rel-inline { justify-content: flex-start; }
}

/* 공유 버튼 + 로그 카드 진입 highlight */
.ch-log-share {
  background: transparent;
  border: 1px solid var(--hair);
  color: var(--ink-mute);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all .15s;
}
.ch-log-share:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.ch-log-card {
  transition: box-shadow .3s ease, transform .3s ease;
}
.ch-log-highlight {
  box-shadow: 0 0 0 3px var(--accent), 0 8px 24px rgba(0, 0, 0, .15);
  transform: scale(1.02);
}

/* 캐릭터 카드 안의 카테고리 칩 — flex item 으로 강제 노출 */
.ch-info .post-cat-chip {
  display: inline-block;
  margin-bottom: 0;
}
