/* ============================================================
   Rebeauty Builder — Admin design system
   클래스 어휘:
   layout  .adm-header .adm-body .adm-side .adm-main .adm-page-head
   block   .card .card__head .card__title .card__body .card__foot
   data    .stat-grid .stat  .table-wrap .table  .pager  .empty
   form    .form-grid .form-row .label .form-input .form-select .form-textarea .help
   action  .btn .btn--primary .btn--ghost .btn--danger .btn--sm  .toolbar
   status  .badge .badge--ok|warn|danger|muted  .alert .alert--ok|err
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: 271 82% 35%;
  --primary-fg: 270 100% 97%;
  --gradient-from: 271 82% 35%;
  --gradient-to: 271 65% 45%;
  --fg: 240 10% 3.9%;
  --bg: 0 0% 100%;
  --card: 0 0% 100%;
  --border: 240 5.9% 90%;
  --muted: 240 4.8% 95.9%;
  --muted-fg: 240 3.8% 46.1%;
  --ring: 271 82% 35%;
  --ok: 152 60% 34%;
  --warn: 38 92% 45%;
  --danger: 0 84% 48%;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --side-w: 232px;
  --side-w-collapsed: 58px;   /* 아이콘만 남기는 레일 폭 */
  --head-h: 56px;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  color: hsl(var(--fg));
  background: hsl(var(--bg));
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
svg { flex-shrink: 0; }

/* ===================================================== 로그인(2열) */
.auth-body { background: hsl(var(--bg)); }
.auth-layout { display: flex; min-height: 100vh; }

.auth-brand-panel {
  flex: 1;
  background: linear-gradient(135deg, hsl(var(--gradient-from)), hsl(var(--gradient-to)));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem; color: #fff; position: relative; overflow: hidden;
}
.auth-brand-panel::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 50%, hsl(340 70% 60% / .30) 0%, transparent 50%),
              radial-gradient(circle at 70% 30%, hsl(350 76% 70% / .20) 0%, transparent 50%);
}
.auth-brand-logo {
  position: relative; z-index: 1; display: flex; align-items: center;
  gap: 1rem; margin-bottom: 1.5rem;
}
.auth-brand-logo svg { filter: drop-shadow(0 2px 8px rgba(0,0,0,.15)); }
.auth-brand-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.auth-brand-subtitle { font-size: .8125rem; opacity: .75; margin-top: .15rem; letter-spacing: .02em; }
.auth-brand-tagline {
  position: relative; z-index: 1; font-size: 1rem; opacity: .85;
  max-width: 30rem; text-align: center; line-height: 1.6;
}
.auth-brand-points {
  position: relative; z-index: 1; list-style: none; margin-top: 2rem;
  display: grid; gap: .55rem; font-size: .875rem; opacity: .8;
}
.auth-brand-points li { padding-left: 1.25rem; position: relative; }
.auth-brand-points li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .7;
}

.auth-form-panel {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 2rem; background: hsl(var(--bg));
}
.auth-card { width: 100%; max-width: 420px; }
.auth-title { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: .5rem; letter-spacing: -.02em; }
.auth-subtitle { font-size: .875rem; text-align: center; color: hsl(var(--muted-fg)); margin-bottom: 2rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .8125rem; color: hsl(var(--muted-fg)); }
.auth-error {
  display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem;
  background: hsl(0 86% 97%); border: 1px solid hsl(0 84% 90%); color: hsl(0 84% 40%);
  border-radius: var(--radius-lg); font-size: .875rem; margin-bottom: 1rem;
}
.input-icon-wrap { position: relative; }
.input-icon {
  position: absolute; left: .875rem; top: 50%; transform: translateY(-50%);
  color: hsl(var(--muted-fg)); pointer-events: none; display: flex;
}
/* .form-input 의 padding 단축 속성보다 뒤에서 다시 선언한다(아래 폼 섹션 참고) */

