:root {
  --brand: rgb(28, 71, 241);
  --brand-light: rgba(28, 71, 241, 0.08);
  --brand-lighter: rgba(28, 71, 241, 0.04);
  --text: #1a1c23;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f7f8fa;
  --card-bg: #ffffff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.sep { margin: 0 6px; color: var(--muted); }

.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.brand-logo { height: 40px; width: auto; display: block; object-fit: contain; }
.sidebar > .brand { justify-content: center; }
.sidebar-search { margin-bottom: 16px; position: relative; }
.sidebar-search input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px;
}
.sidebar-search input:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }

/* 검색 자동완성 드롭다운 */
.search-suggest {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  max-height: 60vh; overflow-y: auto; padding: 4px;
}
.suggest-item { display: block; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.suggest-item:hover, .suggest-item.is-active { background: var(--brand-light); }
.suggest-name { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.suggest-cat { display: block; font-size: 11px; color: var(--brand); margin-top: 1px; }
.suggest-snippet {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.45;
}
.suggest-empty { padding: 12px 10px; font-size: 13px; color: var(--muted); text-align: center; }
.suggest-all {
  display: block; width: 100%; margin-top: 4px; padding: 8px; border: none;
  border-top: 1px solid var(--border); background: none; cursor: pointer;
  font-size: 12.5px; color: var(--brand); font-family: inherit;
}
.suggest-all:hover { background: var(--brand-lighter); }

/* 검색 결과 페이지 */
.search-results { list-style: none; margin: 0; padding: 0; }
.search-result + .search-result { border-top: 1px solid var(--border); }
.search-result > a { display: block; padding: 14px 12px; border-radius: 8px; }
.search-result > a:hover { background: var(--brand-lighter); }
.search-result-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.search-result-head h3 { margin: 0; font-size: 15.5px; }
.search-result-cat {
  font-size: 11.5px; color: var(--brand); background: var(--brand-light);
  padding: 2px 7px; border-radius: 4px; flex: none;
}
.search-result-sub { margin: 3px 0 0; font-size: 13px; }
.search-result-snippet { margin: 5px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.search-empty { padding: 24px 0; }
.search-empty p { margin: 0 0 6px; }

mark { background: rgba(255, 213, 0, 0.45); color: inherit; padding: 0 1px; border-radius: 2px; }
/* 사이드바 카테고리 트리 (partials/tree-node.ejs) — 단계별 위계 */
.tree-root, .tree-children { list-style: none; margin: 0; padding-left: 0; }
.tree-node { margin: 1px 0; }
.tree-root > .tree-node + .tree-node { margin-top: 8px; }
.tree-link {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px;
  font-size: 13px; line-height: 1.4; color: #374151; word-break: keep-all;
}
/* 이름이 길면 한 줄로 자르고(…), 전체 이름은 마우스를 올렸을 때 말풍선으로 (public/app.js) */
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 카테고리 아이콘 (src/icons.js) — 트리·카드·관리 화면이 같은 모양을 씁니다 */
.cat-icon { flex-shrink: 0; width: 18px; height: 18px; }
.tree-icon { color: #9aa3b2; }
.tree-link:hover .tree-icon { color: var(--brand); }
.tree-link--d0 .tree-icon { color: var(--brand); }
.tree-link.is-active .tree-icon, .tree-link.is-ancestor .tree-icon { color: var(--brand); }
/* 잘린 이름을 마우스 오버(또는 키보드 포커스) 때 보여 주는 말풍선 */
.name-tip {
  position: fixed; z-index: 90; max-width: 300px; padding: 7px 11px; border-radius: 8px;
  background: #1f2937; color: #fff; font-size: 12.5px; line-height: 1.5; pointer-events: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25); word-break: keep-all;
}
/* 카테고리 카드: 아이콘을 제목 위(좌상단)에 크게 */
.cat-card-icon { display: block; width: 32px; height: 32px; stroke-width: 1.4; margin-bottom: 10px; color: var(--brand); }
.ct-icon { color: #9aa3b2; }
/* 하위까지 합한 제품 수 — 평소엔 숨기고 마우스를 올리거나 지금 보고 있는 항목에만 (터치 기기는 늘 옅게) */
.tree-count {
  flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums;
  opacity: 0; transition: opacity 0.12s ease;
}
.tree-link:hover .tree-count, .tree-link:focus-visible .tree-count, .tree-link.is-active .tree-count { opacity: 1; }
.tree-link.is-active .tree-count { color: var(--brand); }
@media (hover: none) { .tree-count { opacity: 0.55; } }
.tree-link:hover { background: var(--brand-lighter); color: var(--text); }
/* 0단계(최상위): 늘 옅은 배경을 깔아 묶음 제목처럼 */
.tree-link--d0 {
  padding: 9px 12px; font-size: 14px; font-weight: 700; color: #111827;
  background: rgba(28, 71, 241, 0.06);
}
.tree-link--d0:hover { background: rgba(28, 71, 241, 0.11); color: #111827; }
/* 1단계 */
.tree-link--d1 { font-size: 13.5px; font-weight: 600; color: #1f2937; }
/* 2단계 */
.tree-link--d2 { font-size: 13px; color: #374151; }
/* 3단계 이상 */
.tree-link--d3 { font-size: 12.5px; color: #6b7280; }
/* 하위 목록: 들여쓰기 + 세로 안내선 (단계가 깊을수록 옅게) */
.tree-children { margin-left: 12px; padding-left: 8px; }
.tree-children--d1 { margin-top: 4px; margin-bottom: 2px; border-left: 2px solid #e6eaf2; }
.tree-children--d2 { border-left: 1px solid #e9ecf1; }
.tree-children--d3 { border-left: 1px dashed #e5e7eb; }
/* 보고 있는 카테고리와 그 상위 경로 */
.tree-link.is-ancestor { color: var(--brand); }
.tree-link--d0.is-ancestor { background: rgba(28, 71, 241, 0.1); }
.tree-link.is-active {
  background: var(--brand-light); color: var(--brand); font-weight: 700;
}
.tree-link--d0.is-active { background: rgba(28, 71, 241, 0.14); }

/* Content */
.content { flex: 1; padding: 28px 36px; max-width: 1120px; }
.content-header h1 { margin: 0 0 6px; font-size: 24px; }
.content-header p { margin: 0 0 12px; }
.section-title { font-size: 16px; margin: 28px 0 12px; }

.stat-row { display: flex; gap: 12px; margin-top: 14px; }
.stat-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 20px; min-width: 120px;
}
.stat-card strong { display: block; font-size: 22px; color: var(--brand); }
.stat-card span { font-size: 12.5px; color: var(--muted); }

.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--brand); }

/* 카드 목록: 모바일 1열 → 태블릿 2열 → PC 3열 (2026-09-23 요청, 이전에는 폭에 따라 4~6열) */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 600px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1025px) { .card-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.cat-card, .article-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; display: block; position: relative;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
/* 마우스를 올리면 테두리가 포인트 색으로 서서히 바뀝니다 */
.cat-card:hover, .article-card:hover,
.cat-card:focus-visible, .article-card:focus-visible {
  border-color: var(--brand); box-shadow: 0 1px 3px rgba(28, 71, 241, 0.18); transform: translateY(-1px);
}
@media (prefers-reduced-motion: reduce) { .cat-card, .article-card { transition: border-color 0.18s ease; transform: none; } }
/* 제목과 건수를 한 줄에 두고, 제목이 길면 건수 앞에서 줄바꿈합니다 (영문 카테고리명 대비). */
.cat-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.cat-card-head h3 {
  margin: 0; font-size: 15px; line-height: 1.4; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cat-card p { margin: 0; font-size: 12.5px; }
.cat-card-count {
  flex: none; margin-top: 1px; white-space: nowrap; background: var(--brand-light); color: var(--brand);
  font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600;
}

.article-card { padding: 0; overflow: hidden; }
.article-thumb { width: 100%; aspect-ratio: 1 / 1; max-height: 300px; object-fit: cover; display: block; background: var(--brand-lighter); }
/* 대표 이미지가 없는 제품: 빈 칸 대신 옅은 자리표시 그림 (2026-09-23 요청 — 비어 있으면 오류처럼 보임) */
.article-thumb--empty {
  aspect-ratio: 1 / 1; max-height: 300px;
  background: #f5f7fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b9c2d6' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2.5'/%3E%3Cpath d='m5 16 4-4.2 3.2 3.2L15.5 12 19 15.5'/%3E%3Ccircle cx='9' cy='9.3' r='1.4'/%3E%3C/svg%3E") no-repeat center / 34% auto;
}
/* 제품 카드 건수(자료·포장재·요청): 카드 안 원본은 숨겨 두고, 마우스를 따라다니는 말풍선으로 띄웁니다
   (public/app.js 가 내용을 그대로 복사해 씁니다). 들어오면 살짝 떠오르고, 나가면 천천히 사라집니다. */
.card-stats { display: none; }
.card-stats-float {
  position: fixed; z-index: 85; display: flex; gap: 6px; padding: 6px 8px;
  border-radius: 999px; background: var(--brand); border: 1px solid var(--brand);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22); pointer-events: none;
  opacity: 0; transform: translateY(8px) scale(0.96); transform-origin: bottom left;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.card-stats-float.is-on { opacity: 1; transform: translateY(0) scale(1); transition-duration: 0.16s; }
/* 말풍선이 커서를 대신하므로, 카드 위에서는 마우스 포인터를 감춥니다 */
.article-card.is-stat-hover { cursor: none; }
.card-stat {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.card-stat.is-zero { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.6); font-weight: 400; }
@media (hover: none) { .card-stats-float { display: none; } }
@media (prefers-reduced-motion: reduce) { .card-stats-float { transition: opacity 0.2s linear; transform: none; } }
.article-card-body { padding: 12px 14px; }
.article-card-body h4 { margin: 0 0 4px; font-size: 14px; }
.article-card-body p { margin: 0; font-size: 12px; }
.clamp-2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Article detail */
.article-detail { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 28px 32px; }
.article-detail-header h1 { margin: 0 0 6px; font-size: 22px; }
.article-meta { font-size: 12.5px; }
.article-meta a { color: var(--brand); }
.article-body { margin-top: 20px; line-height: 1.7; font-size: 14.5px; }
.art-heading { margin: 24px 0 10px; color: var(--text); }
.art-text { margin: 6px 0; }
.art-spacer { margin: 4px 0; }
.art-list { margin: 8px 0; padding-left: 22px; }
.art-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.art-figure { margin: 14px 0; }
.art-figure figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.art-video { max-width: 100%; border-radius: 8px; }
.art-video-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 14px 0; }
.art-video-wrap .art-video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
.article-body--block video, .article-body--block iframe.art-video { max-width: 100%; }

/* 본문(레거시 art-figure 이미지 + 리치텍스트 에디터 이미지 공통) 폭 제한 + 확대보기 */
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  cursor: zoom-in;
}

.img-lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 12, 18, 0.85);
  display: flex; align-items: center; justify-content: center;
  padding: 32px; box-sizing: border-box;
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
}
.img-lightbox.is-open { opacity: 1; pointer-events: auto; }
.img-lightbox img {
  max-width: 100%; max-height: 100%; border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4); cursor: zoom-out;
}
.img-lightbox-close {
  position: absolute; top: 18px; right: 22px;
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.12); color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.img-lightbox-close:hover { background: rgba(255,255,255,0.22); }
.art-quote { border-left: 3px solid var(--brand); margin: 12px 0; padding: 4px 14px; color: var(--muted); }
.art-callout { background: var(--brand-lighter); border-radius: 8px; padding: 12px 14px; margin: 12px 0; }
.art-table-wrap { overflow-x: auto; margin: 14px 0; }
.art-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.art-table th, .art-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.art-table th { background: var(--brand-lighter); }
.art-link-card {
  display: flex; gap: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 10px;
  margin: 12px 0; align-items: center;
}
.art-link-card-img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.art-link-card-body { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.art-link-card-desc { color: var(--muted); font-size: 12px; }

/* 리치텍스트(CMS) 에디터로 작성/수정한 본문은 art-* 클래스 없이 순수 태그(h2,blockquote,table,ul,a 등)로 저장됨.
   레거시 콘텐츠와 시각적으로 동일하게 보이도록 .article-body 안의 일반 태그에도 같은 스타일을 적용. */
.article-body h1, .article-body h2, .article-body h3, .article-body h4 { margin: 24px 0 10px; color: var(--text); }
.article-body p { margin: 6px 0; }
.article-body ul, .article-body ol { margin: 8px 0; padding-left: 22px; }
.article-body blockquote { border-left: 3px solid var(--brand); margin: 12px 0; padding: 4px 14px; color: var(--muted); }
.article-body a { color: var(--brand); }
.article-body table { border-collapse: collapse; width: 100%; font-size: 13.5px; margin: 14px 0; }
.article-body table th, .article-body table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.article-body table th { background: var(--brand-lighter); }
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.article-body pre { background: var(--brand-lighter); border-radius: 8px; padding: 12px 14px; margin: 12px 0; overflow-x: auto; font-size: 13px; }
.article-body code { font-family: ui-monospace, monospace; font-size: 0.92em; }
.article-body pre code { background: none; padding: 0; }
.article-body video, .article-body audio { max-width: 100%; border-radius: 8px; }
.article-body li[data-checked] { list-style: none; margin-left: -22px; padding-left: 22px; }
.article-body input[type='checkbox'] { margin-right: 6px; }

/* BlockNote 에디터에서 작성한 글: 편집 화면과 발행 화면의 글자 크기를 맞춤 */
.article-body--block h1 { font-size: 48px; font-weight: 700; line-height: 1.5; margin: 32px 0 8px; }
.article-body--block h2 { font-size: 32px; font-weight: 700; line-height: 1.5; margin: 28px 0 8px; }
.article-body--block h3, .article-body--block h4 { font-size: 24px; font-weight: 700; line-height: 1.5; margin: 22px 0 6px; }
.article-body--block p, .article-body--block li { font-size: 16px; line-height: 1.5; }
.article-body--block table, .article-body--block th, .article-body--block td { font-size: 16px; }

.sibling-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sibling-list li a {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 12.5px; background: var(--card-bg);
}
.sibling-list li a.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }

.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }
.sidebar-close-btn { display: none; }
.brand--mobile { margin: 0; flex: 1; justify-content: center; }

@media (max-width: 1024px) {
  .mobile-topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; background: var(--card-bg); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
  }
  .mobile-menu-btn {
    border: 1px solid var(--border); background: var(--card-bg); border-radius: 8px;
    width: 36px; height: 36px; min-width: 36px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text); padding: 0;
  }
  .mobile-menu-btn:hover { background: var(--brand-lighter); }

  .brand-logo { height: 30px; }

  .layout { flex-direction: column; }

  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 280px; max-width: 82vw;
    transform: translateX(-100%); transition: transform 0.25s ease;
    z-index: 40; box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  }
  .sidebar-close-btn {
    display: block; position: absolute; top: 14px; right: 14px;
    width: 30px; height: 30px; border: none; background: transparent; font-size: 22px;
    line-height: 1; color: var(--muted); cursor: pointer;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }

  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(15, 18, 25, 0.4);
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 35;
  }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

  body.sidebar-open { overflow: hidden; }

  .content { padding: 16px; }
}

