:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-2: #f5f5f7;
  --border: #d9d9de;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-2: #1e8a3d;
  --danger: #d70015;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Pretendard", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 980px; margin: 0 auto; }
.icon { vertical-align: -3px; flex-shrink: 0; }

/* ---------- 좌측 사이드 내비게이션 ---------- */
.app-shell { display: flex; align-items: stretch; min-height: 100vh; }
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text);
  padding: 0 8px 16px; white-space: nowrap;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.sidebar-link:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.sidebar-link.active { background: rgba(0,113,227,0.1); color: var(--accent); font-weight: 600; }
.main-content { flex: 1; min-width: 0; padding: 32px 16px 80px; }

.sidebar-user {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.sidebar-user-email {
  font-size: 11.5px;
  color: var(--text);
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-role {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px 8px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 24px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
p.subtitle { color: var(--muted); margin-top: 0; margin-bottom: 24px; font-size: 14px; }

.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-header-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- 검색/입력 박스 ---------- */
.search-box {
  display: flex;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 14px;
  flex-wrap: wrap;
}
.search-box input {
  flex: 1;
  min-width: 200px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  padding: 10px 8px;
}
.search-box.batch {
  flex-direction: column;
  align-items: stretch;
}
.search-box.batch textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.6;
}
.search-box.batch button { align-self: flex-end; }
.search-box button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.search-box button:hover { opacity: 0.85; }
.search-box button:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

#status { margin-top: 12px; color: var(--muted); font-size: 13.5px; min-height: 20px; }
#status.error { color: var(--danger); }
#status.ok { color: var(--accent-2); }

.spinner {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 리스트(카드형 행) — 레거시 셀렉터, 새 media-card 도입 전 페이지 호환용 ---------- */
.video-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.video-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #f5b5b5;
  background: #fdeaea;
  color: var(--danger);
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  opacity: 1;
}
.delete-btn:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.video-row:hover { border-color: var(--accent); background: var(--panel-2); }
.video-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }

.metrics-row { display: flex; flex-wrap: wrap; gap: 20px 28px; }
.metric-block { flex: 0 1 auto; min-width: 100px; }
.metric-block.metric-products,
.metric-block.metric-competitors { flex: 1 1 160px; max-width: 320px; min-width: 0; }
.video-row.error-row {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: default;
  opacity: 0.7;
}
.video-row.error-row:hover { border-color: var(--danger); background: var(--panel); }
.video-row.error-row .error-message { flex: 1; }

.video-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}
.video-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.video-title-cell .title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-title-cell .platform {
  display: inline-block;
  background: rgba(0,113,227,0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 6px;
  margin-right: 6px;
}
.video-title-cell .style-badge { margin-top: 6px; }

.cell-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 3px;
}
.cell-value { font-size: 14px; }
.cell-value.exposure { color: var(--accent-2); font-weight: 700; }
.cell-value.empty { color: var(--muted); font-style: italic; }