.auth-body--stack { word-break: keep-all; overflow-wrap: break-word; }   /* 한국어 낱말 중간 줄바꿈 막기 */
@media (max-width: 860px) {
  .auth-brand-panel { display: none; }
  /* auth-body--stack: 브랜드 설명을 숨기지 않고 폼 위에 쌓는다 (에이전시 데모 /showcase 로그인) */
  .auth-body--stack .auth-layout { flex-direction: column; }
  .auth-body--stack .auth-brand-panel { display: flex; flex: none; padding: 2.25rem 1.25rem 2rem; }
  .auth-body--stack .auth-brand-title { font-size: 1.3rem; }
  .auth-body--stack .auth-brand-tagline { font-size: .9375rem; }
  .auth-body--stack .auth-brand-points { margin-top: 1.25rem; font-size: .8125rem; }
  .auth-body--stack .auth-form-panel { flex: none; padding: 2rem 1.25rem 3rem; }
}

/* ===================================================== 폼 요소 */
.form-input, .form-select, .form-textarea {
  width: 100%; padding: .6rem .85rem;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg);
  font-size: .9375rem; font-family: inherit; color: hsl(var(--fg));
  background: hsl(var(--card)); outline: none; transition: border-color .15s, box-shadow .15s;
  min-height: 2.6rem;
}
.form-textarea { min-height: 7rem; resize: vertical; line-height: 1.6; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / .12);
}
.form-input::placeholder, .form-textarea::placeholder { color: hsl(var(--muted-fg)); }
/* 아이콘이 붙는 입력칸 — .form-input 의 padding 단축 속성을 덮어써야 하므로 뒤에 둔다 */
.form-input.input-with-icon { padding-left: 2.75rem; }
.is-rtl .form-input.input-with-icon { padding-left: .85rem; padding-right: 2.75rem; }

.label { display: block; font-size: .8125rem; font-weight: 600; margin-bottom: .35rem; color: hsl(var(--fg)); }
.help { font-size: .75rem; color: hsl(var(--muted-fg)); margin-top: .3rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem 1.25rem; }
.form-row { display: block; }
.form-row--full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: .45rem; font-size: .875rem; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: hsl(var(--primary)); }

/* ===================================================== 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .6rem 1.1rem; border: 1px solid transparent; border-radius: var(--radius-lg);
  font-size: .875rem; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: opacity .15s, box-shadow .15s, background .15s; min-height: 2.6rem; white-space: nowrap;
}
.btn--primary { background: hsl(var(--primary)); color: hsl(var(--primary-fg)); width: auto; }
.btn--primary:hover { opacity: .92; box-shadow: 0 2px 8px hsl(var(--primary) / .3); }
.btn--block { width: 100%; }
.btn--ghost { background: hsl(var(--card)); border-color: hsl(var(--border)); color: hsl(var(--fg)); }
.btn--ghost:hover { background: hsl(var(--muted)); }
.btn--danger { background: hsl(var(--danger)); color: #fff; }
.btn--danger:hover { opacity: .9; }
.btn--sm { padding: .35rem .7rem; min-height: 2rem; font-size: .8125rem; border-radius: var(--radius); }
.btn:disabled, .btn[disabled] {
  opacity: .45; cursor: not-allowed; background: hsl(var(--muted));
  border-color: hsl(var(--border)); color: hsl(var(--muted-fg)); box-shadow: none;
}

/* ===================================================== 관리자 골격 */
.admin { background: hsl(240 20% 98%); }