/* ---------- 계정·앱 메뉴 (partials/account-menu.ejs, 2026-09-22) ---------- */
.acct-bar { display: flex; align-items: center; gap: 6px; }
.acct-bar--side { margin: -6px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.acct-bar--top { margin-left: auto; }
.acct-menu { position: relative; }
.acct-menu--account { flex: 1; min-width: 0; }
.acct-bar--top .acct-menu--account { flex: none; order: 2; }

.acct-avatar-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; padding: 4px 6px 4px 4px;
  border: 1px solid transparent; border-radius: 999px; background: none; cursor: pointer; font: inherit; color: var(--text); text-align: left;
}
.acct-avatar-btn:hover, .acct-avatar-btn[aria-expanded="true"] { background: var(--brand-lighter); border-color: var(--border); }
.acct-bar--top .acct-avatar-btn { width: auto; padding: 2px; }
.acct-avatar {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; font-size: 14px; font-weight: 700; color: #fff; background: #64748b;
}
.acct-avatar--admin { background: var(--brand); }
.acct-avatar--editor { background: #059669; }
.acct-avatar--lg { width: 48px; height: 48px; font-size: 20px; }
.acct-who { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-size: 13px; }
.acct-who-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-caret { flex-shrink: 0; color: var(--muted); }
.acct-who .account-role, .acct-profile .account-role { flex-shrink: 0; white-space: nowrap; }

.acct-icon-btn {
  position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 38px; height: 38px; border: 1px solid transparent; border-radius: 50%; background: none; cursor: pointer; color: #4b5563; padding: 0;
}
.acct-icon-btn:hover, .acct-icon-btn[aria-expanded="true"] { background: var(--brand-lighter); color: var(--brand); border-color: var(--border); }
.acct-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px var(--card-bg); }

.acct-panel {
  position: absolute; top: calc(100% + 8px); z-index: 60; width: 300px; max-height: calc(100vh - 120px); overflow-y: auto;
  padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--card-bg);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}
.acct-panel[hidden] { display: none; }
/* 사이드바 안: 두 메뉴 모두 사이드바 폭 전체로 펼칩니다 */
.acct-bar--side { position: relative; }
.acct-bar--side .acct-menu { position: static; }
.acct-bar--side .acct-panel { left: 0; right: 0; width: auto; top: calc(100% - 4px); }
/* 모바일 상단 바: 화면 오른쪽 기준 */
.acct-bar--top .acct-panel { position: fixed; top: 60px; right: 8px; width: min(320px, calc(100vw - 16px)); }