/* ---------- 콘텐츠 성격(content_style) 뱃지 — 연한 파스텔 배경 + 진한 텍스트 ---------- */
.style-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.style-badge.style-ad { background: #fdeaea; color: #b3271f; border-color: #f5c6c6; }
.style-badge.style-solo { background: #fdf1d6; color: #92660a; border-color: #f0dba6; }
.style-badge.style-mixed { background: #e2f6e8; color: var(--accent-2); border-color: #bfe8cb; }
.style-badge.style-unclear { background: var(--panel-2); color: var(--muted); border-color: var(--border); }

.style-badge.audio-verbal { background: rgba(0,113,227,0.1); color: var(--accent); border-color: rgba(0,113,227,0.25); }
.style-badge.audio-nonverbal { background: var(--panel-2); color: var(--muted); border-color: var(--border); }
.style-badge.audio-dubbed { background: #fdecdc; color: #a85114; border-color: #f3d0ac; }
.style-badge.audio-unclear { background: var(--panel-2); color: var(--muted); border-color: var(--border); }

/* 등급(S/A/B/C/D) — 리스트에서 가장 먼저 눈에 띄어야 하는 뱃지 */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 700;
  border: 1px solid transparent;
  flex-shrink: 0;
}
.grade-badge.grade-s { background: #fdf1d6; color: #92660a; border-color: #f0dba6; }
.grade-badge.grade-a { background: #e2f6e8; color: var(--accent-2); border-color: #bfe8cb; }
.grade-badge.grade-b { background: rgba(0,113,227,0.1); color: var(--accent); border-color: rgba(0,113,227,0.25); }
.grade-badge.grade-c { background: #fdecdc; color: #a85114; border-color: #f3d0ac; }
.grade-badge.grade-d { background: #fdeaea; color: var(--danger); border-color: #f5c6c6; }
.grade-badge.small { width: auto; height: auto; padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.grade-badge.carousel-badge { background: var(--panel-2); color: var(--muted); border-color: var(--border); }

.style-badge.type-conversion { background: #f2e9fd; color: #6b2fb3; border-color: #ddc4f5; }
.style-badge.type-awareness { background: rgba(0,113,227,0.1); color: var(--accent); border-color: rgba(0,113,227,0.25); }
.style-badge.style-carousel { background: var(--panel-2); color: var(--muted); border-color: var(--border); }

.transcript-box {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 10px;
  white-space: pre-wrap;
}

.exposure-pct { color: var(--muted); font-size: 12px; margin-left: 4px; }

/* ---------- 노출 지표: %가 핵심, 초/전체길이는 보조 정보로 아래에 ---------- */
.exposure-pct-value {
  font-size: 21px;
  font-weight: 700;
  color: var(--accent-2);
  line-height: 1.15;
}
.exposure-pct-value .pct-sign { font-size: 13px; font-weight: 600; margin-left: 1px; }
.exposure-bar {
  width: 100%;
  max-width: 110px;
  height: 5px;
  background: #e5e5ea;
  border-radius: 999px;
  margin: 5px 0 4px;
  overflow: hidden;
}
.exposure-bar-fill { height: 100%; background: var(--accent-2); border-radius: 999px; }
.exposure-detail-text { font-size: 11.5px; color: var(--muted); }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

.engagement-line {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.engagement-line span { display: inline-flex; align-items: center; gap: 3px; }
.reasoning-text { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin-top: 8px; }

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.score-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.score-value { font-size: 17px; font-weight: 700; color: var(--text); }
.score-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- 대시보드: 막대 차트 ---------- */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 42px; align-items: center; gap: 10px; }
.bar-row-label {
  font-size: 13px; color: var(--text); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-row-label.wide { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.bar-track {
  height: 18px;
  background: var(--panel-2);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 0 4px 4px 0;
}
.bar-fill:not(.zero) { min-width: 3px; }
.bar-row-value {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-fill.grade-s { background: #D4A017; }
.bar-fill.grade-a { background: #22A55C; }
.bar-fill.grade-b { background: #0071E3; }
.bar-fill.grade-c { background: #E8720C; }
.bar-fill.grade-d { background: #D7263D; }
.bar-fill.type-conversion { background: #7C3AED; }
.bar-fill.type-awareness { background: #0071E3; }
.bar-fill.product-bar { background: #0071E3; }

.chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: top;
}
.chip.more { color: var(--muted); }
.chip.competitor { border-color: #f5c6c6; color: #b3271f; }

.error-message {
  font-size: 13px;
  color: var(--danger);
  grid-column: 2 / -1;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  margin-top: 20px;
}

/* ---------- 상세 페이지 ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
}
.back-link:hover { color: var(--text); text-decoration: none; }

.detail-hero {
  display: flex;
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  flex-wrap: wrap;
}
.detail-hero img {
  width: 220px;
  height: 124px;
  object-fit: cover;
  border-radius: 10px;
  background: #000;
  flex-shrink: 0;
}
.detail-hero .meta { flex: 1; min-width: 220px; }
.detail-hero h2 { margin: 6px 0 10px; font-size: 19px; font-weight: 600; line-height: 1.4; }
.detail-hero .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 4px; }
.detail-hero .platform-badge {
  display: inline-block;
  background: rgba(0,113,227,0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  margin-top: 22px;
}
.stat {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.stat .value { font-size: 19px; font-weight: 700; }
.stat .value.exposure { color: var(--accent-2); }
.stat .value.competitor { color: var(--danger); }
.stat .label { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 4px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-top: 18px;
}
.card h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.product-list { display: flex; flex-direction: column; gap: 8px; }
.product-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
}
.product-item.competitor { border-color: #f5c6c6; }
.product-empty { color: var(--muted); font-size: 14px; font-style: italic; }

.error-banner {
  background: #fdeaea;
  border: 1px solid #f5c6c6;
  color: #b3271f;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  margin-top: 18px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.evidence-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.evidence-table th, .evidence-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.evidence-table th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; }
.evidence-table td.yes { color: var(--accent-2); font-weight: 600; }
.evidence-table td.no { color: var(--muted); }
.evidence-wrap { overflow-x: auto; }

/* ---------- 반응형 ---------- */
@media (max-width: 720px) {
  .grade-badge { width: 36px; height: 36px; font-size: 15px; }
  .video-thumb { width: 40px; height: 40px; }
  .metric-block,
  .metric-block.metric-products,
  .metric-block.metric-competitors { flex-basis: 100%; max-width: none; }

  .detail-hero { flex-direction: column; }
  .detail-hero img { width: 100%; height: 180px; }

  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; overflow-x: auto;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 10px 12px;
  }
  .sidebar-brand { display: none; }
  .sidebar-link { flex-shrink: 0; }
}

/* ---------- Runs 목록 ---------- */
.run-list { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.run-row {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
}
.run-row:hover { border-color: var(--accent); background: var(--panel-2); text-decoration: none; }
.run-row-main { flex: 1; min-width: 0; }
.run-row-title { font-size: 14px; font-weight: 600; }
.run-row-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.run-row-stats { display: flex; gap: 10px; font-size: 12.5px; flex-shrink: 0; white-space: nowrap; }
.run-stat.ok { color: var(--accent-2); }
.run-stat.fail { color: var(--danger); }
.run-status-badge {
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: 999px; flex-shrink: 0; white-space: nowrap;
}
.run-status-badge.done { background: #e2f6e8; color: var(--accent-2); }
.run-status-badge.progress { background: rgba(0,113,227,0.1); color: var(--accent); }
.run-status-badge.paused { background: #fdf1d6; color: #92660a; }
.run-status-badge.stopped { background: var(--panel-2); color: var(--muted); }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.chart-grid .card { margin: 0; }
.chart-grid .card.wide { grid-column: 1 / -1; }
.chart-wrap { position: relative; height: 220px; }
.chart-wrap.donut { height: 240px; }
.chart-wrap.tall { height: 260px; }
.stat-sub.up { color: var(--accent-2); }
.stat-sub.down { color: var(--danger); }

@media (max-width: 720px) {
  .chart-grid { grid-template-columns: 1fr; }
}

.run-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 12px;
  margin-top: 16px;
}
.run-controls-text { color: var(--muted); font-size: 13.5px; display: flex; align-items: center; }
.run-controls-buttons { display: flex; gap: 8px; flex-shrink: 0; }

.ranking-section { margin-top: 28px; }
.ranking-section:first-child { margin-top: 8px; }
.ranking-section-title { font-size: 17px; font-weight: 600; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.ranking-section-sub { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.ranking-subsection-title { font-size: 13px; font-weight: 600; color: var(--danger); margin: 18px 0 8px; display: flex; align-items: center; gap: 6px; }
.ranking-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ranking-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
}
.ranking-row:hover { border-color: var(--accent); background: var(--panel-2); text-decoration: none; }
.ranking-row.bottom:hover { border-color: var(--danger); }
.ranking-rank { width: 34px; flex-shrink: 0; text-align: center; font-size: 14px; font-weight: 700; color: var(--accent); }
.ranking-rank.bottom { color: var(--danger); }
.ranking-row-body { flex: 1; min-width: 0; }
.ranking-row-title {
  font-size: 13.5px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.ranking-row-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.ranking-row-metric { flex-shrink: 0; text-align: center; min-width: 56px; }
.ranking-metric-value { font-size: 16px; font-weight: 700; color: var(--accent-2); }
.ranking-metric-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; justify-content: center; gap: 3px; }

.correct-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0,113,227,0.1);
  border: 1px solid rgba(0,113,227,0.25);
  border-radius: 6px;
  cursor: pointer;
  color: var(--accent);
  padding: 3px 6px;
  margin-left: 6px;
  vertical-align: middle;
}
.correct-btn:hover { background: rgba(0,113,227,0.18); }
.corrected-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px;
  font-weight: 600;
  background: #e2f6e8;
  color: var(--accent-2);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.correction-panel {
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 16px;
  margin: 16px 0;
}
.correction-panel-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.correction-panel-ai { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.correction-input-wrap select,
.correction-input-wrap textarea,
.correction-reason {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 8px;
  font-family: inherit;
}
.correction-reason { margin-top: 8px; min-height: 44px; resize: vertical; }
.correction-error { color: var(--danger); font-size: 12px; margin-top: 6px; }
.correction-panel-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

.review-flag-badge {
  display: inline-flex; align-items: center;
  background: #fdf1d6;
  color: #92660a;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
}

.run-filter {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  flex-shrink: 0;
}

/* 썸네일 카드 그리드 + 옆 상세 패널 — 크리에이터 발굴 / Runs 영상 목록 공용.
   마우스를 올리면 제목이 툴팁으로, 클릭하면 오른쪽에 패널이 열려 상세 정보를 보여준다. */
.list-with-panel {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.media-grid {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.media-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.media-card:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.media-card.error { opacity: 0.85; cursor: default; }
.media-thumb-wrap {
  position: relative;
  aspect-ratio: 9 / 16;
  background: #efeff1;
  cursor: pointer;
  overflow: hidden;
}
.media-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.15s ease; }
.media-thumb-wrap:hover img { transform: scale(1.04); }
.media-thumb-wrap.placeholder-wrap { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.media-thumb-wrap.placeholder-wrap .icon { width: 26px; height: 26px; }
.media-tooltip {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  background: rgba(0,0,0,0.82);
  color: #fff;
  font-size: 11.5px;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  z-index: 2;
}
.media-thumb-wrap:hover .media-tooltip { opacity: 1; transform: translateY(0); }
.media-badges {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  gap: 6px;
  z-index: 1;
}
.media-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 999px;
}
.media-grade-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  width: auto;
  height: auto;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 2;
}
.media-flag-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}
.media-delete-btn {
  display: inline-flex; align-items: center; justify-content: center;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.5);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.media-card:hover .media-delete-btn { opacity: 1; }
.media-delete-btn:hover { background: var(--danger); border-color: var(--danger); }
.media-card-footer {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.media-card-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.media-card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.media-error-message { font-size: 11.5px; color: var(--danger); padding: 0 10px 10px; line-height: 1.4; }

/* 옆 상세 패널 */
.side-panel-wrap {
  flex-shrink: 0;
  width: 0;
  overflow: hidden;
  transition: width 0.2s ease;
}
.side-panel-wrap.open { width: 320px; }
.side-panel {
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  position: sticky;
  top: 16px;
  margin-top: 20px;
}
.side-panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.side-panel-title { font-size: 14px; font-weight: 600; line-height: 1.4; }
.side-panel-close { display: inline-flex; align-items: center; justify-content: center; border: none; background: none; color: var(--muted); cursor: pointer; padding: 2px 6px; flex-shrink: 0; }
.side-panel-close:hover { color: var(--text); }
.side-panel-grade { display: inline-block; margin-bottom: 12px; }
.side-panel-table { width: 100%; font-size: 12.5px; border-collapse: collapse; }
.side-panel-table td { padding: 6px 0; vertical-align: top; }
.side-panel-table td:first-child { color: var(--muted); width: 90px; }
.side-panel-reasoning { display: flex; gap: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.5; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.side-panel-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 12.5px; }
.side-panel-video iframe { width: 100%; border-radius: 8px; display: block; }
.side-panel-actions { display: flex; gap: 8px; margin-top: 12px; }
.side-panel-actions .btn-secondary { flex: 1; justify-content: center; }

@media (max-width: 900px) {
  .list-with-panel { flex-direction: column; }
  .side-panel-wrap.open { width: 100%; }
  .side-panel { width: 100%; position: static; }
}

/* 크리에이터 발굴 — 플랫폼 선택 칩, grid/list 뷰 전환, 필터 패널 */
.platform-toggle-row { display: flex; gap: 8px; margin: 10px 0; }
.platform-chip {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.platform-chip.active { background: rgba(0,113,227,0.1); border-color: rgba(0,113,227,0.35); color: var(--accent); }

.discover-toolbar { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; flex-wrap: wrap; }
.discover-toolbar-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted); cursor: pointer;
}
.discover-toolbar-spacer { flex: 1; }

.filter-dropdown-wrap { position: relative; }
.filter-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 240px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 10;
}
.filter-panel-title { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin: 10px 0 6px; }
.filter-panel-title:first-child { margin-top: 0; }
.filter-check { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 3px 0; cursor: pointer; }
.filter-range-row { display: flex; align-items: center; gap: 6px; }
.filter-range-row input {
  width: 0; flex: 1; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 12.5px; padding: 6px 8px;
}
.filter-range-row span { color: var(--muted); font-size: 12px; }
.filter-reset {
  width: 100%; margin-top: 14px; padding: 7px; background: none; border: 1px solid var(--border);
  border-radius: 8px; color: var(--muted); font-size: 12.5px; cursor: pointer;
}
.filter-reset:hover { color: var(--text); border-color: var(--text); }

.view-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.view-toggle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: var(--panel); border: none; color: var(--muted); cursor: pointer;
}
.view-toggle-btn + .view-toggle-btn { border-left: 1px solid var(--border); }
.view-toggle-btn.active { background: rgba(0,113,227,0.1); color: var(--accent); }

.media-card-sub { font-size: 11px; color: var(--muted); }

.media-grid.list-view {
  grid-template-columns: 1fr;
  gap: 8px;
}
.media-grid.list-view .media-card { flex-direction: row; align-items: center; }
.media-grid.list-view .media-thumb-wrap { width: 56px; height: 80px; aspect-ratio: unset; flex-shrink: 0; }
.media-grid.list-view .media-tooltip { display: none; }
.media-grid.list-view .media-card-footer { flex: 1; min-width: 0; flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 14px; gap: 12px; }
.media-grid.list-view .media-card-name { -webkit-line-clamp: 1; }

.media-card-date { font-size: 10.5px; color: var(--muted); }

/* 활동 상태(관계 유지 필요 등) — 등급 배지와 같은 파스텔 톤 팔레트를 재사용해서 의미를 통일 */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.status-badge.status-active { background: #e2f6e8; color: var(--accent-2); }
.status-badge.status-cooling { background: #fdf1d6; color: #92660a; }
.status-badge.status-dormant { background: #fdeaea; color: var(--danger); }
.status-badge.status-none { background: var(--panel-2); color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* 앰버서더 목록 카드 */
.ambassador-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 20px; }
.ambassador-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.ambassador-card:hover { border-color: var(--accent); text-decoration: none; }
.ambassador-card-head { display: flex; align-items: center; gap: 10px; }
.ambassador-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(0,113,227,0.1); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex-shrink: 0;
}
.ambassador-name { font-size: 14.5px; font-weight: 600; color: var(--text); }
.ambassador-handle { font-size: 11.5px; color: var(--muted); }
.ambassador-stats-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.ambassador-note { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* 리스트 뷰 — 카드를 한 줄짜리 행으로 눌러서, 한 화면에서 더 많은 인원을 훑어볼 수 있게 한다 */
.ambassador-grid.list-view { grid-template-columns: 1fr; gap: 6px; }
.ambassador-grid.list-view .ambassador-card {
  flex-direction: row; align-items: center; padding: 10px 16px; gap: 20px;
}
.ambassador-grid.list-view .ambassador-card-head { flex: 0 0 220px; min-width: 0; }
.ambassador-grid.list-view .ambassador-name,
.ambassador-grid.list-view .ambassador-handle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ambassador-grid.list-view .ambassador-stats-row {
  flex: 0 0 auto; justify-content: flex-start; gap: 8px; white-space: nowrap;
}
.ambassador-grid.list-view .ambassador-stats-row.stats-row-main { flex: 1; min-width: 0; overflow: hidden; }
.ambassador-grid.list-view .ambassador-stats-row.stats-row-main span:first-child { overflow: hidden; text-overflow: ellipsis; }
.ambassador-grid.list-view .ambassador-stats-row.stats-row-meta,
.ambassador-grid.list-view .ambassador-stats-row.stats-row-activity { display: none; }
.ambassador-grid.list-view .ambassador-note { display: none; }

/* 인원 추가 패널 — 단건 입력 / CSV·시트 붙여넣기 탭 */
.add-ambassador-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin: 16px 0; }
.add-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.add-tab { padding: 8px 4px; margin-right: 16px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.add-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.add-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.add-form-grid input, .add-form-grid select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-2); color: var(--text); font-size: 13px; }
.add-form-full { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-2); color: var(--text); font-size: 13px; margin-bottom: 10px; box-sizing: border-box; }
.bulk-paste-area { width: 100%; min-height: 90px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); color: var(--text); font-size: 12.5px; font-family: monospace; resize: vertical; margin-bottom: 10px; box-sizing: border-box; }
.bulk-preview-table { width: 100%; font-size: 12px; border-collapse: collapse; margin-bottom: 10px; }
.bulk-preview-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--border); }
.bulk-preview-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); }
.bulk-preview-wrap { max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; }
.file-drop-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.add-form-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* 인원 상세 페이지 헤더 */
.ambassador-header { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ambassador-header-avatar { width: 56px; height: 56px; border-radius: 50%; background: rgba(0,113,227,0.1); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 19px; flex-shrink: 0; }
.ambassador-activity-stats { display: flex; gap: 20px; margin-top: 14px; flex-wrap: wrap; }
.ambassador-activity-stat { font-size: 12.5px; color: var(--muted); }
.ambassador-activity-stat b { color: var(--text); font-weight: 600; }