.adm-header {
  position: fixed; inset: 0 0 auto 0; height: var(--head-h); z-index: 40;
  display: flex; align-items: center; gap: .75rem; padding: 0 1rem;
  background: linear-gradient(90deg, hsl(var(--gradient-from)), hsl(var(--gradient-to)));
  color: #fff;
}
.adm-burger {
  display: none; background: transparent; border: 0; color: #fff; padding: .35rem;
  cursor: pointer; border-radius: var(--radius);
}
/* 사이드메뉴 접기 — 데스크톱 전용. 좁은 화면은 .adm-burger 드로어가 맡는다. */
.adm-collapse {
  display: none; background: transparent; border: 0; color: #fff; padding: .35rem;
  cursor: pointer; border-radius: var(--radius); opacity: .8;
}
.adm-collapse:hover { opacity: 1; background: rgba(255,255,255,.16); }
.adm-collapse:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.adm-logo { display: flex; align-items: center; gap: .55rem; }
.adm-logo-mark {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255,255,255,.2); font-weight: 800; font-size: .75rem; letter-spacing: .02em;
}
.adm-logo-text { font-size: .95rem; font-weight: 500; letter-spacing: -.01em; }
.adm-logo-text b { font-weight: 800; }
.adm-header-spacer { flex: 1; }
.adm-header-link { font-size: .8125rem; opacity: .85; }
.adm-header-link:hover { opacity: 1; }
.adm-user { display: flex; align-items: center; gap: .75rem; font-size: .8125rem; }
.adm-user-name { opacity: .9; }
.adm-logout-form { display: inline-flex; }
.adm-logout {
  padding: .3rem .7rem; border-radius: 999px; background: rgba(255,255,255,.16); font-weight: 600;
  border: 0; color: inherit; font-family: inherit; font-size: inherit; cursor: pointer; line-height: 1.4;
}
.adm-logout:hover { background: rgba(255,255,255,.28); }

.adm-body { padding-top: var(--head-h); min-height: 100vh; }

.adm-side {
  position: fixed; top: var(--head-h); bottom: 0; left: 0; width: var(--side-w); z-index: 30;
  background: hsl(var(--card)); border-right: 1px solid hsl(var(--border));
  overflow-y: auto; padding: .85rem .6rem 2rem;
}
.adm-side-group {
  font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: hsl(var(--muted-fg)); padding: .9rem .7rem .35rem;
}
.adm-side-link {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem;
  border-radius: var(--radius-lg); color: hsl(240 6% 30%); font-size: .875rem; font-weight: 500;
}
.adm-side-link:hover { background: hsl(var(--muted)); }
.adm-side-link.is-active {
  background: hsl(var(--primary) / .09); color: hsl(var(--primary)); font-weight: 700;
}
.adm-scrim { display: none; }

/* 컨텐츠 영역 — 폭 100% */
.adm-main {
  margin-left: var(--side-w);
  width: calc(100% - var(--side-w));
  max-width: none;
  padding: 1.25rem 1.5rem 3rem;
}
.adm-page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.1rem; flex-wrap: wrap;
}
.adm-page-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.adm-page-sub { font-size: .8125rem; color: hsl(var(--muted-fg)); margin-top: .2rem; }
.adm-page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* 접힌 상태 — 데스크톱에서만. 폭만 줄이고 아이콘은 남긴다. */
@media (min-width: 901px) {
  .adm-collapse { display: block; }
  .adm-side { transition: width .16s ease; }
  .adm-main { transition: margin-left .16s ease, width .16s ease; }

  .nav-collapsed .adm-side { width: var(--side-w-collapsed); padding-left: .4rem; padding-right: .4rem; }
  .nav-collapsed .adm-side-link { justify-content: center; padding-left: 0; padding-right: 0; }
  .nav-collapsed .adm-side-link > span { display: none; }
  /* 그룹 이름은 자리를 못 쓰니 구분선으로 바꾼다 */
  .nav-collapsed .adm-side-group { font-size: 0; padding: .55rem .35rem .4rem; }
  .nav-collapsed .adm-side-group::after {
    content: ''; display: block; height: 1px; background: hsl(var(--border));
  }
  .nav-collapsed .adm-main {
    margin-left: var(--side-w-collapsed); width: calc(100% - var(--side-w-collapsed));
  }
}
@media (prefers-reduced-motion: reduce) {
  .adm-side, .adm-main { transition: none; }
}

