/* ==========================================================================
   Pyler Design System — 관리자 UI 스타일
   토큰 값은 @pylerai/design-system@1.1.0 의 dist/style.css 에서 그대로 가져왔고,
   레이아웃/컴포넌트 구성은 nebula-frontend 를 참고했습니다.
   ========================================================================== */

:root {
  /* ── primitive ── */
  --ds-primitive-black: #121212;
  --ds-primitive-white: #ffffff;

  /* ── main / primary ── */
  --ds-main-default: #0099ff;
  --ds-primary-blue-normal: #0099ff;
  --ds-primary-blue-hovered: #007dd1;
  --ds-primary-blue-disabled: #c9eaff;
  --ds-primary-blue-muted: #f2faff;
  --ds-primary-red-normal: #ff4242;
  --ds-primary-red-hovered: #e60d0d;
  --ds-primary-red-disabled: #ffdcdc;
  --ds-primary-red-muted: #fff7f7;
  --ds-primary-green-normal: #0bc753;
  --ds-primary-green-hovered: #00a13e;
  --ds-primary-green-disabled: #b4ecd1;
  --ds-primary-green-muted: #f4fbf7;

  /* ── text / line / surface ── */
  --ds-text-strong: #333333;
  --ds-text-normal: #969696;
  --ds-text-disabled: #cccccc;
  --ds-line-strong: #e2e2e2;
  --ds-line-normal: #ebebeb;
  --ds-surface-strong: #f5f5f5;
  --ds-surface-normal: #f7f8f9;
  --ds-surface-alternative: #ffffff;
  --ds-background-default: #ffffff;
  --ds-icon-strong: #333333;
  --ds-icon-normal: #969696;
  --ds-icon-disabled: #cccccc;

  /* Figma 보조 보라 (nebula-frontend global.css) */
  --ds-accent-purple: #8673ff;

  /* ── typography ── */
  --ds-font-sans: "Pretendard JP", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --ds-type-title-1-sb-font-size: 24px;
  --ds-type-title-1-sb-line-height: 1.28;
  --ds-type-title-2-sb-font-size: 20px;
  --ds-type-title-2-sb-line-height: 1.34;
  --ds-type-body-1-font-size: 16px;
  --ds-type-body-2-font-size: 14px;
  --ds-type-body-3-font-size: 13px;
  --ds-type-body-4-font-size: 12px;
  --ds-type-label-1-font-size: 11px;

  /* ── platform brand ── */
  --brand-google: #4285f4;
  --brand-meta: #0866ff;

  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 232px;
  --shadow-card: 0 1px 2px rgba(18, 18, 18, 0.04), 0 4px 12px rgba(18, 18, 18, 0.04);
  --focus-ring: 0 0 0 3px rgba(0, 153, 255, 0.18);
}

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

body {
  font-family: var(--ds-font-sans);
  font-size: var(--ds-type-body-2-font-size);
  line-height: 1.4;
  color: var(--ds-text-strong);
  background: var(--ds-surface-normal);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ── 스크롤바 (nebula-frontend 와 동일 룩) ───────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 8px; }
::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,.24); border-radius: 4px; }
::-webkit-scrollbar-track { background-color: rgba(0,0,0,.06); border-radius: 4px; }

/* ── 레이아웃 ────────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--ds-background-default);
  border-right: 1px solid var(--ds-line-normal);
  padding: 20px 12px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 20px; }
/* 파일러 심볼. 원본이 원형이라 라운딩·배경을 씌우지 않습니다. */
.brand__mark {
  width: 26px; height: 26px; flex: none; display: block;
}
/* 워드마크는 가로로 깁니다(약 2.6:1). 정사각형 크기를 그대로 주면 찌그러지므로
   높이만 맞추고 너비는 비율대로 둡니다. */
