/* ═══ webzine.css ═══════════════════════════
 * 웹진 관리 모듈 전용 스타일
 * 접두사: 
 * ═════════════════════════════════════════ */

/* ─── 블록 간격 ─────────
 * 구조: #webzinePageContent > .selector-bar + .page-content
 * `.page-content` 는 자체적으로 flex column + gap 처리 (common.css)
 * ─────────────────────────────────────────── */

/* 페이지 컨텐츠 내부 action 그룹은 상단 여백 제거 */
.page-content > .form__actions {
  margin-top: 0;
}

/* .selector-bar* 는 common.css 로 이관 (components.md 참조). 여기에는 webzine 전용 미세 조정만 유지. */
.selector-bar__deploy-link {
  font-family: 'Consolas', 'Menlo', monospace;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── 분할 패널 · 패널 헤더 · 빈 메시지 ─────
 * 공통 .split-panel*, .panel-header*, .empty-message 는 common.css 로 이관됨
 * (components.md §2-1, §2-2, §2-6).
 * 여기에는 webzine 전용 modifier 만 남긴다.
 * ──────────────────────────────────────────── */

/* 볼륨 관리 — 고객사 패널 (220px, 좁은 사이드바) */
.vol-cus-panel {
  flex: 0 0 220px;
}

.vol-cus-search {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.vol-cus-search .form__input {
  width: 100%;
  font-size: var(--fs-xs);
}

/* 볼륨 관리 — 삭제본(dflag=1) 행 — 관리자 전용 출력, 영구 삭제 대상 표식 */
#wzVolumeTable .tabulator-row.is-deleted {
  opacity: 0.55;
}

#wzVolumeTable .tabulator-row.is-deleted .tabulator-cell {
  text-decoration: line-through;
  text-decoration-color: var(--color-muted);
}

/* 관리(⋮) 셀의 버튼은 취소선 제외 — 클릭 가독성 유지 */
#wzVolumeTable .tabulator-row.is-deleted .cell-actions {
  text-decoration: none;
}

/* '삭제됨' 배지(.badge-danger) 는 원본 색상 유지 */
#wzVolumeTable .tabulator-row.is-deleted .badge {
  text-decoration: none;
}

/* 콘텐츠관리 → 화면구성 — 카드 상세 / 섹션 폼 레이아웃
 * 우측 패널은 flex-column. 헤더·탭·form__actions 는 자연 높이, tab-content 만 flex:1 로 남은 공간을 채우고 스크롤.
 * 결과: form__actions(저장·삭제)는 항상 패널 하단에 노출되며, 긴 폼은 tab-content 내부에서 스크롤. */
#wzIdxFormPanel .tab-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

#wzIdxFormPanel .form__actions {
  background: var(--color-card-bg);
  padding: 12px 0;
  margin-top: 12px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

/* .editor-panel-body 는 common.css 로 이관 */

/* transfer 모드 — 좌/우 패널 동일 구조 (components.md §2-1 원칙: 뼈대는 padding/border 없음) */
.split-panel__left--transfer,
.split-panel__right--transfer {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.split-panel__left--transfer > div:last-child,
.split-panel__right--transfer > div:last-child {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* 공용 트리 (.tree*) 는 common.css 로 이관 (components.md §2-4) */

/* triple 모드 — webzine 전용 children layout (볼륨 마스터/트리/폼) */
.split-panel--triple #wzVolMasterPanel {
  flex: 0 0 280px;
}

.split-panel--triple #wzVolTreePanel{
  flex: 0 0 350px;  
}
.split-panel--triple #wzVolFormPanel {
  flex: 1 1 auto;
}

/* col 자체가 스크롤 담당(common.css) — 내부 non-header 컨텐츠에는 여백만 부여 */
.split-panel--triple .split-panel__col > div:not(.panel-header) {
  padding: 8px;
}

.split-panel--triple #wzVolFormPanel > #wzVolFormContent {
  padding: 16px;
}

/* 트리(.tree*) 는 common.css §공통 컴포넌트 (components.md §2-4) 로 이관 */

/* 트리 active 노드 내 배지 — 어두운 active 배경(primary)에서 가독성 확보
 * 기본 .badge-info 텍스트 색상(검정)이 흰색 배경 위에서만 가독성 좋으므로,
 * active 상태의 .tree__node 내부 badge 는 흰색 계열로 재지정. */