@media (max-width: 900px) {
  .adm-burger { display: block; }
  .adm-side { transform: translateX(-100%); transition: transform .2s ease; }
  .nav-open .adm-side { transform: none; }
  .nav-open .adm-scrim {
    display: block; position: fixed; inset: var(--head-h) 0 0 0; background: rgba(0,0,0,.35); z-index: 25;
  }
  .adm-main { margin-left: 0; width: 100%; padding: 1rem; }
}

/* ===================================================== 카드 */
.card {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg); margin-bottom: 1.1rem; overflow: hidden;
}
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 1.1rem; border-bottom: 1px solid hsl(var(--border)); flex-wrap: wrap;
}
.card__title { font-size: .95rem; font-weight: 700; }
.card__body { padding: 1.1rem; }
.card__body--flush { padding: 0; }
.card__foot {
  padding: .85rem 1.1rem; border-top: 1px solid hsl(var(--border));
  display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap;
}

/* ===================================================== 지표 */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .85rem; margin-bottom: 1.1rem;
}
.stat {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg); padding: .95rem 1.1rem;
}
.stat__label { font-size: .75rem; color: hsl(var(--muted-fg)); font-weight: 600; }
.stat__value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; margin-top: .2rem; }
.stat__sub { font-size: .75rem; color: hsl(var(--muted-fg)); margin-top: .1rem; }

/* ===================================================== 표 */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.table th, .table td {
  padding: .6rem .75rem; text-align: left; border-bottom: 1px solid hsl(var(--border));
  vertical-align: middle; white-space: nowrap;
}
.table th {
  font-size: .6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: hsl(var(--muted-fg)); background: hsl(240 20% 98.5%); position: sticky; top: 0;
}
.table tbody tr:hover { background: hsl(var(--muted) / .6); }
.table td.wrap { white-space: normal; min-width: 16rem; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-thumb {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  background: hsl(var(--muted)); display: block;
}

/* ===================================================== 상태 */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem;
  border-radius: 999px; font-size: .6875rem; font-weight: 700;
  background: hsl(var(--muted)); color: hsl(var(--muted-fg));
}
.badge--ok     { background: hsl(var(--ok) / .12);     color: hsl(var(--ok)); }
.badge--warn   { background: hsl(var(--warn) / .15);   color: hsl(38 92% 32%); }
.badge--danger { background: hsl(var(--danger) / .10); color: hsl(var(--danger)); }
.badge--muted  { background: hsl(var(--muted));        color: hsl(var(--muted-fg)); }

.alert {
  padding: .7rem 1rem; border-radius: var(--radius-lg); font-size: .875rem;
  margin-bottom: 1rem; border: 1px solid transparent;
}
.alert--ok  { background: hsl(var(--ok) / .08);     border-color: hsl(var(--ok) / .25);     color: hsl(152 60% 24%); }
.alert--err { background: hsl(var(--danger) / .07); border-color: hsl(var(--danger) / .25); color: hsl(var(--danger)); }

/* ===================================================== 도구 모음 / 필터 */
.toolbar {
  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  padding: .85rem 1.1rem; border-bottom: 1px solid hsl(var(--border)); background: hsl(240 20% 99%);
}
.toolbar .form-input, .toolbar .form-select { min-height: 2.3rem; padding: .4rem .7rem; font-size: .875rem; width: auto; }
.toolbar--end { justify-content: flex-end; }
.spacer { flex: 1; }