.brand__mark--wordmark {
  width: auto; height: 18px; max-width: 116px;
}
.brand__text { font-size: var(--ds-type-body-2-font-size); font-weight: 600; letter-spacing: -0.01em; }
.brand__sub { font-size: var(--ds-type-label-1-font-size); color: var(--ds-text-normal); margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: var(--radius);
  font-size: var(--ds-type-body-2-font-size); font-weight: 500;
  color: var(--ds-text-strong); transition: background .12s ease, color .12s ease;
}
.nav__item:hover { background: var(--ds-surface-normal); }
.nav__item.is-active { background: var(--ds-primary-blue-muted); color: var(--ds-primary-blue-hovered); font-weight: 600; }
.nav__icon { width: 16px; text-align: center; opacity: .85; }

.sidebar__foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--ds-line-normal); }
.sidebar__user { font-size: var(--ds-type-body-4-font-size); color: var(--ds-text-normal); margin-bottom: 8px; word-break: break-all; }

/* 화면 언어 (사이드바 하단·로그인 화면의 select). 고른 언어는 쿠키에 남습니다 (`/lang`). */
.lang-switch { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.lang-switch--center { justify-content: center; margin: 18px 0 0; }
.lang-switch__label { font-size: var(--ds-type-body-4-font-size); color: var(--ds-text-normal); white-space: nowrap; }
/* select 에 고정 높이(height)를 주면 WebKit 이 글자를 아래로 밀어 잘라 보입니다 — 패딩으로 크기를 잡습니다. */
.lang-switch__select { height: auto; padding: 5px 28px 5px 10px; line-height: 1.4; font-size: var(--ds-type-body-4-font-size); background-position: right 10px center; flex: 1; min-width: 0; }
.lang-switch--center .lang-switch__select { flex: none; width: 140px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--ds-background-default);
  border-bottom: 1px solid var(--ds-line-normal);
  padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar__title { font-size: var(--ds-type-title-2-sb-font-size); line-height: var(--ds-type-title-2-sb-line-height); font-weight: 600; }
.topbar__meta { font-size: var(--ds-type-body-4-font-size); color: var(--ds-text-normal); margin-top: 3px; }
.topbar__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.content { padding: 24px 28px 56px; }

/* ── 카드 ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--ds-background-default);
  border: 1px solid var(--ds-line-normal);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.card + .card { margin-top: 16px; }
.card__head {
  padding: 16px 20px; border-bottom: 1px solid var(--ds-line-normal);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card__title { font-size: var(--ds-type-body-1-font-size); font-weight: 600; }
.card__desc { font-size: var(--ds-type-body-4-font-size); color: var(--ds-text-normal); margin-top: 2px; }
.card__body { padding: 20px; }
.card__body--flush { padding: 0; }

/* ── KPI ────────────────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--ds-background-default); border: 1px solid var(--ds-line-normal);
  border-radius: var(--radius-lg); padding: 16px 18px;
}
.kpi__label { font-size: var(--ds-type-body-4-font-size); color: var(--ds-text-normal); }
.kpi__value { margin-top: 6px; font-size: var(--ds-type-title-1-sb-font-size); line-height: var(--ds-type-title-1-sb-line-height); font-weight: 600; letter-spacing: -0.02em; }
.kpi__value--accent { color: var(--ds-main-default); }
.kpi__hint { margin-top: 4px; font-size: var(--ds-type-label-1-font-size); color: var(--ds-text-normal); }

/* ── 버튼 ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--ds-surface-strong);
  font-size: var(--ds-type-body-2-font-size); font-weight: 500; color: var(--ds-text-strong);
  cursor: pointer; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { background: var(--ds-line-strong); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.btn--primary { background: var(--ds-primary-blue-normal); color: #fff; }
.btn--primary:hover { background: var(--ds-primary-blue-hovered); }
.btn--outline { background: transparent; border-color: var(--ds-line-strong); }
.btn--outline:hover { background: var(--ds-surface-normal); border-color: var(--ds-text-disabled); }
.btn--danger { background: transparent; border-color: var(--ds-primary-red-disabled); color: var(--ds-primary-red-normal); }
.btn--danger:hover { background: var(--ds-primary-red-muted); border-color: var(--ds-primary-red-normal); }
.btn--sm { height: 30px; padding: 0 10px; font-size: var(--ds-type-body-4-font-size); }
.btn--block { width: 100%; }
.btn:disabled { background: var(--ds-primary-blue-disabled); color: #fff; cursor: not-allowed; }

/* ── 폼 ─────────────────────────────────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field__label { display: block; font-size: var(--ds-type-body-3-font-size); font-weight: 600; margin-bottom: 6px; }
.field__label .req { color: var(--ds-primary-red-normal); margin-left: 2px; }
.field__hint { font-size: var(--ds-type-body-4-font-size); color: var(--ds-text-normal); margin-top: 6px; line-height: 1.5; }

.input, .textarea, .select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--ds-line-strong); border-radius: var(--radius);
  background: var(--ds-background-default); font-size: var(--ds-type-body-2-font-size);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--ds-main-default); box-shadow: var(--focus-ring);
}
.input::placeholder, .textarea::placeholder { color: var(--ds-text-disabled); }
.textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
.textarea--code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: var(--ds-type-body-4-font-size); min-height: 320px; line-height: 1.55;
}
.select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23969696' d='M6 8.5 2.5 5h7z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 20px; }
/* 표 안에서 펼치는 수정 줄. 칸이 좁아 form-grid 보다 작은 최소폭을 씁니다. */
.advedit > td { background: var(--ds-surface-alternative); }
.advedit__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 8px; padding-top: 4px; }