.acct-section-title { margin: 6px 4px 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.acct-section-title:first-child { margin-top: 0; }
.acct-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 8px; }
.acct-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px;
  border-radius: 12px; text-align: center; color: var(--text);
}
.acct-tile:hover, .acct-tile:focus-visible { background: #f1f5f9; outline: none; }
.acct-tile-icon { position: relative; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; }
.acct-tile-badge { position: absolute; top: -6px; right: -8px; }
.acct-tile-label { font-size: 12px; line-height: 1.3; word-break: keep-all; }
.acct-tile--blue .acct-tile-icon { background: rgba(28, 71, 241, 0.1); color: var(--brand); }
.acct-tile--green .acct-tile-icon { background: rgba(5, 150, 105, 0.12); color: #047857; }
.acct-tile--amber .acct-tile-icon { background: rgba(217, 119, 6, 0.12); color: #b45309; }
.acct-tile--violet .acct-tile-icon { background: rgba(124, 58, 237, 0.1); color: #6d28d9; }
.acct-tile--rose .acct-tile-icon { background: rgba(225, 29, 72, 0.1); color: #be123c; }
.acct-tile--slate .acct-tile-icon { background: #eef1f6; color: #334155; }

.acct-profile { display: flex; align-items: center; gap: 12px; padding: 6px 6px 12px; border-bottom: 1px solid var(--border); }
.acct-profile-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; font-size: 13px; }
.acct-profile-text .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.acct-actions { display: flex; flex-direction: column; padding-top: 6px; }
.acct-logout-form { margin: 0; }
.acct-action {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border-radius: 8px;
  font: inherit; font-size: 13.5px; color: var(--text); background: none; border: 0; cursor: pointer; text-align: left;
}
.acct-action:hover, .acct-action:focus-visible { background: #f1f5f9; outline: none; }
.acct-action svg { color: #64748b; }

@media (max-width: 1024px) {
  .acct-bar--side { display: none; }
  .brand--mobile { flex: 1; }
}

/* ---------- CMS: 편집/이력 ---------- */
.admin-actions { display: flex; gap: 10px; margin-top: 10px; }
.btn-edit, .btn-history {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text);
  text-decoration: none;
}
.btn-edit:hover, .btn-history:hover { background: var(--brand-lighter); border-color: var(--brand); }

.page-title { font-size: 22px; margin: 4px 0 18px; }

.edit-form { max-width: 820px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 16px 0 6px; }
.field-label:first-child { margin-top: 0; }
.field-input {
  width: 100%; box-sizing: border-box; padding: 9px 12px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); color: var(--text);
}

.thumbnail-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.thumbnail-chip {
  width: 64px; height: 64px; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 2px solid var(--border); background: var(--card-bg); display: flex; align-items: center; justify-content: center;
}
.thumbnail-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbnail-chip.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-lighter); }
.thumbnail-chip--none { font-size: 12px; color: var(--muted); border-style: dashed; }
.thumbnail-chip--none.is-selected { border-style: solid; }
.editor-toolbar-extra { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.editor-hint { font-size: 12px; color: var(--muted); }
#editor-container { background: var(--card-bg); min-height: 320px; }
.edit-actions {
  display: flex; gap: 10px; margin-top: 18px;
  position: sticky; bottom: 0; z-index: 5;
  background: var(--bg); padding: 14px 0; border-top: 1px solid var(--border);
}
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { opacity: 0.92; }
.btn-secondary { background: var(--card-bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--brand-lighter); }

.history-current {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted);
  background: var(--brand-lighter); border-radius: 8px; padding: 8px 14px; margin-bottom: 16px;
}
.history-badge { background: var(--brand); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.history-list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.history-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--card-bg);
}

.users-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: 13.5px; }
.users-table th, .users-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.users-table th { color: var(--muted); font-weight: 600; }

.back-home { display: inline-block; margin-top: 8px; font-size: 13.5px; color: var(--brand); text-decoration: none; }
.back-home:hover { text-decoration: underline; }

.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg, #f4f6fb); padding: 24px; box-sizing: border-box;
}
.auth-card {
  width: 100%; max-width: 360px; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 32px 28px; text-align: center;
}
.auth-logo { height: 36px; margin-bottom: 14px; }
.auth-card h1 { font-size: 18px; margin: 0 0 18px; }
.auth-card form { text-align: left; }
.auth-card .btn-primary { width: 100%; margin-top: 18px; }
.auth-error { color: #d1435b; font-size: 13px; margin-bottom: 10px; }

/* ---------- 아티클 목차(TOC) + 본문 내 검색 ---------- */

.article-layout { display: flex; align-items: flex-start; gap: 32px; }
/* min-width: 0 이 없으면 표나 긴 코드가 들어왔을 때 본문이 목차를 밀어냅니다. */
.article-main { flex: 1; min-width: 0; }

.article-toc {
  width: 250px; flex: none; position: sticky; top: 20px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  font-size: 12.5px; padding-left: 18px; border-left: 1px solid var(--border);
}

/* 목차에서 제목으로 이동했을 때 제목이 화면 맨 위에 딱 붙지 않도록 여유를 둡니다. */
.article-body :is(h1, h2, h3) { scroll-margin-top: 24px; }

.toc-title {
  margin: 0 0 8px; font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.toc-nav ul { list-style: none; margin: 0; padding: 0; }
.toc-item a {
  display: block; padding: 4px 8px; border-radius: 6px; color: var(--muted);
  line-height: 1.45; word-break: keep-all;
}
.toc-item a:hover { background: var(--brand-lighter); color: var(--text); }
.toc-item.is-active > a { color: var(--brand); font-weight: 700; background: var(--brand-light); }
.toc-level-1 > a { padding-left: 8px; }
.toc-level-2 > a { padding-left: 20px; }
.toc-level-3 > a { padding-left: 32px; font-size: 12px; }

/* 본문 내 검색 */
.toc-find { margin-bottom: 16px; }
.toc-find input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 12.5px; font-family: inherit;
}
.toc-find input:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.toc-find-bar { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.toc-find-count { flex: 1; font-size: 11.5px; color: var(--muted); }
.toc-find-btn {
  width: 24px; height: 24px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); cursor: pointer; color: var(--muted); font-size: 12px; line-height: 1;
}
.toc-find-btn:hover:not(:disabled) { color: var(--brand); border-color: var(--brand); }
.toc-find-btn:disabled { opacity: 0.4; cursor: default; }

/* 본문에서 찾은 부분 — 현재 위치는 더 진하게 */
.article-body mark.find-hit { background: rgba(255, 213, 0, 0.45); padding: 0 1px; border-radius: 2px; }
.article-body mark.find-hit.is-current { background: rgb(255, 168, 0); color: #1a1c23; }

/* 화면이 좁으면 목차를 본문 위로 접어 올립니다.
   HTML에서는 본문이 먼저 오기 때문에, order로 순서를 뒤집지 않으면
   긴 글 맨 아래에 목차가 떨어져서 쓸모가 없어집니다. */
@media (max-width: 1100px) {
  .article-layout { flex-direction: column; }
  .article-toc {
    order: -1;
    width: auto; align-self: stretch; position: static; max-height: none;
    border-left: none; padding-left: 0;
    border-bottom: 1px solid var(--border); padding-bottom: 16px;
  }
  .toc-nav ul { max-height: 200px; overflow-y: auto; }
}

/* ---------- 국내/해외 구분 ---------- */

.market-tabs {
  display: flex; margin: 0 0 12px; padding: 3px; gap: 3px;
  background: var(--brand-lighter); border: 1px solid var(--brand-light); border-radius: 10px;
}
.market-tab {
  position: relative;
  flex: 1; display: block; padding: 8px 0; border: 0; border-radius: 7px; background: none; cursor: pointer;
  text-align: center; text-decoration: none;
  font: inherit; font-size: 13.5px; font-weight: 600; color: rgba(28, 71, 241, 0.55);
}
.home-market-label { margin-left: 10px; font-size: 13px; padding: 3px 10px; vertical-align: 4px; }
.home-group-title a.market-badge:hover { text-decoration: underline; }
.market-tab:hover:not(.is-active) { color: var(--brand); background: rgba(28, 71, 241, 0.06); }
.market-tab.is-active { background: var(--brand); color: #fff; box-shadow: 0 1px 3px rgba(28, 71, 241, 0.25); }
.market-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* 탭 오른쪽 위 건수 — 아이폰 앱 아이콘 배지처럼. 평평하게 두고 그림자는 아주 얕게만.
   고른(활성) 탭에만 보여 줍니다 — 화면 낭독기용 숨은 텍스트(.visually-hidden)는 양쪽 다 그대로 둡니다. */
.market-tab-count {
  display: none;
  position: absolute; top: -7px; right: -5px;
  min-width: 19px; height: 19px; padding: 0 6px; border-radius: 999px;
  background: #00c2ff; color: #fff;
  font-size: 10.5px; font-weight: 300; line-height: 19px; text-align: center; font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}
.market-tab.is-active .market-tab-count { display: block; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.tree-empty { margin: 8px; font-size: 13px; color: var(--muted); }

.market-badge {
  display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 4px;
  font-size: 10.5px; font-weight: 700; line-height: 1.5; vertical-align: 2px;
  background: rgba(28, 71, 241, 0.1); color: var(--brand);
}
.market-badge--overseas { background: rgba(5, 150, 105, 0.12); color: #047857; }

.breadcrumb-market { color: var(--text); font-weight: 600; }

.home-group + .home-group { margin-top: 20px; }
.home-group-title { display: flex; align-items: center; gap: 4px; margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.home-group-title .market-badge { font-size: 12px; padding: 2px 8px; }

.search-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.search-filter a {
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card-bg); color: var(--muted); font-size: 12.5px;
}
.search-filter a:hover { color: var(--brand); border-color: var(--brand-light); }
.search-filter a.is-active { border-color: var(--brand); background: var(--brand-light); color: var(--brand); font-weight: 600; }
.search-filter-count { margin-left: 2px; font-size: 11.5px; opacity: 0.8; }
.suggest-cat .market-badge { margin-right: 5px; vertical-align: 1px; }

/* ---------- 통합 메인 (구글식 검색 중심) ---------- */

/* 홈 화면은 PC에서 콘텐츠 상자를 사이드바 오른쪽 남은 영역의 가운데에 둡니다.
   .content 의 flex:1 을 그대로 두고 margin:auto 만 주면 자동 여백이 남는 공간을 먼저 가져가
   상자가 내용 폭으로 쪼그라들기 때문에, 기준 폭 1120px에서 줄어들 수만 있게 바꿉니다.
   1024px 이하에서는 .layout 이 세로 방향이 되어 1120px가 높이 기준으로 바뀌므로 PC 폭에서만 적용합니다. */
@media (min-width: 1025px) {
  .content--center { flex: 0 1 1120px; min-width: 0; margin-inline: auto; }
}

.home-hero {
  min-height: 56vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 0 12px;
}
.home-hero-title { margin: 0 0 8px; font-size: 42px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.home-hero-title span { color: var(--brand); }
/* 시장 홈: 아래에 카테고리·최근 업데이트가 이어지므로 높이를 낮춘 모양 */
.home-hero--compact { min-height: auto; padding: 4px 0 26px; }
.home-hero--compact .home-hero-title { font-size: 34px; }
.home-hero-sub { margin: 0 0 26px; font-size: 14.5px; }
/* 시스템 설명 — 검색창 위에 작게 */
.home-hero-note { margin: 18px 0 0; max-width: 680px; font-size: 12.5px; line-height: 1.6; color: var(--brand); }
.home-hero--compact .home-hero-sub { margin-bottom: 18px; }

.home-search { position: relative; width: 100%; max-width: 640px; }
.home-search-icon { position: absolute; left: 20px; top: 27px; transform: translateY(-50%); color: #9aa0a6; pointer-events: none; }
.home-search input {
  width: 100%; height: 54px; padding: 0 24px 0 54px;
  border: 1px solid #dfe1e5; border-radius: 27px; background: var(--card-bg);
  font: inherit; font-size: 16px; color: var(--text);
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.06); transition: box-shadow 0.15s, border-color 0.15s;
}
.home-search input::placeholder { color: #9aa0a6; }
.home-search input:hover { box-shadow: 0 1px 8px rgba(32, 33, 36, 0.16); border-color: rgba(223, 225, 229, 0); }
.home-search input:focus { outline: none; box-shadow: 0 1px 10px rgba(28, 71, 241, 0.22); border-color: rgba(28, 71, 241, 0.35); }
/* 큰 검색창의 자동완성은 글자를 조금 키우고 왼쪽 정렬로 */
.home-search .search-suggest { top: calc(100% + 8px); text-align: left; border-radius: 16px; padding: 6px; max-height: 64vh; }
.home-search .suggest-item { padding: 10px 14px; border-radius: 10px; }
.home-search .suggest-name { font-size: 14.5px; }
.home-search .suggest-snippet { font-size: 12.5px; }
.home-search .suggest-all { font-size: 13px; padding: 10px; }

.home-counts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.home-count {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card-bg);
  font-size: 13px; color: var(--muted); transition: border-color 0.15s, color 0.15s;
}
.home-count strong { color: var(--text); font-size: 16px; }
.home-count .market-badge { margin-right: 0; vertical-align: 0; }
.home-count:hover { border-color: var(--brand); color: var(--brand); }
.home-hint { margin: 18px 0 0; font-size: 12px; }
.home-hint kbd {
  display: inline-block; min-width: 18px; padding: 1px 5px; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 4px; background: var(--card-bg); font-family: inherit; font-size: 11px; color: var(--text);
}

.home-recent { max-width: 640px; margin: 12px auto 24px; }
.home-recent-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.home-recent-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--card-bg); overflow: hidden; }
.home-recent-list li + li { border-top: 1px solid var(--border); }
.home-recent-list a { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 13.5px; }
.home-recent-list a:hover { background: var(--brand-lighter); }
.home-recent-list .market-badge { margin-right: 0; flex: none; }
.home-recent-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-recent-date { flex: none; font-size: 12px; color: var(--muted); }
/* 최근 업데이트 구분 표시: 제품 정보 / 마케팅 자료 / 포장재 */
.recent-kind { flex: none; display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.6; background: #eef1f6; color: #4b5563; }
.recent-kind--material { background: #fff4e5; color: #b45309; }
.recent-kind--packaging { background: #eaf7ef; color: #1b7a43; }
.article-card-body .recent-kind { margin-bottom: 4px; }
.home-recent-detail { color: var(--muted); }
.home-recent-detail b { font-weight: 600; color: var(--text); }

@media (max-width: 1024px) {
  .home-hero { min-height: auto; padding-top: 28px; }
  .home-hero-title { font-size: 32px; }
  .home-search input { height: 50px; font-size: 15px; border-radius: 25px; }
  .home-search-icon { top: 25px; }
  .home-hint { display: none; }
}

/* ---------- 목록 섬네일 (검색 결과·자동완성) · NEW 표시 ---------- */

/* 제품 사진은 흰 배경 누끼가 많아 잘리지 않게 contain + 흰 바탕으로 둡니다. */
.suggest-item { display: flex; align-items: flex-start; gap: 10px; }
.suggest-thumb {
  flex: none; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border);
  object-fit: contain; background: #fff;
}
.suggest-thumb--empty { display: block; background: linear-gradient(135deg, var(--brand-lighter), var(--brand-light)); }
.suggest-text { flex: 1; min-width: 0; }
.home-search .suggest-thumb { width: 48px; height: 48px; border-radius: 10px; }

.search-result > a { display: flex; align-items: flex-start; gap: 14px; }
.search-result-thumb {
  flex: none; width: 64px; height: 64px; border-radius: 10px; border: 1px solid var(--border);
  object-fit: contain; background: #fff;
}
.search-result-thumb--empty { display: block; background: linear-gradient(135deg, var(--brand-lighter), var(--brand-light)); }
.search-result-body { flex: 1; min-width: 0; }

.new-badge {
  display: inline-block; flex: none; margin-left: 6px; padding: 1px 6px; border-radius: 4px;
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; line-height: 1.5;
  vertical-align: 2px;
}
.article-card-body h4 .new-badge { margin: 0 6px 0 0; }

@media (max-width: 480px) {
  .search-result-thumb { width: 52px; height: 52px; }
}

/* ---------- 로그인·계정 ---------- */

.auth-sub { margin: -10px 0 18px; font-size: 13px; color: var(--muted); }

.account-role {
  display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 4px;
  font-size: 10.5px; font-weight: 700; background: #eef1f6; color: #4b5563; vertical-align: 1px;
}
.account-role--admin { background: rgba(28, 71, 241, 0.1); color: var(--brand); }
.account-role--editor { background: rgba(5, 150, 105, 0.12); color: #047857; }

.notice-ok {
  padding: 10px 14px; border-radius: 8px; font-size: 13.5px;
  background: rgba(5, 150, 105, 0.1); color: #047857;
}
.users-help { font-size: 12.5px; line-height: 1.6; margin: 0 0 14px; }
.users-table-wrap { overflow-x: auto; }
.users-table td { vertical-align: middle; }
.users-table tr.is-disabled td { color: var(--muted); }
.users-row-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.field-input--small { width: auto; min-width: 0; padding: 5px 8px; font-size: 12.5px; }
.users-row-form input[type="text"].field-input--small { width: 110px; }
.users-row-form input[type="password"].field-input--small { width: 170px; }
.btn-small { padding: 5px 10px; font-size: 12.5px; }
.users-tag {
  display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px;
  font-size: 10.5px; background: #eef1f6; color: #4b5563;
}
.users-tag--ok { background: rgba(5, 150, 105, 0.12); color: #047857; }
.users-tag--no { background: rgba(209, 67, 91, 0.1); color: #b4233c; }

/* ---------- 파일 저장소 ---------- */

.files-usage {
  display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 8px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--card-bg);
}
.upload-progress { width: 220px; max-width: 100%; height: 10px; }
.upload-status { font-size: 12.5px; }
.files-preview { margin-left: 6px; font-size: 12px; }
.edit-actions .upload-progress, .edit-actions .upload-status { align-self: center; }

/* ---------- 마케팅 자료 ---------- */

/* 제품 정보 | 마케팅 자료 | 포장재 탭 — 사이드바 국내/해외 탭(.market-tabs)과 같은 모양 */
.product-tabs {
  display: flex; flex-wrap: wrap; gap: 3px; width: 100%; max-width: 720px; margin: 22px 0 0; padding: 3px;
  background: var(--brand-lighter); border: 1px solid var(--brand-light); border-radius: 10px;
}
.product-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px;
  border-radius: 7px; text-align: center; text-decoration: none;
  font-size: 14px; font-weight: 600; color: rgba(28, 71, 241, 0.55);
}
.product-tab:hover:not(.is-active) { color: var(--brand); background: rgba(28, 71, 241, 0.06); }
.product-tab.is-active { background: var(--brand); color: #fff; box-shadow: 0 1px 3px rgba(28, 71, 241, 0.25); }
.product-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.product-tab-count {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 9px;
  font-size: 11px; line-height: 18px; text-align: center; background: rgba(28, 71, 241, 0.1); color: var(--brand);
}
.product-tab.is-active .product-tab-count { background: rgba(255, 255, 255, 0.25); color: #fff; }

.materials-tab { margin-top: 20px; }

/* 유형 필터 (칩) */
.material-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.material-chip {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; color: var(--text);
}
.material-chip span { color: var(--muted); margin-left: 2px; }
.material-chip:hover { border-color: var(--brand); }
.material-chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.material-chip.is-active span { color: rgba(255, 255, 255, 0.85); }

/* 유형별 색 (자료 카드 배경·구역 제목 공통)
   선택자를 두 번 겹쳐 쓴 이유: 아래 .material-card 의 기본 --accent 보다 우선하게 */
.material-card.material-card--intro, .material-section--intro { --accent: rgb(28, 71, 241); --accent-bg: rgba(28, 71, 241, 0.08); }
.material-card.material-card--license, .material-section--license { --accent: rgb(5, 150, 105); --accent-bg: rgba(5, 150, 105, 0.1); }
.material-card.material-card--design, .material-section--design { --accent: rgb(124, 58, 237); --accent-bg: rgba(124, 58, 237, 0.09); }
.material-card.material-card--sales, .material-section--sales { --accent: rgb(234, 88, 12); --accent-bg: rgba(234, 88, 12, 0.09); }
.material-card.material-card--packaging, .material-section--packaging { --accent: rgb(14, 116, 144); --accent-bg: rgba(14, 116, 144, 0.1); }

/* 유형별 구역과 자료 카드 */
.material-section { margin: 0 0 22px; }
.material-section-title { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 14.5px; }
.material-section-count {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 9px; font-size: 11px; line-height: 18px;
  text-align: center; font-weight: 700; background: var(--accent-bg, #eef1f6); color: var(--accent, #4b5563);
}
.material-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }

/* 자료 카드: 평소에는 유형 색 배경에 아이콘·유형·제목·날짜만 */
.material-card {
  --accent: var(--brand); --accent-bg: var(--brand-light);
  position: relative; min-width: 0;
  background: var(--accent-bg); border: 1px solid transparent; border-radius: 12px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.material-card-main { display: flex; align-items: center; gap: 12px; padding: 14px; }
.material-card-icon {
  flex: none; display: flex; align-items: center; justify-content: center; width: 42px; height: 42px;
  border-radius: 11px; background: #fff; font-size: 21px; box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08);
}
.material-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.material-card-type { font-size: 11px; font-weight: 700; color: var(--accent); }
.material-card .material-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.material-card-date { font-size: 11.5px; color: var(--muted); }
.material-card.is-expired .material-title { color: var(--muted); }

/* 마우스를 올리거나 카드 안에 키보드 포커스가 있으면 상세가 카드 아래로 펼쳐집니다 (옆 카드 배치는 그대로) */
.material-card-more {
  display: none; flex-direction: column; gap: 7px;
  position: absolute; left: -1px; right: -1px; top: 100%; z-index: 20; margin-top: -1px;
  padding: 4px 14px 14px; background: #fff;
  border: 1px solid var(--accent); border-top: 0; border-radius: 0 0 12px 12px;
  box-shadow: 0 14px 24px rgba(17, 24, 39, 0.14);
}
.material-card:hover, .material-card:focus-within {
  z-index: 21; background: #fff; border-color: var(--accent); border-radius: 12px 12px 0 0;
  box-shadow: 0 -2px 12px rgba(17, 24, 39, 0.06);
}
.material-card:hover .material-card-more, .material-card:focus-within .material-card-more { display: flex; }
.material-card:hover .material-card-icon, .material-card:focus-within .material-card-icon { background: var(--accent-bg); box-shadow: none; }
/* 마우스가 없는 기기(휴대폰 등): 펼침 대신 카드 안에 받기·상세 버튼만 보여 줍니다 */
@media (hover: none) {
  .material-card-more {
    display: flex; position: static; margin: 0; padding: 0 14px 12px;
    background: none; border: 0; box-shadow: none;
  }
  .material-card-more > :not(.material-card-foot) { display: none; }
  .material-card:hover, .material-card:focus-within { background: var(--accent-bg); border-color: transparent; border-radius: 12px; box-shadow: none; }
  .material-card .material-card-foot { border-top-color: rgba(17, 24, 39, 0.08); }
}

.material-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--border); }
.material-file-badge {
  padding: 2px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
  background: var(--accent-bg, #eef1f6); color: var(--accent);
}
.material-file-badge--link { background: #eef1f6; color: #4b5563; }
.material-version-chip { font-size: 11px; font-weight: 700; color: var(--muted); }
.material-title { font-weight: 700; font-size: 14px; line-height: 1.4; color: var(--text); word-break: break-word; }
.material-title:hover { color: var(--accent, var(--brand)); }
.material-card .material-badges { margin: 0; }
.material-card-desc {
  margin: 0; font-size: 12.5px; line-height: 1.5; color: #4b5563; white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.material-card-file { margin: 0; font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.material-card-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--border);
}
.material-card-meta { font-size: 11.5px; }
.material-detail-link { font-size: 12px; color: var(--muted); white-space: nowrap; }
.material-detail-link:hover { color: var(--brand); }
.material-empty {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; margin: 0 0 18px;
  border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); font-size: 13px; text-align: center;
}
.material-empty span { font-size: 26px; }
.material-empty p { margin: 0; }

/* 자료 이력 아코디언 (기본 닫힘, 최신이 위) */
.material-history { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); }
.material-history > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 11px 14px; cursor: pointer; list-style: none;
}
.material-history > summary::-webkit-details-marker { display: none; }
.material-history > summary::before {
  content: '▸'; color: var(--muted); font-size: 12px; transition: transform 0.15s; display: inline-block;
}
.material-history[open] > summary::before { transform: rotate(90deg); }
.material-history > summary:hover { background: var(--brand-lighter); border-radius: 10px; }
.material-history-title { font-weight: 700; font-size: 13.5px; }
.material-history-latest { font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 200px; }
.material-history .material-events { padding: 0 14px 8px; }
.material-history-more { margin: 0; padding: 0 14px 12px; font-size: 12px; }

.material-new { margin: 0 0 16px; border: 1px dashed var(--border); border-radius: 10px; padding: 10px 14px; }
.material-new > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--brand); }
.material-new[open] > summary { margin-bottom: 10px; }
.material-new textarea.field-input { resize: vertical; font-family: inherit; }
/* 요청하기·자료업로드·포장정보 등록하기 — 세 탭의 "새로 만들기" 여닫이를 버튼 모양으로 (2026-09-22 요청) */
.material-new > summary.material-new-btn {
  display: inline-flex; align-items: center; justify-content: center; list-style: none;
  padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600;
  background: var(--brand); color: #fff; cursor: pointer;
}
.material-new > summary.material-new-btn::-webkit-details-marker { display: none; }
.material-new > summary.material-new-btn:hover { opacity: 0.92; }
.material-new[open] > summary.material-new-btn { margin-bottom: 10px; }
.material-form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin-top: 14px; font-size: 13px; }
.material-check { display: inline-flex; align-items: center; gap: 6px; }
.material-date { display: inline-flex; align-items: center; gap: 6px; }
.material-help { font-size: 12px; margin: 6px 0 0; line-height: 1.6; }

/* 마케팅 자료 외부 공유 링크 목록 (2026-09-22 요청) */
.share-list { list-style: none; margin: 8px 0 0; padding: 0; }
.share-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px;
}
.share-item:last-child { border-bottom: 0; }
.share-item.is-inactive { color: var(--muted); }
.share-link-input { flex: 1 1 260px; min-width: 0; font-size: 12.5px; color: var(--brand); cursor: text; }
.share-item-meta { flex: 1 1 auto; }
.material-share-form { margin-top: 10px; }

.material-badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 0; }
.material-badge {
  display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11px; background: #eef1f6; color: #4b5563;
}
.material-badge--type { background: rgba(28, 71, 241, 0.08); color: var(--brand); }
.material-badge--external { background: rgba(5, 150, 105, 0.12); color: #047857; }
.material-badge--internal { background: #f3f0e8; color: #7c5e10; }
.material-badge--soon { background: rgba(245, 158, 11, 0.16); color: #92400e; font-weight: 700; }
.material-badge--expired { background: rgba(209, 67, 91, 0.12); color: #b4233c; font-weight: 700; }
.material-desc {
  margin: 6px 0 0; font-size: 13px; color: var(--text); white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.material-desc--full { display: block; -webkit-line-clamp: unset; margin-top: 12px; }
.material-meta { margin: 6px 0 0; font-size: 12px; word-break: break-word; }
.material-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; }
.material-get {
  padding: 5px 12px; border-radius: 6px; background: var(--brand); color: #fff; font-weight: 600; font-size: 12.5px;
}
.material-get:hover { opacity: 0.92; }
.material-preview { font-size: 12px; }
@media (max-width: 640px) {
  .product-tabs { max-width: none; }
  .material-grid { grid-template-columns: 1fr; }
}

.material-events { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.material-events li { padding: 6px 0; border-bottom: 1px dashed var(--border); line-height: 1.6; word-break: break-word; }
.material-event-action {
  display: inline-block; padding: 0 6px; margin: 0 4px; border-radius: 4px; font-size: 11px; background: #eef1f6; color: #4b5563;
}
.material-event-action--created, .material-event-action--version_added { background: rgba(28, 71, 241, 0.08); color: var(--brand); }
.material-event-action--trashed, .material-event-action--purged { background: rgba(209, 67, 91, 0.1); color: #b4233c; }
.material-event-action--restored { background: rgba(5, 150, 105, 0.12); color: #047857; }

.material-back { margin: 0 0 12px; font-size: 13px; }
.material-back a { color: var(--brand); }
.material-detail-title { margin: 0 0 4px; font-size: 21px; word-break: break-word; }
.material-current {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px;
  margin: 16px 0; padding: 12px 14px; border-radius: 10px; background: var(--brand-lighter); font-size: 13px; word-break: break-word;
}
.material-trashed {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  margin: 0 0 14px; padding: 10px 14px; border-radius: 8px; font-size: 13px;
  background: rgba(209, 67, 91, 0.08); color: #b4233c;
}
.material-cell-wrap { max-width: 320px; word-break: break-all; }
/* 편집 화면용 하단 고정 버튼 막대(.edit-actions)가 짧은 폼에서는 입력칸을 가리므로 풀어 둡니다 */
.material-new .edit-actions, #file-upload-form .edit-actions {
  position: static; background: none; border-top: 0; padding: 4px 0 0; flex-wrap: wrap; align-items: center;
}
.material-versions th, .material-get { white-space: nowrap; }

/* ---------- 포장재 ---------- */

.packaging-tab { margin-top: 20px; }
.pk-help { font-size: 12.5px; line-height: 1.6; margin: 0 0 14px; }
.pk-status {
  display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 700; white-space: nowrap;
  background: #eef1f6; color: #4b5563;
}
.pk-status--draft { background: rgba(245, 158, 11, 0.16); color: #92400e; }
.pk-status--approved { background: rgba(28, 71, 241, 0.1); color: var(--brand); }
.pk-status--printed { background: rgba(5, 150, 105, 0.13); color: #047857; }
.pk-status--obsolete { background: #f1f2f4; color: #9ca3af; text-decoration: line-through; }
.pk-status--none { background: #f1f2f4; color: #6b7280; }

/* 탭의 규격 카드 */
.pk-grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.pk-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden; color: var(--text);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; transition: box-shadow 0.15s, border-color 0.15s;
}
.pk-card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(17, 24, 39, 0.08); }
.pk-card-thumb {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: #f3f4f6; overflow: hidden;
  color: var(--muted); font-size: 12px;
}
.pk-card-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pk-card-body { display: flex; flex-direction: column; gap: 5px; padding: 11px 12px 12px; }
.pk-card-title { font-size: 14px; line-height: 1.4; word-break: break-word; }
.pk-card-status { display: flex; flex-wrap: wrap; gap: 4px; }
.pk-card-meta { margin: 0; font-size: 11.5px; word-break: break-all; }

/* 규격 상세 */
.pk-detail .edit-actions { position: static; background: none; border-top: 0; padding: 6px 0 0; flex-wrap: wrap; align-items: center; }
.pk-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; }
.pk-head-main { min-width: 0; }
/* 포장재 상세 머리: 제품명을 크게, 규격은 그 아래 (2026-09-16 요청) */
.pk-product-name { margin: 0 0 2px; font-size: 28px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; word-break: break-word; }
.pk-spec-name { font-size: 19px; font-weight: 700; color: #374151; }
/* 확정에 필요한 파일 표시 */
.pk-ready { display: flex; flex-wrap: wrap; gap: 6px 8px; list-style: none; margin: -4px 0 4px; padding: 0; font-size: 12.5px; }
.pk-ready li { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-weight: 600; }
.pk-ready li.is-done { border-color: #b7e4c7; background: #ecfdf3; color: #1b7a43; }
.pk-ready li.is-missing { border-color: #f5c2c7; background: #fff1f2; color: #b4233c; }
.pk-ready li.is-optional { color: #6b7280; }
.pk-actions button[disabled] { opacity: .45; cursor: not-allowed; }
.pk-download-btn { white-space: nowrap; }
.pk-artwork figcaption a.pk-download-btn, .pk-file-list a.pk-download-btn { color: inherit; }
.pk-download-list li { gap: 6px 10px; }
.pk-ext-badge { padding: 2px 7px; border: 1px solid var(--border); font-size: 11px; }
.pk-memo { margin: 2px 0 0; font-size: 13px; }
.pk-current { margin: 8px 0 0; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pk-current a { color: var(--brand); }
.pk-item-edit { font-size: 13px; min-width: 240px; }
.pk-item-edit > summary { cursor: pointer; color: var(--brand); }
.pk-versions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 18px 0 0; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.pk-version-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 12.5px; font-weight: 700; color: var(--text); background: var(--card-bg);
}
.pk-version-chip:hover { border-color: var(--brand); }
.pk-version-chip.is-active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-lighter); }
.pk-inline-form { display: inline; margin: 0; }
.pk-version-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 16px; margin-top: 16px; }
.pk-version-title { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.pk-version-meta { margin: 4px 0 0; font-size: 12px; }
.pk-change-note { margin: 6px 0 0; font-size: 13px; }
.pk-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-actions form { margin: 0; }
.pk-hint { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; font-size: 12.5px; background: rgba(245, 158, 11, 0.1); color: #92400e; }
.pk-hint.muted { background: #f3f4f6; color: var(--muted); }
.pk-section-title { margin: 0 0 10px; font-size: 14px; }
.pk-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px; margin-top: 20px; }
@media (max-width: 900px) { .pk-columns { grid-template-columns: 1fr; } }

.pk-artworks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pk-artwork { margin: 0; min-width: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card-bg); }
.pk-artwork-img { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: #f3f4f6; }
.pk-artwork-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pk-artwork-badge { padding: 4px 10px; border-radius: 6px; background: #fff; font-size: 12px; font-weight: 700; color: #4b5563; }
.pk-artwork figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 7px 9px; font-size: 11.5px; }
.pk-artwork figcaption a, .pk-file-list a { color: var(--brand); }
.pk-file-name { flex: 1 1 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pk-file-list { list-style: none; margin: 0 0 14px; padding: 0; font-size: 12.5px; }
.pk-file-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.pk-file-list .pk-file-name { flex: 1 1 160px; }
.pk-role { padding: 1px 6px; border-radius: 4px; font-size: 11px; background: #eef1f6; color: #4b5563; }
.pk-link-btn { padding: 0; border: 0; background: none; color: #b4233c; font-size: inherit; cursor: pointer; }
.pk-upload { margin-top: 6px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; }

.pk-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.pk-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pk-field--wide { grid-column: 1 / -1; }
.pk-field-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.pk-field textarea { resize: vertical; font-family: inherit; }
@media (max-width: 520px) { .pk-field-grid { grid-template-columns: 1fr; } }
.pk-field-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pk-field-table th { width: 110px; padding: 7px 10px 7px 0; text-align: left; color: var(--muted); font-weight: 600; vertical-align: top; border-bottom: 1px solid var(--border); }
.pk-field-table td { padding: 7px 0; border-bottom: 1px solid var(--border); word-break: break-word; }
.pk-value--multi { white-space: pre-wrap; }
.pk-check { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; font-size: 11px; }
.pk-check--ok { background: rgba(5, 150, 105, 0.12); color: #047857; }
.pk-check--bad { background: rgba(209, 67, 91, 0.12); color: #b4233c; font-weight: 700; }
/* 확정본 바코드 이미지 보기·다운로드 (public/barcode.js) */
.pk-barcode-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.barcode-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 12px; background: #fff; color: #111827; }
.barcode-dialog::backdrop { background: rgba(10, 12, 18, 0.6); }
.barcode-dialog-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #e5e7eb; font-size: 13px; font-weight: 700; }
.barcode-dialog-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barcode-dialog-close { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: #4b5563; }
.barcode-dialog-body { display: flex; justify-content: center; padding: 22px 16px; background: #fff; }
.barcode-dialog-body svg { max-width: 100%; height: auto; }
.barcode-dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding: 10px 14px; border-top: 1px solid #e5e7eb; }
.barcode-dialog-note { flex: 1 1 100%; margin: 0 0 4px; font-size: 11.5px; color: #6b7280; }

.pk-text { margin-top: 24px; }
.pk-text-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.pk-text-head .pk-section-title { margin: 0; }
.pk-text-tools { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.pk-text-tools a { color: var(--brand); }
.pk-textarea { margin-top: 10px; font-family: inherit; line-height: 1.6; resize: vertical; }
.pk-text-body {
  margin: 10px 0 0; padding: 14px 16px; border-radius: 10px; background: #f8f9fb; border: 1px solid var(--border);
  font-family: inherit; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; max-height: 560px; overflow: auto;
}
.pk-compare { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); }
.pk-compare-title { margin: 0 0 8px; font-weight: 700; font-size: 13px; }
.pk-field-changes { margin: 0 0 10px; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.pk-del { background: rgba(209, 67, 91, 0.1); color: #b4233c; text-decoration: line-through; padding: 0 3px; border-radius: 3px; }
.pk-add { background: rgba(5, 150, 105, 0.12); color: #047857; padding: 0 3px; border-radius: 3px; }
.pk-diff { font-size: 13px; line-height: 1.6; border-radius: 8px; overflow: auto; max-height: 520px; border: 1px solid var(--border); }
.pk-diff-line { display: flex; gap: 8px; padding: 1px 10px; white-space: pre-wrap; word-break: break-word; }
.pk-diff-line--same { color: #6b7280; }
.pk-diff-line--add { background: rgba(5, 150, 105, 0.1); color: #065f46; }
.pk-diff-line--del { background: rgba(209, 67, 91, 0.08); color: #9f1239; text-decoration: line-through; }
.pk-diff-mark { flex: none; width: 10px; font-weight: 700; }
.pk-event--approved, .pk-event--printed, .pk-event--restored { background: rgba(5, 150, 105, 0.12); color: #047857; }
.pk-event--item_created, .pk-event--version_created, .pk-event--file_added { background: rgba(28, 71, 241, 0.08); color: var(--brand); }
.pk-event--obsoleted, .pk-event--draft_discarded, .pk-event--trashed, .pk-event--purged, .pk-event--file_removed { background: rgba(209, 67, 91, 0.1); color: #b4233c; }

/* ---------- 요청 게시판 ---------- */

.board-tab { margin-top: 20px; }
.post-status {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap;
  background: #eef1f6; color: #4b5563;
}
.post-status--received { background: rgba(245, 158, 11, 0.16); color: #92400e; }
.post-status--reviewing { background: rgba(28, 71, 241, 0.1); color: var(--brand); }
.post-status--done { background: rgba(5, 150, 105, 0.13); color: #047857; }
.post-status--hold { background: #f1f2f4; color: #6b7280; }
.post-status--rejected { background: rgba(209, 67, 91, 0.1); color: #b4233c; }
/* 처리 이력의 상태 전환(보류 → 완료)은 색을 나누지 않고 한 뱃지로 묶습니다 (2026-09-22 요청) */
.post-status-transition {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap;
  background: var(--card-bg); color: #374151; border: 1px solid var(--border);
}

/* 목록: 표처럼 열을 맞춰 상태·제목·제품·작성자·날짜를 구분 */
.post-table { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card-bg); }
.post-table-head, .post-row {
  display: grid; gap: 4px 12px; align-items: center;
  grid-template-columns: 62px minmax(0, 1fr) 90px 74px;
}
.post-table--product .post-table-head, .post-table--product .post-row {
  /* 상태 · 제품 · 제목 · 작성자 · 등록일 순 (2026-09-22 요청) */
  grid-template-columns: 62px 160px minmax(0, 1fr) 90px 74px;
}
.post-table-head {
  padding: 9px 14px; background: #f7f8fa; border-bottom: 1px solid var(--border);
  font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.post-list { list-style: none; margin: 0; padding: 0; }
.post-row { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.post-row:last-child { border-bottom: 0; }
.post-row:hover { background: var(--brand-lighter); }
.post-row.is-unread { background: rgba(28, 71, 241, 0.035); box-shadow: inset 2px 0 0 var(--brand); }
.post-row.is-unread .post-row-title { font-weight: 700; }
.post-col-title { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.post-row-title { min-width: 0; font-size: 14px; color: var(--text); word-break: break-word; }
.post-row-title:hover { color: var(--brand); }
.post-col-product { min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-col-product a { color: var(--brand); }
.post-col-author, .post-col-date { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-dot { color: var(--brand); font-size: 9px; vertical-align: 2px; margin-right: 4px; }
.post-count {
  display: inline-block; padding: 0 6px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: #eef1f6; color: #4b5563;
}
@media (max-width: 720px) {
  .post-table-head { display: none; }
  .post-row, .post-table--product .post-row { grid-template-columns: 1fr auto; row-gap: 2px; padding: 12px; }
  .post-col-status { grid-row: 1; }
  .post-col-title { grid-column: 1 / -1; grid-row: 2; }
  .post-col-product { grid-column: 1 / -1; grid-row: 3; }
  .post-col-author { grid-row: 1; grid-column: 2; text-align: right; }
  .post-col-date { display: none; }
}
.board-search { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.board-search .field-input { flex: 1 1 240px; min-width: 0; }
.board-more { margin: 14px 0 0; }
.board-pager { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 13px; }

/* 상세: 글 / 첨부 / 처리 상태와 답변 / 댓글 을 각각 카드로 분리 */
.post-page { max-width: 880px; }
.post-card {
  margin: 0 0 14px; padding: 20px 22px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 12px;
}
.post-card--answer { border-color: var(--brand-light); background: var(--brand-lighter); }
.post-card-title {
  display: flex; align-items: center; gap: 6px; margin: 0 0 12px; padding-left: 10px;
  font-size: 15px; border-left: 3px solid var(--brand);
}
.post-card-empty { margin: 0; font-size: 13px; }
.post-card .edit-actions { position: static; background: none; border-top: 0; padding: 8px 0 0; flex-wrap: wrap; align-items: center; }
.post-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 20px; }
.post-head-main { min-width: 0; }
.post-head-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.post-head-actions form { margin: 0; }
.post-head-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.post-title { margin: 0; font-size: 20px; line-height: 1.4; word-break: break-word; }
.post-chip { padding: 1px 8px; border-radius: 999px; font-size: 11px; background: rgba(5, 150, 105, 0.13); color: #047857; }
.post-meta { margin: 8px 0 0; font-size: 12.5px; }
.post-username { color: var(--muted); }
.post-body { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
.post-textarea { font-family: inherit; line-height: 1.6; resize: vertical; }
.post-edit-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.post-file-list { margin-bottom: 0; }
/* 글·답변에 딸린 첨부 목록 (2026-09-22: 업로드는 글 수정 폼·관리자 처리 폼 안으로) */
.post-attachments { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.post-attachments .post-form-label { margin: 0 0 4px; }
.post-file-ext {
  flex: none; padding: 1px 6px; border-radius: 5px; font-size: 10.5px; font-weight: 700;
  background: #eef1f6; color: #4b5563;
}
.post-upload, .post-status-form, .post-comment-form {
  margin-top: 16px; padding: 14px; border: 1px dashed var(--border); border-radius: 10px; background: #fbfbfc;
}
.post-form-label { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.post-answer { padding: 14px 16px; border-radius: 10px; background: var(--card-bg); border: 1px solid var(--brand-light); }
.post-answer-head { margin: 0 0 8px; font-size: 13px; }
/* 처리 이력 타임라인 (2026-09-22) */
.post-history { margin-top: 16px; }
.post-history .post-form-label { margin: 0 0 6px; }
.post-history-list { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); }
.post-history-item { position: relative; padding: 6px 0 10px 10px; font-size: 13px; }
.post-history-item::before { content: ""; position: absolute; left: -21px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--card-bg); border: 2px solid #9ca3af; }
.post-history-item.is-latest::before { border-color: var(--brand); background: var(--brand); z-index: 1; }
/* "현재" 리본 대신 최신 항목의 점이 은은하게 퍼지며 펄스 (2026-09-22 요청) */
.post-history-item.is-latest::after {
  content: "";
  position: absolute;
  left: -21px;
  top: 11px;
  /* 점(::before)은 10x10 + 테두리 2px(전역 box-sizing 리셋은 의사요소엔 안 먹혀 content-box) 라
     실제로는 14x14 로 그려집니다. 링도 14x14 로 맞춰야 같은 left/top에서 중심이 겹칩니다. */
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--brand);
  z-index: 0;
  pointer-events: none;
  transform-origin: center center;
  animation: post-history-pulse 1.8s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
}
@keyframes post-history-pulse {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(2.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .post-history-item.is-latest::after { animation: none; display: none; }
}
.post-history-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.post-history-note { margin: 4px 0 0; font-size: 12px; }
.post-history-answer { margin-top: 6px; }
.post-history-answer summary { cursor: pointer; font-size: 12px; color: var(--brand); }
.post-history-answer .when-open { display: none; }
.post-history-answer[open] .when-open { display: inline; }
.post-history-answer[open] .when-closed { display: none; }
.post-history-answer .rich-text { margin-top: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); font-size: 13px; }
.field-input--status { width: auto; min-width: 140px; }
.post-comments { list-style: none; margin: 0; padding: 0; }
.post-comment { padding: 12px 14px; margin-bottom: 8px; border-radius: 10px; background: #f8f9fb; border: 1px solid var(--border); }
.post-comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 12.5px; }
.post-comment-head { justify-content: space-between; }
.post-comment-who { min-width: 0; }
.post-comment-head form { margin: 0; }

/* 서식 있는 본문 (src/text-format.js 가 만든 HTML) */
.rich-text { line-height: 1.75; font-size: 14.5px; word-break: break-word; }
.rich-text p { margin: 0 0 10px; }
.rich-text p:last-child { margin-bottom: 0; }
.rich-text h3 { margin: 18px 0 8px; font-size: 16px; }
.rich-text h4 { margin: 16px 0 6px; font-size: 14.5px; }
.rich-text ul, .rich-text ol { margin: 8px 0 10px; padding-left: 22px; }
.rich-text li { margin: 2px 0; }
.rich-text blockquote {
  margin: 10px 0; padding: 6px 14px; border-left: 3px solid var(--brand-light); color: var(--muted); background: var(--brand-lighter); border-radius: 0 8px 8px 0;
}
.rich-text code { padding: 1px 5px; border-radius: 4px; background: #eef1f6; font-family: ui-monospace, monospace; font-size: 0.92em; }
.rich-text a { color: var(--brand); text-decoration: underline; }
.rich-text hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
/* 에디터로 넣은 표·이미지 */
.rich-text table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13.5px; }
.rich-text th, .rich-text td { border: 1px solid var(--border); padding: 7px 9px; text-align: left; vertical-align: top; }
.rich-text th { background: #f7f8fa; font-weight: 700; }
.rich-text img { max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0; }
.rich-text figure { margin: 10px 0; }
.rich-text figure figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rich-text .se-table-size-auto, .rich-text table[style*="width"] { max-width: 100%; }
/* 편집기 안 내용도 화면과 같은 글꼴·간격으로 */
.sun-editor { border-radius: 8px; }
.sun-editor-editable { font-family: inherit; }

/* 가벼운 서식 도구 (public/simple-editor.js) */
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; padding: 6px;
  border: 1px solid var(--border); border-bottom: 0; border-radius: 8px 8px 0 0; background: #f7f8fa;
}
.editor-toolbar + textarea { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: -6px; }
.editor-btn {
  padding: 4px 9px; border: 1px solid transparent; border-radius: 6px; background: none; cursor: pointer;
  font: inherit; font-size: 12.5px; color: #4b5563;
}
.editor-btn:hover { background: var(--brand-light); color: var(--brand); }
.editor-btn--preview { margin-left: auto; font-weight: 600; }
.editor-btn--preview.is-on { background: var(--brand); color: #fff; }
.editor-preview {
  margin-top: -6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 0 0 8px 8px; background: var(--card-bg);
  min-height: 80px;
}
.editor-hint-line { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.post-event--created, .post-event--comment { background: rgba(28, 71, 241, 0.08); color: var(--brand); }
.post-event--status { background: rgba(5, 150, 105, 0.12); color: #047857; }
.post-event--trashed, .post-event--purged, .post-event--file_removed { background: rgba(209, 67, 91, 0.1); color: #b4233c; }

/* ---------- 제품 고르기 자동완성 (public/product-picker.js) ---------- */

.product-picker { position: relative; }
.product-picker .picker-source { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.picker-chosen { margin: 6px 0 0; font-size: 12.5px; }
.picker-chosen--warn { color: #b4233c; }
.picker-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px; max-height: 320px; overflow-y: auto;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
}
.picker-item {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; width: 100%; padding: 8px 12px;
  border: 0; background: none; text-align: left; cursor: pointer; font: inherit;
}
.picker-item:hover, .picker-item.is-active { background: var(--brand-light); }
.picker-item-name { font-size: 13.5px; color: var(--text); }
.picker-item-group { font-size: 11.5px; color: var(--muted); }
.picker-empty { padding: 10px 12px; font-size: 13px; color: var(--muted); }

/* ---------- 페이지 안 미리보기 창 (public/preview.js) ---------- */

.preview-dialog {
  width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0;
  border: 0; border-radius: 12px; background: #111318; color: #fff; overflow: hidden;
}
.preview-dialog::backdrop { background: rgba(10, 12, 18, 0.72); }
.preview-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; font-size: 13px; }
.preview-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-open { color: #c7d2fe; white-space: nowrap; }
.preview-close {
  width: 32px; height: 32px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, 0.12);
  color: #fff; font-size: 20px; line-height: 1; cursor: pointer;
}
.preview-close:hover { background: rgba(255, 255, 255, 0.24); }
.preview-body { display: flex; align-items: center; justify-content: center; padding: 0 12px 12px; }
.preview-media { display: block; max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 6px; background: #000; }
.material-trash-form { margin-top: 20px; }
@media (max-width: 640px) {
  .article-detail.material-detail { padding: 18px 16px; }
}

/* ---------- 계정 생성 요청 ---------- */

.auth-sub--left { margin: 12px 0 0; text-align: left; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; color: var(--muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-top: 1px solid var(--border); }
.auth-request-btn {
  display: block; width: 100%; padding: 10px; border: 1px solid var(--brand); border-radius: 8px;
  color: var(--brand); font-size: 14px; font-weight: 600; text-align: center; text-decoration: none; box-sizing: border-box;
}
.auth-request-btn:hover { background: var(--brand-lighter); }
.auth-contact { margin: 12px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); word-break: keep-all; }
.auth-card .notice-ok { margin: 0; }

/* 마케팅 자료 외부 공유 화면 (2026-09-22 요청) — 로그인 없이 여는 받기 페이지 */
.share-card { max-width: 420px; text-align: left; }
.share-card .auth-logo { display: block; margin-left: auto; margin-right: auto; }
.share-card h1 { text-align: left; }
.share-from { margin: 0 0 6px; }
.share-title { font-size: 19px; word-break: break-word; }
.share-desc { margin: 0 0 16px; font-size: 13.5px; line-height: 1.6; }
.share-file {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg, #f4f6fb);
}
.share-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.share-download { display: block; text-align: center; margin-top: 14px; }
.share-expiry { margin: 12px 0 0; font-size: 12px; text-align: center; }

.count-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px;
}
.requests-history { margin: 10px 0 0; font-size: 13px; }
.requests-history summary { cursor: pointer; color: var(--muted); }
.requests-history ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.9; }

/* ---------- 제품·카테고리 관리 (2026-09-22) ---------- */
.notice-error {
  padding: 10px 14px; border-radius: 8px; font-size: 13.5px;
  background: rgba(209, 67, 91, 0.1); color: #b4233c;
}
.required-mark { color: #d1435b; }
.btn-danger {
  display: inline-block; padding: 8px 16px; border-radius: 8px; border: 1px solid #e2a4ae;
  background: #fff; color: #b4233c; font-size: 14px; cursor: pointer; font-family: inherit;
}
.btn-danger:hover:not(:disabled) { background: rgba(209, 67, 91, 0.08); border-color: #d1435b; }
.btn-danger:disabled, .cat-order-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger.btn-small { padding: 5px 10px; font-size: 12.5px; }

.discontinued-badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px; vertical-align: 4px;
  font-size: 13px; font-weight: 700; background: #4b5563; color: #fff;
}
.discontinued-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin: 0 0 16px; padding: 12px 16px; border-radius: 10px;
  background: #f3f4f6; border: 1px solid #d1d5db; font-size: 13.5px;
}
.discontinued-banner .muted { flex-basis: 100%; font-size: 12.5px; }

.catalog-manage { margin-top: 12px; font-size: 13.5px; }
.catalog-manage > summary { cursor: pointer; color: var(--muted); display: inline-block; }
.catalog-manage-body {
  margin-top: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card-bg); display: grid; gap: 14px; max-width: 640px;
}
.catalog-inline-form { margin: 0; }
.catalog-inline-row { display: flex; gap: 8px; align-items: center; }
.catalog-inline-row .field-input { flex: 1; min-width: 0; margin: 0; }
.catalog-inline-row button { flex-shrink: 0; }
.catalog-hidden-note { font-size: 12.5px; margin: 8px 0 0; }
.catalog-hidden-note a { color: var(--brand); }

.cat-admin-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; margin-bottom: 28px; }
.cat-admin-market { min-width: 0; }
.catalog-summary { margin: 0 0 18px; }
.ct-market-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ct-market-head .section-title { margin-bottom: 8px; }
.ct-tree { list-style: none; margin: 0; padding: 0 0 0 22px; }
.ct-tree:empty { padding: 0; }
.ct-tree--root { padding: 0 0 36px; min-height: 60px; border-radius: 8px; }
.ct-tree--root.drop-end { background: var(--brand-lighter); box-shadow: inset 0 -2px 0 var(--brand); }
.ct-node { margin: 4px 0; }
.ct-node.is-dragging > .ct-row { opacity: 0.4; }
.ct-empty { padding: 14px; border: 1px dashed var(--border); border-radius: 8px; font-size: 12.5px; color: var(--muted); }
.ct-row {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 7px 8px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; cursor: grab; user-select: none;
}
.ct-row:hover { border-color: #c7cdd8; }
.ct-row:active { cursor: grabbing; }
.ct-handle { color: #9ca3af; font-size: 13px; letter-spacing: -2px; }
.ct-name { font-weight: 600; font-size: 14px; }
.ct-meta { flex: 1; font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.ct-btn {
  flex-shrink: 0; padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; font-size: 12px; cursor: pointer; font-family: inherit;
}
.ct-btn:hover { border-color: var(--brand); color: var(--brand); }
.ct-mark { flex-shrink: 0; padding: 0 6px; border-radius: 4px; font-size: 11px; line-height: 18px; font-weight: 600; }
.ct-mark--new { background: rgba(5, 150, 105, 0.12); color: #047857; }
.ct-mark--changed { background: rgba(28, 71, 241, 0.1); color: var(--brand); }
.ct-mark--moved { background: rgba(217, 119, 6, 0.12); color: #b45309; }
.ct-row.is-new, .ct-row.is-changed, .ct-row.is-moved { border-color: #a5b4fc; background: #f8f9ff; }
.ct-row.is-focus { box-shadow: 0 0 0 3px rgba(28, 71, 241, 0.25); border-color: var(--brand); }
.ct-row.drop-inside { background: var(--brand-light); border-color: var(--brand); border-style: dashed; }
.ct-row.drop-before::before, .ct-row.drop-after::after {
  content: ''; position: absolute; left: -1px; right: -1px; height: 3px; border-radius: 2px; background: var(--brand);
}
.ct-row.drop-before::before { top: -4px; }
.ct-row.drop-after::after { bottom: -4px; }
.ct-savebar {
  position: sticky; bottom: 0; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 28px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card-bg); box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}
.ct-savebar-status { flex: 1; font-size: 13.5px; color: var(--muted); }
.ct-editor.is-dirty .ct-savebar { border-color: var(--brand); }
.ct-editor.is-dirty .ct-savebar-status { color: var(--brand); font-weight: 600; }
.ct-savebar-error { flex-basis: 100%; order: 5; font-size: 13px; color: #b4233c; }
.ct-savebar button:disabled { opacity: 0.45; cursor: not-allowed; }
.ct-dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 12px; background: #fff; color: var(--text); }
.ct-dialog::backdrop { background: rgba(10, 12, 18, 0.55); }
.ct-dialog-form { margin: 0; }
.ct-dialog-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 15px; }
.ct-dialog-close { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: #4b5563; }
.ct-dialog-body { padding: 8px 18px 14px; }
.ct-dialog-body textarea { resize: vertical; }
.ct-iconpick { max-height: 190px; overflow-y: auto; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.ct-iconpick-title { margin: 8px 2px 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.ct-iconpick-title:first-child { margin-top: 0; }
.ct-iconpick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 4px; }
.ct-iconpick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px;
  border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; color: #4b5563; font: inherit;
}
.ct-iconpick-btn:hover { background: #f1f5f9; }
.ct-iconpick-btn.is-picked { border-color: var(--brand); background: var(--brand-lighter); color: var(--brand); }
.ct-iconpick-label { font-size: 10.5px; line-height: 1.2; text-align: center; word-break: keep-all; }
.ct-dialog-meta { font-size: 12.5px; margin: 10px 0 0; line-height: 1.5; }
.ct-dialog-meta:empty { display: none; }
.ct-dialog-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.ct-dialog-hint { flex: 1; font-size: 12px; text-align: right; }
.ct-dialog-foot .btn-danger[hidden] { display: none; }
.product-new-form { max-width: 640px; }