/* ===================================================== 페이지네이션 */
.pager { display: flex; gap: .3rem; align-items: center; justify-content: center; padding: 1rem; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 2rem; height: 2rem; padding: 0 .5rem; display: inline-flex; align-items: center;
  justify-content: center; border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  font-size: .8125rem; background: hsl(var(--card));
}
.pager a:hover { background: hsl(var(--muted)); }
.pager .is-current { background: hsl(var(--primary)); color: #fff; border-color: hsl(var(--primary)); font-weight: 700; }
.pager .is-gap { border: 0; background: transparent; }

/* ===================================================== 기타 */
.empty { padding: 3rem 1rem; text-align: center; color: hsl(var(--muted-fg)); font-size: .875rem; }
.muted { color: hsl(var(--muted-fg)); }
.mono  { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8125rem; }
.nowrap { white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.1rem; }
.bar { height: 6px; border-radius: 999px; background: hsl(var(--muted)); overflow: hidden; }
.bar > i { display: block; height: 100%; background: hsl(var(--primary)); }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip {
  padding: .25rem .6rem; border-radius: 999px; border: 1px solid hsl(var(--border));
  font-size: .75rem; background: hsl(var(--card)); cursor: pointer;
}
.chip.is-on { background: hsl(var(--primary)); color: #fff; border-color: hsl(var(--primary)); }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid hsl(var(--border)); margin-bottom: 1.1rem; flex-wrap: wrap; }
.tab {
  padding: .55rem .9rem; font-size: .875rem; font-weight: 600; color: hsl(var(--muted-fg));
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.is-active { color: hsl(var(--primary)); border-bottom-color: hsl(var(--primary)); }

/* ===================================================== 오류 페이지 */
.bare { display: grid; place-items: center; min-height: 100vh; background: hsl(240 20% 98%); }
.err-wrap { text-align: center; padding: 2rem; }
.err-code { font-size: 4rem; font-weight: 800; color: hsl(var(--primary)); letter-spacing: -.04em; }
.err-title { font-size: 1.25rem; font-weight: 700; margin: .25rem 0 .5rem; }
.err-msg { color: hsl(var(--muted-fg)); margin-bottom: 1.5rem; }

/* ===================================================== 테마 카탈로그 — 뼈대 · 스와치 · 미리보기
   admin/theme_*.php · partials/theme_picker.php · brand_picker.php 공용 (에이전시 콘솔도 이 파일을 쓴다) */

/* 레이아웃 뼈대 (admin/theme_skel.php) — 데스크톱 16:10 + 모바일 1:2 SVG 한 쌍 */
.skel { display: inline-flex; align-items: flex-end; gap: 5px; vertical-align: middle; }
.skel svg { display: block; overflow: hidden; border-radius: 4px; background: #fff;
            box-shadow: 0 0 0 1px hsl(var(--border)), 0 1px 2px rgba(20,19,26,.05); }
.skel .skel__d { width: 112px; height: 70px; }
.skel .skel__m { width: 35px;  height: 70px; border-radius: 6px; }
.skel--xs { gap: 3px; }
.skel--xs .skel__d { width: 72px;   height: 45px; border-radius: 3px; }
.skel--xs .skel__m { width: 22.5px; height: 45px; border-radius: 4px; }
.skel--md .skel__d { width: 144px; height: 90px; }
.skel--md .skel__m { width: 45px;  height: 90px; border-radius: 7px; }

/* 스와치 — 팔레트 띠 · 틴트 칩 · 캡슐 · 점 */
.sw { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; vertical-align: middle; }
.sw-strip { display: inline-flex; width: 112px; height: 26px; border-radius: 6px; overflow: hidden; flex: none;
            box-shadow: 0 0 0 1px hsl(var(--border)); }
.sw-strip > i { flex: 1; }
.sw-strip > i.is-wide { flex: 1.6; }
.sw-tint { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px;
           font-size: .625rem; font-weight: 700; line-height: 1; white-space: nowrap; }
.sw-cap { display: inline-block; width: 11px; height: 19px; border-radius: 999px; flex: none;
          box-shadow: inset 0 0 0 1px rgba(0,0,0,.07); }
.sw-dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; flex: none;
          box-shadow: 0 0 0 1px hsl(var(--border)); }
.sw-label { font-size: .6875rem; color: hsl(var(--muted-fg)); }
.table .sw { flex-wrap: nowrap; }

/* 쉼표 목록 + 도우미 칩 (홈 모듈 · 줄 스타일 · 레일 · 틴트) — admin.js [data-csvpick] */
.csvpick__chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.csvpick__chip {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 2.1rem; padding: .25rem .7rem .25rem .35rem;
  border: 1px solid hsl(var(--border)); border-radius: 999px; background: hsl(var(--card));
  font: inherit; font-size: .8125rem; color: hsl(var(--fg)); cursor: pointer; text-align: left;
}
.csvpick__chip:hover { background: hsl(var(--muted)); }
.csvpick__chip:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.csvpick__chip[aria-pressed="true"] {
  border-color: hsl(var(--primary)); background: hsl(var(--primary) / .07); color: hsl(var(--primary)); font-weight: 600;
}
.csvpick__n {
  display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .3rem; border-radius: 999px;
  background: hsl(var(--muted)); color: hsl(var(--muted-fg)); font-size: .6875rem; font-weight: 800; line-height: 1;
}
.csvpick__n:empty::before { content: '+'; font-size: .8125rem; }
.csvpick__chip[aria-pressed="true"] .csvpick__n { background: hsl(var(--primary)); color: hsl(var(--primary-fg)); }
.csvpick__key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .6875rem; color: hsl(var(--muted-fg)); font-weight: 400; }
.csvpick__tools { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .45rem; }
.csvpick__warn { margin-top: .4rem; font-size: .75rem; font-weight: 600; color: hsl(38 92% 32%); }
.csvpick__warn[hidden] { display: none; }

/* 색 입력 한 쌍 (컬러 피커 + hex 글자) — 비워 둘 수 있는 색은 글자 칸이 name 을 가진다 */
.colorpair { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.colorpair input[type="color"] {
  width: 3rem; height: 2.6rem; padding: 2px; flex: none; cursor: pointer;
  border: 1px solid hsl(var(--border)); border-radius: 8px; background: #fff;
}
.colorpair input[type="color"]:disabled { opacity: .4; cursor: not-allowed; }
.colorpair .form-input { width: 9rem; }
.readout { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; color: hsl(var(--muted-fg)); }
.readout b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: hsl(var(--fg)); font-weight: 700; }

/* 미리보기 기준(샘플 테넌트 · 언어) + 필터 막대 */
.pvbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.pvbar__group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.pvbar__label { font-size: .6875rem; font-weight: 700; letter-spacing: .04em; color: hsl(var(--muted-fg)); }
.pvbar .form-select { width: auto; min-height: 2.15rem; padding: .3rem 2rem .3rem .65rem; font-size: .8125rem; }
.chip.is-on .muted { color: inherit; opacity: .8; }

.badge--info { background: hsl(var(--primary) / .1); color: hsl(var(--primary)); }
.badge--dark { background: hsl(240 6% 18%); color: #fff; }
.badge.is-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .6875rem; font-weight: 600; }
.table td.lay-name { white-space: normal; min-width: 11rem; max-width: 16rem; }
.table td.lay-conf { white-space: normal; min-width: 14rem; max-width: 20rem; font-size: .75rem; }
.lay-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .3rem; }
.lay-desc { font-size: .75rem; margin-top: .15rem; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

/* 브랜드 갤러리 — 시장별 그룹 · 카드(실제 렌더 썸네일 + 뼈대 + 팔레트) */
.bgroup { margin-bottom: 1.6rem; }
.bgroup__head { display: flex; align-items: baseline; gap: .5rem; margin: 0 0 .65rem; }
.bgroup__title { font-size: 1rem; font-weight: 800; letter-spacing: -.01em; }
.bgal { display: grid; grid-template-columns: repeat(auto-fill, minmax(452px, 1fr)); gap: 1rem; }
.bcard {
  display: flex; flex-direction: column; overflow: hidden; min-width: 0;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg);
}
.bcard__media {
  display: flex; gap: 10px; padding: 12px; overflow-x: auto;
  background: hsl(240 20% 97%); border-bottom: 1px solid hsl(var(--border));
}
.pvt {
  position: relative; display: block; flex: none; overflow: hidden; border-radius: 8px; background: #fff;
  box-shadow: 0 0 0 1px hsl(var(--border)), 0 4px 14px rgba(20,19,26,.06);
}
.pvt:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.pvt--d { width: 320px; height: 200px; }
.pvt--m { width: 97.5px; height: 200px; border-radius: 12px; }
.pvt__ph { position: absolute; inset: 0; display: grid; place-items: center; background: hsl(240 14% 96%); }
.pvt__ph .skel svg { box-shadow: none; }
.pvt--d .pvt__ph .skel__d { width: 288px; height: 180px; }
.pvt--m .pvt__ph .skel__m { width: 84px; height: 168px; }
.pvt iframe {
  position: absolute; top: 0; left: 0; border: 0; background: #fff;
  transform: scale(.25); transform-origin: 0 0; pointer-events: none;
  opacity: 0; transition: opacity .35s ease;
}
.pvt--d iframe { width: 1280px; height: 800px; }
.pvt--m iframe { width: 390px;  height: 800px; }
.pvt iframe.is-loaded { opacity: 1; }
.bcard__body { display: flex; flex-direction: column; gap: .5rem; flex: 1; padding: .85rem 1rem 1rem; }
.bcard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.bcard__name { font-size: .95rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.35; }
.bcard__tag { font-size: .75rem; color: hsl(var(--muted-fg)); margin-top: .1rem; }
.bcard__meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.bcard__note { font-size: .75rem; color: hsl(var(--muted-fg)); line-height: 1.5; }
.bcard__note b { color: hsl(var(--fg)); font-weight: 600; }
.bcard__foot { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: auto; padding-top: .35rem; }
@media (max-width: 560px) { .bgal { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .pvt iframe { transition: none; } }

/* 레이아웃 · 스킨 · 브랜드 피커 (partials/theme_picker.php · brand_picker.php) */
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: .75rem; }
.tp-item { position: relative; min-width: 0; }
.tp-opt { position: relative; cursor: pointer; display: block; height: 100%; }
.tp-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tp-box {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  border: 2px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card));
  transition: border-color .12s, box-shadow .12s;
}
.tp-opt:hover .tp-box { border-color: hsl(var(--primary) / .45); }
.tp-opt input:checked + .tp-box { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .12); }
.tp-opt input:focus-visible + .tp-box { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.tp-sk { display: flex; justify-content: center; align-items: flex-end; padding: 12px 8px 10px; background: #f6f6f9; }
.tp-prev { height: 92px; padding: 9px; display: flex; flex-direction: column; gap: 6px; }
.tp-bar { height: 9px; border-radius: 3px; }
.tp-row { display: flex; gap: 5px; flex: 1; }
.tp-cell { flex: 1; border-radius: 4px; }
.tp-meta { display: block; padding: .45rem .6rem .55rem; border-top: 1px solid hsl(var(--border)); flex: 1; }
.tp-name { display: block; font-size: .8125rem; font-weight: 700; line-height: 1.3; padding-right: 3.6rem; }
.tp-desc { display: block; font-size: .6875rem; color: hsl(var(--muted-fg)); margin-top: .15rem; line-height: 1.4; }
.tp-desc.is-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.tp-tags { display: flex; flex-wrap: wrap; gap: .2rem; margin-top: .35rem; }
.tp-tags .badge { font-size: .625rem; padding: .1rem .4rem; }
.tp-group { font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
            color: hsl(var(--muted-fg)); margin: 1.1rem 0 .5rem; }
.tp-group:first-child { margin-top: 0; }
.tp-pv {
  position: absolute; right: .5rem; bottom: .5rem; z-index: 1;
  display: inline-flex; align-items: center; gap: .2rem; padding: .2rem .5rem; border-radius: 999px;
  border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--fg));
  font-size: .6875rem; font-weight: 600; line-height: 1.4;
}
.tp-pv:hover { background: hsl(var(--muted)); }
.tp-pv:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.tp-fonts { display: flex; flex-wrap: wrap; gap: .1rem .5rem; font-size: .6875rem; line-height: 1.35; }