.tree__node.is-active .badge {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
}

/* ─── 콘텐츠 에디터 split-panel 비율 ────────
 * 공통 .split-panel__col 뼈대 사용. 편집기 특유의 3열 비율(22%/1/28%)만
 * ID selector 로 오버라이드 (볼륨메뉴의 #wzVolMasterPanel 등과 동일 패턴). */
#wzEditorTree    { flex: 0 0 22%; }
#wzEditorPreview { flex: 0 0 28%; }
/* #wzEditorMain 은 기본 .split-panel__col flex: 1 1 0 사용 */

/* 에디터 탭 (.tabs*) 은 common.css §공통 컴포넌트 (components.md §2-3) 로 이관.
 * HTML/CSS 서브탭도 .tabs.tabs--sub 로 통합됨.
 * 여기에는 webzine 전용 미세 조정만 유지. */
.tabs.tabs--sub .tabs__btn {
  padding: 5px 12px;
  font-size: var(--fs-code);
}

/* ─── 공통 이관 ────────────────────────────
 * .editor-content, .code-editor, .cm-wrap*, .code-editor__textarea,
 * .editor-toolbar, .visual-editor*, .preview-frame*, .preview-layout*,
 * .validation-list* (+ is-success/is-error/is-warning)
 * → 모두 common.css 로 이관됨. webzine 전용 오버라이드만 아래 유지.
 * ──────────────────────────────────────────── */

/* 웹진 미리보기 프레임 내부 padding (본문 텍스트) */
.preview-frame__content {
  padding: 16px;
  font-size: var(--fs-base);
  line-height: 1.8;
}

/* 웹진 미리보기 레이아웃 — grid (common .preview-layout 는 flex 기반) */
.preview-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  min-height: 500px;
}

/* ─── 배포 레이아웃 ──────────────────────── */