.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border: 1px solid var(--ds-line-strong); border-radius: 999px;
  font-size: var(--ds-type-body-3-font-size); cursor: pointer; user-select: none;
  transition: border-color .12s, background .12s, color .12s;
}
.check:hover { border-color: var(--ds-text-disabled); }
.check input { accent-color: var(--ds-main-default); cursor: pointer; margin: 0; }
.check:has(input:checked) {
  border-color: var(--ds-main-default); background: var(--ds-primary-blue-muted); color: var(--ds-primary-blue-hovered); font-weight: 600;
}

.switch-row { display: flex; align-items: center; gap: 10px; }

/* ── 테이블 ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 20px; text-align: left; vertical-align: middle; }
.table th {
  font-size: var(--ds-type-body-4-font-size); font-weight: 600; color: var(--ds-text-normal);
  background: var(--ds-surface-normal); border-bottom: 1px solid var(--ds-line-strong);
  white-space: nowrap;
}
.table td { border-bottom: 1px solid var(--ds-line-normal); font-size: var(--ds-type-body-3-font-size); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--ds-surface-normal); }
.table__num { text-align: right; font-variant-numeric: tabular-nums; }
.table__strong { font-weight: 600; color: var(--ds-text-strong); font-size: var(--ds-type-body-2-font-size); }
.table__muted { color: var(--ds-text-normal); }
.table__actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ── 배지 / 태그 ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px;
  font-size: var(--ds-type-label-1-font-size); font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.badge--new { background: var(--ds-primary-blue-muted); color: var(--ds-primary-blue-hovered); }
.badge--ok { background: var(--ds-primary-green-muted); color: var(--ds-primary-green-hovered); }
.badge--warn { background: #fff8e6; color: #9a6400; }
.badge--danger { background: var(--ds-primary-red-muted); color: var(--ds-primary-red-hovered); }
.badge--muted { background: var(--ds-surface-strong); color: var(--ds-text-normal); }
.badge--dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.tag {
  display: inline-flex; align-items: center; padding: 2px 7px; margin: 2px 3px 2px 0;
  background: var(--ds-surface-strong); border-radius: 5px;
  font-size: var(--ds-type-label-1-font-size); color: var(--ds-text-strong);
}

.pf { display: inline-flex; align-items: center; gap: 5px; font-size: var(--ds-type-body-4-font-size); font-weight: 500; white-space: nowrap; }
.pf__dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pf--google .pf__dot { background: var(--brand-google); }
.pf--meta .pf__dot { background: var(--brand-meta); }

/* ── 소재 그리드 ─────────────────────────────────────────────────────────── */
.creatives { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 14px; }
.creative {
  border: 1px solid var(--ds-line-normal); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--ds-background-default);
  display: flex; flex-direction: column; transition: box-shadow .14s ease, border-color .14s ease;
}
.creative:hover { border-color: var(--ds-line-strong); box-shadow: var(--shadow-card); }
.creative__thumb {
  aspect-ratio: 4 / 3; background: var(--ds-surface-normal);
  display: grid; place-items: center; overflow: hidden; position: relative;
}
/* 광고 소재는 잘리면 안 됩니다(문구가 핵심). cover 대신 contain 으로 전체를 보여줍니다. */
.creative__thumb img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  background: var(--ds-background-default);
}
.creative__thumb-empty {
  font-size: var(--ds-type-body-4-font-size); color: var(--ds-text-normal);
  text-align: center; line-height: 1.6;
}
/* 이미지 로드 실패 시 (참조 제한 등) */
.creative__thumb.is-broken::after {
  content: "이미지를 불러올 수 없습니다";
  font-size: var(--ds-type-label-1-font-size); color: var(--ds-text-disabled);
}
/* 텍스트 광고 미리보기 — 실제 검색광고처럼 보이게 */
.creative__thumb-text {
  width: 100%; height: 100%; padding: 14px 16px; background: var(--ds-background-default);
  display: flex; flex-direction: column; gap: 6px; justify-content: center; overflow: hidden;
}
.creative__thumb-text strong {
  font-size: var(--ds-type-body-3-font-size); font-weight: 600; color: #1a0dab; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.creative__thumb-text span {
  font-size: var(--ds-type-body-4-font-size); color: var(--ds-text-normal); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.creative__badge { position: absolute; top: 8px; left: 8px; }
.creative__body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.creative__adv { font-size: var(--ds-type-body-3-font-size); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creative__meta { font-size: var(--ds-type-label-1-font-size); color: var(--ds-text-normal); }
.creative__text {
  font-size: var(--ds-type-body-4-font-size); color: var(--ds-text-normal); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* 동영상 소재의 조회수 줄. 눈에 띄어야 하지만 광고 문구를 밀어내지 않게 한 줄. */
.creative__meta--video { color: var(--ds-main-default); font-weight: 600; line-height: 1.5; }
.creative__muted { color: var(--ds-text-normal); font-weight: 400; }
.creative__chan { color: var(--ds-text-normal); text-decoration: underline; }
.creative__chan:hover { color: var(--ds-main-default); }
/* 광고주가 붙인 태그. 개수가 많아 카드를 밀어내지 않게 한 줄로 접습니다. */
.creative__tags { display: flex; flex-wrap: wrap; gap: 4px; overflow: hidden; max-height: 22px; }
.creative__tag {
  padding: 1px 6px; border-radius: 4px; background: var(--ds-surface-alternative);
  color: var(--ds-text-normal); font-size: var(--ds-type-label-1-font-size); white-space: nowrap;
}
/* 영상 제목은 광고 문구보다 한 단계 약하게 — 소재의 문구가 먼저 읽혀야 합니다. */
.creative__text--muted { color: var(--ds-text-normal); -webkit-line-clamp: 1; }
.creative__link { margin-top: auto; padding-top: 6px; font-size: var(--ds-type-body-4-font-size); font-weight: 600; color: var(--ds-main-default); }
.creative__link:hover { color: var(--ds-primary-blue-hovered); }

/* ── 알림 / 빈 상태 ──────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
  font-size: var(--ds-type-body-3-font-size); border: 1px solid transparent; line-height: 1.5;
}
.alert--info { background: var(--ds-primary-blue-muted); border-color: var(--ds-primary-blue-disabled); color: var(--ds-primary-blue-hovered); }
.alert--success { background: var(--ds-primary-green-muted); border-color: var(--ds-primary-green-disabled); color: var(--ds-primary-green-hovered); }
.alert--warning { background: #fff8e6; border-color: #ffe2a6; color: #9a6400; }
.alert--danger { background: var(--ds-primary-red-muted); border-color: var(--ds-primary-red-disabled); color: var(--ds-primary-red-hovered); }

.empty { padding: 44px 20px; text-align: center; }
.empty__title { font-size: var(--ds-type-body-2-font-size); font-weight: 600; color: var(--ds-text-strong); }
.empty__desc { margin-top: 6px; font-size: var(--ds-type-body-3-font-size); color: var(--ds-text-normal); }
.empty__action { margin-top: 16px; }

/* ── 로그인 ──────────────────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--ds-surface-normal); }
.auth__card {
  width: 100%; max-width: 400px; background: var(--ds-background-default);
  border: 1px solid var(--ds-line-normal); border-radius: 16px;
  padding: 36px 32px; box-shadow: 0 4px 24px rgba(18,18,18,.06);
}
.auth__brand { display: flex; align-items: center; gap: 9px; margin-bottom: 26px; }
.auth__title { font-size: var(--ds-type-title-1-sb-font-size); line-height: var(--ds-type-title-1-sb-line-height); font-weight: 600; letter-spacing: -0.02em; }
.auth__desc { margin-top: 7px; font-size: var(--ds-type-body-3-font-size); color: var(--ds-text-normal); margin-bottom: 26px; }
.auth__foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--ds-line-normal); font-size: var(--ds-type-body-4-font-size); color: var(--ds-text-normal); line-height: 1.6; }

/* ── 유틸 ────────────────────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.text-muted { color: var(--ds-text-normal); }
.text-sm { font-size: var(--ds-type-body-4-font-size); }
.text-xs { font-size: var(--ds-type-label-1-font-size); }
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; font-size: var(--ds-type-body-4-font-size); }
/* `1fr` 은 최소 폭이 내용 폭이라, 표의 nowrap 칸이 카드보다 넓어지면 열이 밀려 **페이지가 가로로
   넘칩니다**(실측: 대시보드·모니터링 상세). minmax(0, 1fr) 로 두면 표는 카드 안(.table-wrap)에서 스크롤됩니다. */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--ds-line-normal); margin: 20px 0; }

@media (max-width: 960px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--ds-line-normal); }
  .nav { flex-direction: row; overflow-x: auto; }
  .sidebar__foot { margin-top: 12px; }
  .grid-2 { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
}

/* 광고주 선택 표 — 선택된 행 강조 */
.table tbody tr.is-selected { background: var(--ds-primary-blue-muted); }
.table tbody tr.is-selected:hover { background: var(--ds-primary-blue-muted); }
.table tbody tr.is-selected .adv-check {
  background: var(--ds-main-default) !important;
  border-color: var(--ds-main-default) !important;
}

/* ── 템플릿 편집: 왼쪽 편집 / 오른쪽 미리보기 ─────────────────────────────── */
.tpl-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tpl-split > form { min-width: 0; }
.tpl-preview { position: sticky; top: 16px; }
.input--sm { padding: 5px 8px; font-size: var(--ds-type-label-1-font-size); height: auto; }
/* 화면이 좁으면 위아래로 (미리보기가 눌리지 않게) */
@media (max-width: 1180px) {
  .tpl-split { grid-template-columns: minmax(0, 1fr); }
  .tpl-preview { position: static; }
}

/* ── 모니터링 등록: 등록된 광고주 다중 선택 ──────────────────────────────── */
.advpick {
  border: 1px solid var(--ds-line-strong); border-radius: var(--radius);
  max-height: 420px; overflow-y: auto; background: var(--ds-background-default);
}
.advpick__group + .advpick__group { border-top: 1px solid var(--ds-line-strong); }
.advpick__head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--ds-surface-normal);
  position: sticky; top: 0; z-index: 1;
  border-bottom: 1px solid var(--ds-line-normal);
}
.advpick__platform { font-size: var(--ds-type-body-3-font-size); font-weight: 600; }
.advpick__head .btn { margin-left: auto; }
.advpick__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--ds-line-normal);
}
.advpick__item:last-child { border-bottom: none; }
.advpick__item:hover { background: var(--ds-surface-normal); }
.advpick__item.is-picked { background: var(--ds-primary-blue-muted); }
.advpick__name { font-size: var(--ds-type-body-2-font-size); font-weight: 500; }
.advpick__id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--ds-type-label-1-font-size); color: var(--ds-text-normal);
  margin-left: auto; white-space: nowrap;
}