.deploy-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.deploy-section {
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: var(--radius-md, 6px);
  background: var(--color-section-bg, #fff);
  padding: 20px;
}

/* 템플릿 리스트 (.list*) 는 common.css §공통 컴포넌트 (components.md §2-5) 로 이관.
 * more_vert 버튼 hover·선택 상태만 webzine 에서 보정 (is-active 상태 클래스 기준). */
.list__item--actions .btn-table-more {
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.list__item--actions:hover .btn-table-more,
.list__item--actions.is-active .btn-table-more {
  opacity: 1;
}

.list__item--actions.is-active .btn-table-more {
  color: var(--color-bg);
  opacity: 0.85;
}

.list__item--actions.is-active .btn-table-more:hover {
  background: var(--color-primary-hover);
  color: var(--color-bg);
  opacity: 1;
}

/* ─── items 테이블 ───────────────────────── */

.admin-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.admin-items-table th {
  background: var(--color-module-bg, #f0f3f8);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  font-size: var(--fs-xs);
  border-bottom: 1px solid var(--admin-border, #e2e8f0);
}

.admin-items-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--admin-border, #e2e8f0);
}

/* ─── 템플릿 편집 푸터 ────────────────────── */

.form__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--admin-border, #e2e8f0);
  flex-shrink: 0;
}

.tab-content {
  padding: 16px 0;
}

/* 코드 에디터 탭 콘텐츠: flex:1 체인으로 CM fill-height */
.tab-content--editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 12px;
  min-height: 0;
}

/* 탭 안에 readonly textarea (적용 CSS preview 등) 가 직접 들어갈 때 자체 fill */
.tab-content--editor > textarea {
  flex: 1;
  min-height: 0;
  width: 100%;
  resize: none;
  font-family: 'Fira Code', Consolas, Monaco, monospace;
  font-size: var(--fs-code);
  background: var(--color-table-th-bg);
  color: var(--color-text);
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
}

/* 폼 탭 콘텐츠: 스크롤 가능 */
.tab-content--form {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ─── 코드 편집 레이아웃 (코드+가이드) ──── */

.tpl-code-layout {
  display: flex;
  gap: 16px;
}

.tpl-code-layout__editor {
  flex: 1;
}

.tpl-code-layout__editor--full {
  flex: 1;
}

.tpl-code-layout__editor textarea {
  min-height: 360px;
}

.tpl-code-layout__guide {
  flex: 0 0 220px;
  background: var(--color-module-bg, #f0f3f8);
  border-radius: var(--radius-sm, 4px);
  padding: 12px;
}

.tpl-guide__title {
  font-size: var(--fs-xs);
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--color-text, #333);
}

.tpl-guide__table {
  width: 100%;
  font-size: var(--fs-code);
  border-collapse: collapse;
}

.tpl-guide__table th {
  text-align: left;
  padding: 4px 6px;
  font-weight: 600;
  border-bottom: 1px solid var(--admin-border, #e2e8f0);
  color: var(--color-muted, #64748b);
}

.tpl-guide__table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--admin-border, #e2e8f0);
}

.tpl-guide__table code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: var(--fs-code);
  color: var(--color-primary, #000000);
}

/* ─── CSS 에디터 전용 ────────────────────── */

.code-editor__textarea--css {
  min-height: 400px;
}

/* ─── 카드타입 레이아웃 ──────────────────── */

.card-type-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-type-layout__list {
  flex: none;
}

.card-type-layout__editor {
  flex: 1;
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: var(--radius-md, 6px);
  padding: 16px;
  background: var(--color-module-bg, #f0f3f8);
}

.card-row {
  cursor: pointer;
  transition: background 0.15s;
}

.card-row:hover {
  background: var(--color-table-hover, #dbeafe);
}

.card-row.is-active {
  background: var(--color-primary-glow, rgba(0, 0, 0, 0.06));
}

.card-row.is-active td {
  font-weight: 500;
}

/* ─── 카드 편집기 ────────────────────────── */

.card-editor__fields {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.card-editor__fields .form__group {
  flex: 1;
  min-width: 160px;
}

.card-editor__code-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text, #333);
}

.card-editor__ph-list {
  font-weight: 400;
}

.card-editor__ph-list code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: var(--fs-badge);
  color: var(--color-primary, #000000);
  cursor: help;
}

.card-editor__code textarea {
  min-height: 120px;
}

/* ─── 미리보기 탭 ────────────────────────── */

.tpl-preview {
  padding: 0;
}

.tpl-preview__title {
  font-size: var(--fs-base);
  font-weight: 600;
  margin: 0 0 12px 0;
}

.tpl-preview__section-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin: 0 0 12px 0;
}

.tpl-preview__meta-table {
  width: 100%;
  max-width: 400px;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.tpl-preview__meta-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--admin-border, #e2e8f0);
}

.tpl-preview__meta-table td:first-child {
  font-weight: 600;
  color: var(--color-muted, #64748b);
  width: 120px;
}

/* ─── 페이지 구조 다이어그램 ─────────────── */

.tpl-preview__layout-diagram {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 500px;
}

.tpl-preview__block {
  padding: 12px 16px;
  border-radius: var(--radius-sm, 4px);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-align: center;
}

.tpl-preview__block--header {
  background: #3d3e42;
  color: #fff;
}

.tpl-preview__block--transparent {
  background: transparent;
  border: 2px dashed #3d3e42;
  color: #3d3e42;
  position: relative;
}

.tpl-preview__block--banner {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  padding: 24px;
}

.tpl-preview__block--body {
  background: var(--color-module-bg, #f0f3f8);
  color: var(--color-text, #333);
  padding: 32px;
  min-height: 60px;
}

.tpl-preview__block--footer {
  background: #3d3e42;
  color: #ccc;
}

/* ─── 카드 미리보기 ──────────────────────── */

.tpl-preview__cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tpl-preview__card-item {
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: var(--radius-md, 6px);
  overflow: hidden;
}

.tpl-preview__card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-module-bg, #f0f3f8);
  font-size: var(--fs-xs);
  font-weight: 600;
  margin: 0;
  border-bottom: 1px solid var(--admin-border, #e2e8f0);
}

.tpl-preview__card-render {
  padding: 16px;
  overflow: hidden;
}

.tpl-preview__card-render a {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* .split-panel__body 의 스크롤·flex 는 common.css 정의 사용 — webzine 측 override 제거됨 */

/* ─── 섹션 소제목 ───────────────────────── */

.tpl-section-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--color-text, #333);
}

/* ─── index.json 섹션 리스트 ────────────── */

.idx-section-list {
  padding: 4px 0;
}

.idx-section-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--admin-border, #e2e8f0);
  transition: background 0.15s;
}

.idx-section-item:hover {
  background: var(--color-table-hover, #dbeafe);
}

.idx-section-item.is-active {
  background: var(--color-primary, #000000);
  color: #fff;
}

.idx-section-item__order {
  font-size: var(--fs-code);
  font-weight: 600;
  color: var(--color-muted, #64748b);
  width: 20px;
  text-align: center;
}

.idx-section-item.is-active .idx-section-item__order {
  color: rgba(255, 255, 255, 0.7);
}

.idx-section-item__title {
  font-size: var(--fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── 카드 항목 목록 ────────────────────── */

.idx-items-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.idx-items-list {
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.idx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--admin-border, #e2e8f0);
  font-size: var(--fs-sm);
}

.idx-item:last-child {
  border-bottom: none;
}

.idx-item:hover {
  background: var(--color-table-hover, #dbeafe);
}

.idx-item.is-active {
  background: var(--color-primary-glow, rgba(0, 0, 0, 0.08));
}

.idx-item__order {
  flex: 0 0 20px;
  text-align: center;
  font-size: var(--fs-code);
  font-weight: 600;
  color: var(--color-muted);
}

.idx-item__thumb {
  width: 40px;
  height: 28px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.idx-item__thumb-empty {
  width: 40px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-module-bg, #f0f3f8);
  border-radius: 3px;
  color: var(--color-muted);
  font-size: var(--fs-xs);
  flex-shrink: 0;
}

.idx-item__title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* .transfer-layout*, .transfer-buttons, .transfer-item 은 common.css 로 이관.
 * 버튼 최소폭만 webzine 에서 유지. */
.transfer-buttons .btn { min-width: 44px; }

/* ─── 트리 체크박스 ─────────────────────── */

.tree__check-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.tree__checkbox {
  margin-right: 4px;
  flex-shrink: 0;
}

.tree__node.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ─── 외부 링크 행 ──────────────────────── */

.ext-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.ext-link-row .form__input {
  flex: 1;
}

.ext-link-row .form__select {
  flex: 0 0 100px;
}

/* ─── 플로팅 항목 카드 ─────────────────── */

.floating-item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  margin-bottom: 6px;
  background: var(--color-section-bg, #fff);
}

.floating-item-card__main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: var(--fs-sm);
}

.floating-item-card__label {
  font-weight: 600;
  white-space: nowrap;
}

.floating-item__detail {
  color: var(--color-muted, #64748b);
  font-size: var(--fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floating-item__detail i {
  margin-right: 4px;
}

/* ─── 화면 구성 좌우 분할 레이아웃 ────────
 * 공통 `.split-panel` 사용 (5:5 = `--50p` modifier). 모바일 stack 은 `--stack@sm`.
 * 좌측 첫 자식(미리보기 토글 래퍼 등) 자연 높이 유지. */
#wzScreenPreviewPanel.split-panel__right {
  /* 미리보기 패널은 자체 스크롤 불필요 — iframe 이 패널 전체 채움 */
  overflow: hidden;
}

#wzScreenPreviewFrame {
  width: 100%;
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}

/* 탭 컨테이너 — flex chain 통과. 자기 스크롤 금지 */
#wzScreenContent {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#wzScreenContent > .tabs {
  flex-shrink: 0;
}

/* 화면구성 탭 콘텐츠 — 내부 `.page-content` 로 flex chain 전파.
 * `.tab-content` 기본 `padding:16px 0` 제거(내부 `.split-panel` gap 이 여백 관리). */
#wzScreenContent > .tab-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* ─── 화면 구성 플로팅 항목 ─────────────── */

.screen-float__list {
  list-style: none;
  margin: 0 0 8px 0;
  padding: 0;
}

.screen-float__item {
  padding: 6px 0;
  font-size: var(--fs-sm);
  color: var(--color-text, #333);
}

.screen-float__item i {
  margin-right: 6px;
  color: var(--color-success, #16a34a);
}

.screen-float__custom-item {
  padding: 12px;
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  margin-bottom: 8px;
  background: var(--color-section-bg, #fff);
}

/* ─── 플로팅 추가 폼 ──────────────────── */

.floating-add-form {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed var(--admin-border, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  background: var(--color-module-bg, #f0f3f8);
}

/* ─── 서브탭 ───────────────────────────── */

.tabs.tabs--sub {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 16px;
}

.tabs__btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--color-muted, #64748b);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.tabs__btn:hover {
  color: var(--color-primary, #000000);
}

/* ─── 플로팅 코드 에디터 ─────────────────── */

.floating-editor {
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.floating-editor__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 8px;
}

.floating-editor__filename {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-text, #333);
}

.floating-editor__filename i {
  margin-right: 6px;
  color: var(--color-muted, #64748b);
}

.floating-editor__body {
  flex: 1;
  min-height: 360px;
}

/* ─── 사전정의 항목 드래그 & 드롭 ────────── */

.predefined-row__handle {
  width: 36px;
  text-align: center;
  color: var(--color-muted, #64748b);
  cursor: grab;
}

.predefined-row__handle:active {
  cursor: grabbing;
}

.predefined-row.is-dragging {
  opacity: 0.4;
}

.predefined-row.is-dragover {
  background: var(--color-primary-glow, rgba(0, 0, 0, 0.12));
}

/* ─── 배너 항목 ─────────────────────────── */

.banner-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  margin-bottom: 6px;
  background: var(--color-section-bg, #fff);
}

.banner-item__img {
  flex: 0 0 auto;
}

.banner-item__info {
  flex: 1;
  min-width: 0;
}

.banner-item__title {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.banner-item__sub {
  font-size: var(--fs-xs);
  color: var(--color-muted, #64748b);
  margin-top: 2px;
}

.banner-item__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.banner-form {
  padding: 12px;
  border: 1px dashed var(--admin-border, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  background: var(--color-module-bg, #f0f3f8);
}

/* ─── 캐러셀 항목 편집 ─────────────────── */

.carousel-item-edit {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  margin-bottom: 8px;
  background: var(--color-section-bg, #fff);
}

.carousel-item-edit__header {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.carousel-item-edit__num {
  font-size: var(--fs-code);
  font-weight: 600;
  color: var(--color-muted, #64748b);
}

.carousel-item-edit__fields {
  flex: 1;
  min-width: 0;
}

.carousel-item-edit__fields .form__group {
  margin-bottom: 8px;
}

/* ─── 슬라이드 선택 (이미지 캐러셀 섹션) ── */

.carousel-transfer {
  display: flex;
  gap: 8px;
  min-height: 180px;
}

.carousel-transfer__panel {
  flex: 1;
  border: 1px solid var(--admin-border, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.carousel-transfer__header {
  padding: 6px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--color-module-bg, #f0f3f8);
  border-bottom: 1px solid var(--admin-border, #e2e8f0);
}

.carousel-transfer__list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.carousel-transfer__buttons {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 0 2px;
}

.carousel-slide-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: var(--fs-xs);
}

.carousel-slide-item:hover {
  background: var(--color-table-hover, #dbeafe);
}

.carousel-slide-item__title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── 반응형 ─────────────────────────────── */

@media (max-width: 1024px) {
  /* 화면 구성: 모바일 stack 은 `.split-panel--stack@sm` 가 처리.
   * 우측 미리보기 패널은 stack 시 고정 높이 부여(자연 높이가 0 이 되어 iframe 사라지는 것 방지). */
  #wzScreenPreviewPanel.split-panel__right {
    height: 500px;
  }

  .split-panel {
    flex-direction: column;
  }

  .split-panel__left,
  .split-panel__left--narrow {
    flex: none;
    max-height: 300px;
  }

  /* 콘텐츠 에디터: 모바일에서 3열 → 세로 스택 */
  #wzEditorTree,
  #wzEditorPreview {
    flex: none;
    max-height: 250px;
  }

  .preview-layout {
    grid-template-columns: 1fr;
  }

  .deploy-layout {
    grid-template-columns: 1fr;
  }

  .tpl-code-layout {
    flex-direction: column;
  }

  .tpl-code-layout__guide {
    flex: none;
  }

  .card-editor__fields {
    flex-direction: column;
  }
}

/* ─── 메뉴 트리 (SortableTree) ───────────────── */
sortable-tree-node .tree__label {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}
sortable-tree-node .tree__label:hover {
  background-color: var(--color-table-hover, rgba(0, 0, 0, 0.06));
}
.banner-preview img {
  background: var(--color-bg);
}

/* ─── CodeMirror selection 강조 ─────────────── */
/* material-darker 테마의 selection이 너무 흐려서 더 선명한 색상으로 오버라이드 */
.CodeMirror-selected,
.CodeMirror-line::selection,
.CodeMirror-line > span::selection,
.CodeMirror-line > span > span::selection {
  background: rgba(255, 213, 79, 0.45) !important;
}
.CodeMirror-focused .CodeMirror-selected {
  background: rgba(255, 213, 79, 0.55) !important;
}
.CodeMirror-line::-moz-selection,
.CodeMirror-line > span::-moz-selection,
.CodeMirror-line > span > span::-moz-selection {
  background: rgba(255, 213, 79, 0.55) !important;
}

/* ─── 슬라이드 셀 (Tabulator formatter) ─── */
.slide-thumb {
  width: 60px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}
.slide-empty {
  color: var(--color-muted);
}

/* ─── 변수 자동완성 팝업 ──────────────────── */
.var-hint {
  position: fixed;
  z-index: 9999;
  min-width: 240px;
  max-width: 360px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  font-size: var(--fs-sm);
}
.var-hint__item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid var(--color-border);
}
.var-hint__item:last-child { border-bottom: none; }
.var-hint__item:hover,
.var-hint__item.is-active {
  background: var(--color-table-hover);
}
.var-hint__label {
  font-weight: 600;
  color: var(--color-text);
}
.var-hint__group {
  display: inline-block;
  align-self: flex-start;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--color-section-bg);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: var(--fs-badge);
  font-weight: 500;
}
.var-hint__key {
  font-size: var(--fs-code);
  color: var(--color-muted);
  font-family: monospace;
}

/* ─── 카드 스타일 라이브러리 ──────────────── */
.card-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card-style-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-style-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--color-table-th-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-style-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-style-card__placeholder {
  font-size: 32px;
  color: var(--color-muted);
}
.card-style-card__sys {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: var(--fs-badge);
  background: var(--color-card-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.card-style-card__body {
  padding: 12px;
  flex: 1;
}
.card-style-card__body h4 {
  margin: 0 0 4px;
  font-size: var(--fs-sm);
}
.card-style-card__meta {
  font-size: var(--fs-code);
  color: var(--color-muted);
  margin: 0 0 6px;
}
.card-style-card__desc {
  font-size: var(--fs-xs);
  color: var(--color-text);
  margin: 0;
  line-height: 1.4;
}
.card-style-card__actions {
  padding: 8px 12px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.card-style-card__svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ─── 기본 변수 카탈로그 (settings-var-defaults) ─── */
.vard-content {
  padding: 20px;
}
.vard-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}
.vard-toolbar .form__hint {
  margin: 0;
}
.vard-key {
  font-size: var(--fs-code);
  color: var(--color-muted);
}
.vard-default {
  font-family: monospace;
  font-size: var(--fs-code);
  color: var(--color-muted);
}
.vard-required {
  color: var(--color-primary);
}

/* .tree__type 제거 — 공통 .badge 클래스로 통합 (components.md §2-8) */

/* ─── 웹진 정보: 전역 헤더 (코드 표시 토글 + 안내) ─── */
.info-global-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--color-table-th-bg);
  border-radius: var(--radius-sm);
}
.info-global-hint {
  margin: 0;
  flex: 1;
}
.info-global-toggle {
  margin: 0;
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.info-code {
  font-size: var(--fs-code);
  color: var(--color-muted);
  margin-left: 4px;
}

/* ─── 웹진 정보: 기본 이미지 / 이미지 변수 ─── */
.info-base-img-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.info-base-img-thumb {
  width: 60px;
  height: 40px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.info-base-img-empty {
  display: inline-block;
  width: 60px;
  height: 40px;
  background: var(--color-border);
  border-radius: var(--radius-sm);
}
.info-base-img-name {
  font-size: var(--fs-xs);
  color: var(--color-muted);
}
.info-base-img-size {
  display: flex;
  gap: 8px;
  align-items: center;
}
.info-base-img-w,
.info-base-img-h {
  width: 100px;
}
.img-spacer {
  flex: 1;
}
.img-add-row {
  margin-top: 12px;
}

/* ─── 웹진 정보: 고급 설정 탭 (변수 통합) ─── */
.info-adv-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--color-table-th-bg);
  border-radius: var(--radius-sm);
}
.info-adv-toolbar .form__check {
  font-size: var(--fs-xs);
  margin: 0;
}
.info-adv-count {
  font-size: var(--fs-code);
  color: var(--color-muted);
  margin-left: 4px;
}
.info-adv-code {
  font-size: var(--fs-code);
  color: var(--color-muted);
  margin-left: 6px;
}
.info-adv-control {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.info-adv-field {
  flex: 1;
}
.info-adv-color {
  display: flex;
  gap: 8px;
  align-items: center;
}
.info-adv-color-picker {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.info-adv-dim {
  display: flex;
  gap: 6px;
  align-items: center;
}
.info-adv-dim-num {
  width: 100px;
}
.info-adv-dim-unit {
  width: 90px;
}
.info-adv-wrap > .accordion {
  margin-bottom: 0;
  border-radius: 0;
  border-bottom: none;
}
.info-adv-wrap > .accordion:first-child {
  border-radius: var(--radius-md, 6px) var(--radius-md, 6px) 0 0;
}
.info-adv-wrap > .accordion:last-child {
  border-radius: 0 0 var(--radius-md, 6px) var(--radius-md, 6px);
  border-bottom: 1px solid var(--color-border);
}
.info-adv-cm {
  width: 100%;
  min-height: 180px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* ─── 기타 링크 행 ───────────────────────── */

.other-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.other-link-row .other-link-label {
  flex: 0 0 140px;
}
.other-link-row .other-link-url {
  flex: 1;
}
.other-link-label-fixed {
  flex: 0 0 140px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  font-size: var(--fs-sm);
  color: var(--color-text);
  font-weight: 500;
}

/* ─── 기준 템플릿 카드 그리드 ───────────── */

.btpl-grid__inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.btpl-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}

.btpl-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border-color: var(--color-primary);
}

.btpl-card__preview {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--color-table-th-bg);
  overflow: hidden;
}

.btpl-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.btpl-card__preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--color-muted);
  opacity: 0.3;
}

.btpl-card__preview-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0,0,0,0.45);
  color: white;
  font-size: var(--fs-sm);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
  text-decoration: none;
}

.btpl-card:hover .btpl-card__preview-btn {
  opacity: 1;
}

.btpl-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.btpl-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.btpl-card__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.btpl-card__key {
  font-size: var(--fs-code);
  color: var(--color-muted);
  background: var(--color-table-th-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-top: 3px;
}

.btpl-card__desc {
  font-size: var(--fs-xs);
  color: var(--color-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btpl-card__meta {
  display: flex;
  gap: 12px;
  font-size: var(--fs-xs);
  color: var(--color-muted);
}

.btpl-card__meta i {
  margin-right: 4px;
}

.btpl-card__actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}

.btpl-card__actions .btn-primary {
  flex: 1;
}

/* 기준 템플릿 피커 (템플릿 없을 때 표시) */

.btpl-picker {
  padding: 16px;
}

.btpl-picker__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 4px;
}

.btpl-picker__desc {
  font-size: var(--fs-xs);
  color: var(--color-muted);
  margin: 0 0 12px;
}

.btpl-picker__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btpl-picker__item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.btpl-picker__item:hover {
  border-color: var(--color-primary);
  background: var(--color-table-hover);
}

.btpl-picker__item-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.btpl-picker__item-meta {
  font-size: var(--fs-code);
  color: var(--color-muted);
}

.btpl-picker__apply-btn {
  margin-top: 8px;
  width: 100%;
}

.btpl-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--color-section-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
}

.btpl-info__row {
  display: flex;
  gap: 8px;
}

.btpl-info__key {
  width: 48px;
  color: var(--color-muted);
  flex-shrink: 0;
}

.btpl-info__val {
  color: var(--color-text);
  word-break: break-all;
}
