/* BetterWeller 광고 대시보드 — Apple 디자인 시스템
   Action Blue #0066cc · Parchment #f5f5f7 · 17px body · SF Pro · 단일 accent · 거의 무 그림자 */

/* ───── Tokens ───── */
:root {
  --primary: #0066cc;
  --primary-focus: #0071e3;
  --primary-on-dark: #2997ff;
  --canvas: #ffffff;
  --canvas-parchment: #f5f5f7;
  --surface-pearl: #fafafc;
  --surface-tile-1: #272729;
  --surface-black: #000000;
  --ink: #1d1d1f;
  --ink-muted-80: #333333;
  --ink-muted-48: #7a7a7a;
  --hairline: #e0e0e0;
  --divider-soft: rgba(0, 0, 0, 0.08);
  --bb: #c9802b;
  --ep: #2c8c5c;
  --d3: #d4a72c;
  --good: #1f8f4f;
  --bad: #c4341f;
  --neutral: #6b6b6f;
  --rounded-sm: 8px;
  --rounded-md: 11px;
  --rounded-lg: 18px;
  --rounded-pill: 9999px;
  --shadow-product: rgba(0, 0, 0, 0.22) 3px 5px 30px 0;
  --sp-xxs: 4px;
  --sp-xs: 6px;
  --sp-sm: 10px;
  --sp-md: 14px;
  --sp-lg: 18px;
  --sp-xl: 24px;
  --sp-xxl: 32px;
  --sp-section: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "SF Pro Text", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.018em;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ───── Full-bleed tile bands (compact) ───── */
.tile {
  width: 100%;
  padding: 36px 24px;
}
.tile.compact { padding: 24px 24px; }
.tile.parchment { background: var(--canvas-parchment); }
.tile.white { background: var(--canvas); }
.tile.dark { background: var(--surface-tile-1); color: #fff; }
.tile.dark a, .tile.dark .text-link { color: var(--primary-on-dark); }
.tile .container { max-width: 1200px; margin: 0 auto; }
@media (min-width: 1024px) { .tile { padding: 44px 24px; } }
@media (max-width: 640px)  { .tile, .tile.compact { padding: 24px 16px; } }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em;
  background: var(--canvas-parchment); padding: 0.1em 0.35em; border-radius: var(--rounded-sm); }
pre code { background: transparent; padding: 0; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; }

/* ───── Top nav (Apple global-nav) ───── */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface-black);
  height: 44px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 var(--sp-lg);
  font-size: 12px; letter-spacing: -0.01em;
}
.topnav .inner {
  width: 100%; max-width: 1200px;
  display: flex; align-items: center; gap: var(--sp-lg);
}
.topnav .brand {
  color: #fff; font-weight: 600; letter-spacing: -0.011em;
  font-size: 14px; margin-right: auto;
}
.topnav a {
  color: #f5f5f7; opacity: 0.85;
  padding: 6px 10px; border-radius: var(--rounded-sm);
  transition: opacity 0.15s;
}
.topnav a:hover { opacity: 1; text-decoration: none; }
.topnav a.active { opacity: 1; color: #fff; font-weight: 600; }

/* ───── Sub-nav (frosted parchment) ───── */
.subnav {
  position: sticky; top: 44px; z-index: 40;
  background: rgba(245, 245, 247, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--divider-soft);
  height: 52px;
  display: flex; align-items: center;
  padding: 0 var(--sp-lg);
}
.subnav .inner { width: 100%; max-width: 1200px; display: flex; align-items: center; gap: var(--sp-lg); margin: 0 auto; }
.subnav .scope {
  font-size: 16px; font-weight: 600; letter-spacing: -0.011em;
  color: var(--ink);
}
.subnav .right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-sm); }

/* ───── Period selector ───── */
.period-bar {
  display: flex; align-items: center; gap: var(--sp-sm); flex-wrap: wrap;
  font-size: 13px; letter-spacing: -0.014em;
}
.period-bar .label { color: var(--ink-muted-48); }
.period-bar select {
  appearance: none; -webkit-appearance: none;
  font-family: inherit; font-size: 13px;
  padding: 5px 28px 5px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-pill);
  background: var(--canvas) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%231d1d1f' d='M0 0l5 6 5-6z'/></svg>") no-repeat right 12px center;
  color: var(--ink);
  cursor: pointer;
}
.period-bar select:focus { outline: 2px solid var(--primary-focus); outline-offset: 2px; }
.period-bar .range { color: var(--ink-muted-48); margin-left: auto; font-variant-numeric: tabular-nums; }

/* ───── Calendar week-picker (replaces native select) ───── */
.cal-hidden-select { display: none !important; }
.cal-picker { position: relative; display: inline-block; font-size: 13px; }
.cal-trigger {
  appearance: none; -webkit-appearance: none;
  font-family: inherit; font-size: 13px; line-height: 1;
  padding: 6px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-pill);
  background: var(--canvas);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: border-color 0.12s;
}
.cal-trigger:hover { border-color: var(--ink-muted-48); }
.cal-trigger:focus-visible { outline: 2px solid var(--primary-focus); outline-offset: 2px; }
.cal-trigger .cal-icon { font-size: 12px; }
.cal-trigger .cal-label { font-weight: 500; }
.cal-trigger .cal-label.muted { font-weight: 400; color: var(--ink-muted-48); }
.cal-trigger .cal-range { color: var(--ink-muted-48); font-variant-numeric: tabular-nums; }
.cal-trigger.empty { color: var(--ink-muted-48); }

.cal-popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  padding: 14px;
  width: 308px;
}
.cal-popover[hidden] { display: none; }
.cal-picker.compare .cal-popover { left: auto; right: 0; }

.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.cal-title { font-weight: 600; font-size: 14px; letter-spacing: -0.012em; }
.cal-nav {
  background: transparent; border: 1px solid var(--hairline);
  border-radius: var(--rounded-sm);
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); font-size: 16px; line-height: 1;
  padding: 0;
}
.cal-nav:hover { background: var(--canvas-parchment); }
.cal-nav:focus-visible { outline: 2px solid var(--primary-focus); outline-offset: 2px; }

.cal-clear-week {
  display: block; width: 100%;
  margin-bottom: 8px;
  padding: 7px 12px;
  font-family: inherit; font-size: 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-sm);
  background: var(--canvas);
  color: var(--ink-muted-48);
  text-align: left;
  cursor: pointer;
}
.cal-clear-week:hover { background: var(--canvas-parchment); }
.cal-clear-week.active {
  background: var(--primary); color: #fff;
  border-color: var(--primary); font-weight: 500;
}

.cal-grid {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  font-variant-numeric: tabular-nums;
  table-layout: fixed;
}
.cal-grid th {
  font-weight: 500; font-size: 11px;
  color: var(--ink-muted-48);
  padding: 4px 0;
  text-align: center;
}
.cal-grid td {
  text-align: center;
  padding: 1px 0;
  height: 32px;
}
.cal-grid td span {
  display: inline-flex; width: 30px; height: 28px;
  align-items: center; justify-content: center;
  border-radius: var(--rounded-sm);
  font-size: 12px;
  color: var(--ink);
  position: relative;
}
.cal-grid td.other span { color: var(--ink-muted-48); opacity: 0.4; }
.cal-grid td.today span::after {
  content: ''; position: absolute; bottom: 3px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--primary);
}
.cal-week.has-data { cursor: pointer; }
.cal-week.has-data:hover td span { background: var(--canvas-parchment); }
.cal-week.no-data td:not(.other) span { color: var(--ink-muted-48); opacity: 0.4; }
.cal-week.no-data { cursor: default; }
.cal-week.selected td span { background: var(--primary); color: #fff; }
.cal-week.selected td.today span::after { background: #fff; }
.cal-week.selected.has-data:hover td span { background: var(--primary-focus); }

.cal-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
  font-size: 11px; color: var(--ink-muted-48);
  display: flex; align-items: center; gap: 6px;
}
.cal-foot .cal-dot {
  display: inline-block; width: 8px; height: 8px;
  background: var(--primary); border-radius: 50%;
}

@media (max-width: 640px) {
  .cal-popover { width: 280px; padding: 12px; }
  .cal-trigger .cal-range { display: none; }
}

/* ───── Buttons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: 13px; font-weight: 500; letter-spacing: -0.014em;
  border: none; border-radius: var(--rounded-pill);
  padding: 8px 18px;
  transition: transform 0.1s ease;
  cursor: pointer;
}
.btn:active { transform: scale(0.95); }
.btn:focus-visible { outline: 2px solid var(--primary-focus); outline-offset: 2px; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { text-decoration: none; }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn.utility { background: var(--ink); color: #fff; font-size: 14px; padding: 8px 15px; border-radius: var(--rounded-sm); }
.btn.compare-clear {
  background: transparent; color: var(--ink-muted-48);
  font-size: 13px; padding: 6px 12px; border: 1px solid var(--hairline);
  border-radius: var(--rounded-pill);
}
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ───── Hero (compact) ───── */
.hero {
  padding: 36px 24px 20px;
  background: var(--canvas);
}
.hero .inner { max-width: 1200px; margin: 0 auto; }
.hero h1 {
  font-family: "SF Pro Display", system-ui, -apple-system, sans-serif;
  font-size: 28px; font-weight: 600; line-height: 1.15;
  letter-spacing: -0.014em;
  margin: 0 0 6px;
}
.hero .sub {
  font-size: 14px; font-weight: 400; line-height: 1.4;
  letter-spacing: -0.014em;
  color: var(--ink-muted-48);
  margin: 0;
  max-width: 720px;
}
@media (max-width: 640px) {
  .hero { padding: 24px 16px 14px; }
  .hero h1 { font-size: 22px; }
  .hero .sub { font-size: 13px; }
}

/* ───── Section title ───── */
.section-title {
  font-family: "SF Pro Display", system-ui, sans-serif;
  font-size: 20px; font-weight: 600; line-height: 1.20;
  letter-spacing: -0.012em;
  margin: 0 auto var(--sp-md);
  max-width: 1200px;
  padding: 0;
}
.section-title .hint {
  font-size: 12px; font-weight: 400; color: var(--ink-muted-48);
  margin-left: var(--sp-xs); letter-spacing: -0.014em;
}
@media (max-width: 640px) {
  .section-title { font-size: 17px; margin-bottom: var(--sp-sm); }
  .section-title .hint { font-size: 11px; display: block; margin-left: 0; margin-top: 2px; }
}

/* ───── KPI grid (compact) ───── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}
.kpi {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
  min-height: auto;
}
.tile.parchment .kpi { background: var(--canvas); }
.tile.white .kpi { background: var(--canvas-parchment); border-color: transparent; }
.kpi .lbl {
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--ink-muted-48);
}
.kpi .val {
  font-family: "SF Pro Display", system-ui, sans-serif;
  font-size: clamp(17px, 1.2vw + 5px, 20px);
  font-weight: 600; line-height: 1.15;
  letter-spacing: -0.012em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: var(--sp-xs); flex-wrap: wrap;
  word-break: keep-all;
}
.kpi .compare-prev {
  font-size: 11px; color: var(--ink-muted-48); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}
.kpi.accent .val { color: var(--primary); }
@media (max-width: 640px) {
  .kpi { padding: 12px 14px; }
  .kpi .val { font-size: 16px; }
}

.delta {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 12px; font-weight: 600; letter-spacing: -0.01em;
  padding: 2px 8px; border-radius: var(--rounded-pill);
  background: var(--canvas-parchment);
  color: var(--neutral);
  font-variant-numeric: tabular-nums;
}
.delta.up { color: var(--good); }
.delta.up.bad { color: var(--bad); }
.delta.down { color: var(--bad); }
.delta.down.good { color: var(--good); }
.delta.flat { color: var(--neutral); }

/* ───── Channel grid (compact) ───── */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}
.channel-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 16px 18px;
}
.tile.white .channel-card { background: var(--canvas-parchment); border-color: transparent; }
.channel-card .name {
  font-size: 14px; font-weight: 600; letter-spacing: -0.011em;
  margin-bottom: 10px;
}
.channel-card.naver-sa .name::before { content: '🔍 '; }
.channel-card.naver-power .name::before { content: '📰 '; }
.channel-card.meta-da .name::before { content: '📱 '; }
.channel-card .metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-xs);
}
.channel-card .metric .lbl { font-size: 10px; color: var(--ink-muted-48); letter-spacing: 0.02em; text-transform: uppercase; }
.channel-card .metric .val {
  font-family: "SF Pro Display", system-ui, sans-serif;
  font-size: 16px; font-weight: 600; letter-spacing: -0.012em;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 3px; flex-wrap: wrap;
  margin-top: 2px;
}

/* ───── Card / charts (compact) ───── */
.row {
  display: grid; gap: 14px;
  max-width: 1200px; margin: 0 auto;
  padding: 0;
}
.row.cols-2 { grid-template-columns: 1fr; }
.row.cols-3 { grid-template-columns: 1fr; }
@media (min-width: 834px) {
  .row.cols-2 { grid-template-columns: 1fr 1fr; }
  .row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 18px 20px;
}
.tile.white .card { background: var(--canvas-parchment); border-color: transparent; }
.card h2 {
  font-family: "SF Pro Display", system-ui, sans-serif;
  font-size: 15px; font-weight: 600; letter-spacing: -0.011em;
  margin: 0 0 6px;
}
.card .hint { font-size: 12px; color: var(--ink-muted-48); margin: 0 0 10px; letter-spacing: -0.012em; }

/* ───── Action panel (compact) ───── */
.action-panel {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 20px 24px;
  max-width: 1200px; margin: 0 auto;
}
.tile.white .action-panel { background: var(--canvas-parchment); border-color: transparent; }
.action-panel h2 {
  font-family: "SF Pro Display", system-ui, sans-serif;
  font-size: 17px; font-weight: 600; line-height: 1.20;
  letter-spacing: -0.011em;
  margin: 0 0 10px;
}
@media (max-width: 640px) { .action-panel { padding: 16px 18px; } .action-panel h2 { font-size: 15px; } }
.action-list { list-style: none; padding: 0; margin: 0; counter-reset: a; }
.action-list li {
  counter-increment: a;
  display: grid; grid-template-columns: 24px 1fr auto; gap: var(--sp-sm);
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider-soft);
}
.action-list li:last-child { border-bottom: none; }
.action-list li::before {
  content: counter(a);
  width: 22px; height: 22px;
  border-radius: var(--rounded-pill);
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.action-list .title { font-size: 14px; font-weight: 600; letter-spacing: -0.014em; margin-bottom: 3px; line-height: 1.35; }
.action-list .why { font-size: 12px; color: var(--ink-muted-80); letter-spacing: -0.012em; line-height: 1.5; }
.action-list .priority {
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: var(--rounded-pill);
  text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--canvas-parchment); color: var(--ink-muted-80);
  white-space: nowrap;
}
.action-list .priority.high { background: #ffe5e0; color: var(--bad); }
.action-list .priority.med { background: #fff3d4; color: #8a6d00; }

/* ───── Product cards (compact) ───── */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}
@media (min-width: 834px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
.product-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.tile.white .product-card { background: var(--canvas-parchment); border-color: transparent; }
.product-card .head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 8px; border-bottom: 1px solid var(--divider-soft);
}
.product-card .name {
  font-family: "SF Pro Display", system-ui, sans-serif;
  font-size: 18px; font-weight: 600; letter-spacing: -0.012em;
}
.product-card .short {
  font-size: 10px; font-weight: 600; letter-spacing: 0.03em;
  color: var(--ink-muted-48);
  margin-left: 4px;
}
.product-card .roas {
  font-family: "SF Pro Display", system-ui, sans-serif;
  font-size: 22px; font-weight: 600; letter-spacing: -0.014em;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.product-card .roas .roas-lbl {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--ink-muted-48); margin-right: 6px;
  text-transform: uppercase; vertical-align: 0.2em;
}
.product-card.bb .name { color: var(--bb); }
.product-card.ep .name { color: var(--ep); }
.product-card.d3 .name { color: var(--d3); }
.product-card .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.product-card .stats > div .lbl { font-size: 10px; color: var(--ink-muted-48); letter-spacing: 0.02em; text-transform: uppercase; }
.product-card .stats > div .val {
  font-family: "SF Pro Display", system-ui, sans-serif;
  font-size: 13px; font-weight: 600; letter-spacing: -0.014em;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 3px; flex-wrap: wrap;
  margin-top: 1px;
}
.product-card .insight-block { padding: 6px 0; }
.product-card .insight-block .label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-muted-48); margin-bottom: 3px;
}
.product-card .insight-block.empty .label { opacity: 0.5; }
.product-card .insight-block .text {
  font-size: 12px; line-height: 1.5; letter-spacing: -0.012em;
  color: var(--ink-muted-80);
  white-space: pre-line;
}
.product-card .insight-block.empty .text { color: var(--ink-muted-48); font-style: italic; }
.product-card .direction {
  margin-top: auto;
  padding: 10px 12px;
  background: var(--canvas-parchment);
  border-radius: var(--rounded-sm);
  border-left: 3px solid var(--primary);
}
.product-card .direction .label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 2px;
}
.product-card .direction .text {
  font-size: 12px; line-height: 1.5; color: var(--ink); letter-spacing: -0.012em;
  white-space: pre-line;
}

/* ───── Tables (compact) ───── */
.tbl {
  width: 100%; border-collapse: collapse;
  font-size: 13px; letter-spacing: -0.014em;
  font-variant-numeric: tabular-nums;
}
.tbl th, .tbl td {
  text-align: left; padding: 7px 10px;
  border-bottom: 1px solid var(--divider-soft);
}
.tbl th {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-muted-48);
  border-bottom-color: var(--hairline);
  cursor: pointer; user-select: none;
  transition: background 0.12s;
}
.tbl th:hover { background: rgba(0, 102, 204, 0.06); color: var(--ink); }
.tbl th.sort-asc::after { content: ' ▲'; font-size: 9px; opacity: 0.6; margin-left: 2px; }
.tbl th.sort-desc::after { content: ' ▼'; font-size: 9px; opacity: 0.6; margin-left: 2px; }
.tbl tbody tr:hover { background: rgba(0, 102, 204, 0.03); }
.tbl td.num { text-align: right; }
.tbl td.muted { color: var(--ink-muted-48); }
.tbl .pos { color: var(--good); font-weight: 600; }
.tbl .neg { color: var(--bad); font-weight: 600; }
.timeline tbody tr.current { background: rgba(0, 102, 204, 0.04); }

.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 스크롤 가능한 표 — 약 5행 보이고 나머지는 세로 스크롤 (소재 셀 78px × 5행 + 헤더 ≈ 460px) */
.tbl-wrap.scroll-5 { max-height: 460px; overflow-y: auto; }
.tbl-wrap.scroll-15 { max-height: 760px; overflow-y: auto; }
.tbl-wrap.scroll-5 thead th, .tbl-wrap.scroll-15 thead th { position: sticky; top: 0; background: #fafafa; z-index: 1; }
.scroll-hint { font-size: 11px; color: var(--ink-muted-48); text-align: right; margin: 4px 0 0; }

/* ───── 추천 키워드 ───── */
.rec-block { margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--hairline); }
.rec-section { margin-top: 16px; }
.rec-section h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.rec-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.rec-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 14px;
  background: #f5f5f7; color: var(--ink); font-size: 13px;
  border: 1px solid var(--hairline);
}
.rec-chip.is-new { background: rgba(0, 102, 204, 0.06); border-color: rgba(0, 102, 204, 0.18); }
.rec-badge {
  font-size: 9px; font-weight: 600; letter-spacing: 0.04em;
  padding: 1px 5px; border-radius: 8px;
  background: var(--primary); color: #fff; text-transform: uppercase;
}

/* ───── 분석 결과 영속화 상태 ───── */
.publish-status { margin-top: 12px; font-size: 13px; line-height: 1.5; }
.publish-status:empty { display: none; }
.publish-status.pending { color: var(--ink-muted); }
.publish-status.ok { color: #1b7c2e; }
.publish-status.warn { color: #b35900; }
.publish-status .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; margin-right: 6px; opacity: 0.6;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }
.publish-status code { background: rgba(0,0,0,0.05); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* ───── Banners ───── */
.banner-warn, .banner-info {
  max-width: 1200px; margin: 0 auto var(--sp-lg);
  padding: var(--sp-md) var(--sp-lg);
  border-radius: var(--rounded-md);
  font-size: 14px; letter-spacing: -0.016em;
}
.banner-warn { background: #fff3d4; color: #6d5300; border: 1px solid #f1d683; }
.banner-info { background: #e8f0fe; color: #1a3a78; border: 1px solid #b3cde6; }

/* ───── Empty state ───── */
.empty-state {
  text-align: center; padding: var(--sp-xxl) var(--sp-lg);
  color: var(--ink-muted-48);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-lg);
  max-width: 1200px; margin: 0 auto;
}
.empty-state { padding: var(--sp-lg) var(--sp-md); border-radius: var(--rounded-md); }
.empty-state .icon { font-size: 28px; margin-bottom: var(--sp-xs); opacity: 0.5; }

/* ───── Upload page (compact) ───── */
.dropzone-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 1200px; margin: 0 auto;
  padding: 0;
}
@media (min-width: 700px) { .dropzone-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .dropzone-grid { grid-template-columns: repeat(4, 1fr); } }
.dropzone-col { display: flex; flex-direction: column; gap: 6px; }
.dropzone {
  position: relative;
  background: var(--canvas);
  border: 1.5px dashed var(--hairline);
  border-radius: var(--rounded-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-height: 180px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.dropzone:hover { border-color: var(--primary); background: var(--surface-pearl); }
.dropzone.dragover { border-color: var(--primary); border-style: solid; background: rgba(0, 102, 204, 0.04); }
.dropzone .icon { font-size: 28px; margin-bottom: 4px; line-height: 1; }
.dropzone .title {
  font-family: "SF Pro Display", system-ui, sans-serif;
  font-size: 14px; font-weight: 600; letter-spacing: -0.011em;
  color: var(--ink); margin-bottom: 2px;
}
.dropzone .desc {
  font-size: 11px; line-height: 1.45; letter-spacing: -0.012em;
  color: var(--ink-muted-48);
}
.dropzone .desc code { font-size: 10px; }
.dropzone .browse {
  display: inline-block; margin-top: 8px;
  font-size: 11px; color: var(--primary);
  border: 1px solid var(--primary); border-radius: var(--rounded-pill);
  padding: 4px 12px;
}
.dropzone input[type="file"] { display: none; }
.dropzone .zone-count {
  position: absolute; top: 12px; right: 12px;
  background: var(--primary); color: #fff;
  width: 24px; height: 24px; border-radius: var(--rounded-pill);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.upload-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.upload-item {
  display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: var(--sp-sm);
  padding: 8px 12px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-md);
  font-size: 13px;
}
.upload-item .name {
  font-weight: 600; letter-spacing: -0.016em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.upload-item .meta { font-size: 11px; color: var(--ink-muted-48); margin-top: 2px; }
.upload-item button {
  background: transparent; border: none; color: var(--ink-muted-48);
  padding: 4px 8px; border-radius: var(--rounded-pill); cursor: pointer;
}
.upload-item button:hover { color: var(--bad); background: var(--canvas-parchment); }

.upload-actions {
  display: flex; gap: var(--sp-xs); justify-content: center;
  margin: var(--sp-md) auto;
  max-width: 1200px;
  padding: 0;
}

.guide-card {
  background: var(--canvas-parchment);
  border: 1px solid transparent;
  border-radius: var(--rounded-md);
  padding: 20px 24px;
  max-width: 1200px; margin: 0 auto;
}
.guide-card h2 {
  font-family: "SF Pro Display", system-ui, sans-serif;
  font-size: 16px; font-weight: 600; letter-spacing: -0.011em;
  margin: 0 0 8px;
}
.guide-card ol { font-size: 13px; line-height: 1.6; padding-left: 1.4em; margin: 0; }
.guide-card ol li { margin-bottom: 4px; }
@media (max-width: 640px) {
  .guide-card { padding: 16px 18px; }
  .guide-card h2 { font-size: 15px; }
}
.guide-card pre {
  background: var(--canvas); padding: 10px;
  border-radius: var(--rounded-sm);
  font-size: 11px; overflow-x: auto;
  margin: 4px 0;
}

/* ───── Prose (마크다운 인사이트 본문) ───── */
.prose { font-size: 13px; line-height: 1.6; color: var(--ink); letter-spacing: -0.012em; }
.prose h2 { font-size: 17px; font-weight: 600; margin: 18px 0 10px; letter-spacing: -0.012em; }
.prose h3 { font-size: 15px; font-weight: 600; margin: 14px 0 8px; letter-spacing: -0.012em; color: var(--ink); }
.prose h4 { font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
.prose p { margin: 0 0 10px; }
.prose ul, .prose ol { margin: 0 0 10px; padding-left: 22px; }
.prose ul ul, .prose ol ol, .prose ul ol, .prose ol ul { margin: 4px 0; }
.prose li { margin-bottom: 4px; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose code { font-size: 12px; padding: 1px 6px; background: var(--canvas-parchment); border-radius: 4px; }
.prose table { border-collapse: collapse; margin: 8px 0 12px; font-size: 12px; }
.prose th, .prose td { padding: 6px 10px; border-bottom: 1px solid var(--divider-soft); text-align: left; }
.prose th { font-weight: 600; color: var(--ink-muted-48); border-bottom-color: var(--hairline); }
.prose hr {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 22px 0;
}

/* ───── Footer ───── */
.ftr {
  background: var(--canvas-parchment);
  padding: var(--sp-lg) var(--sp-lg);
  text-align: center;
  font-size: 11px; color: var(--ink-muted-48); letter-spacing: -0.01em;
}
.ftr code { background: transparent; }

/* ───── Responsive ───── */
@media (max-width: 640px) {
  .topnav { padding: 0 var(--sp-md); }
  .topnav .brand { font-size: 13px; }
  .topnav a { padding: 6px 6px; font-size: 11px; }
}

/* ───── Creative thumbnail + modal ───── */
.creative-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0; border: 1px solid var(--hairline);
  background: #fafafa; border-radius: 6px; cursor: pointer; overflow: hidden;
  transition: transform 0.1s ease, border-color 0.1s ease;
}
.creative-btn:hover { transform: scale(1.05); border-color: var(--ink-muted); }
.creative-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.creative-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000;
  display: none; align-items: flex-start; justify-content: center;
  padding: 5vh 4vw; overflow-y: auto;
}
.creative-modal.open { display: flex; }
.creative-modal-card {
  background: #fff; border-radius: 10px; max-width: 700px; width: 100%;
  padding: 24px; position: relative; box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px;
  border: none; background: transparent; cursor: pointer; font-size: 24px;
  color: var(--ink-muted); border-radius: 50%;
}
.modal-close:hover { background: var(--bg-soft); }
.modal-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--hairline);
}
.modal-media { text-align: center; margin-bottom: 16px; }
.modal-media img, .modal-media video { border-radius: 6px; }
.modal-meta > div { padding: 8px 0; border-bottom: 1px dashed var(--hairline); }
.modal-meta > div:last-child { border-bottom: none; }
.modal-meta .lbl { display: block; font-size: 11px; color: var(--ink-muted-48); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.modal-meta .val { font-size: 14px; line-height: 1.5; }
.carousel-wrap {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.carousel-slide {
  border: 1px solid var(--hairline); border-radius: 6px; overflow: hidden; background: #fafafa;
}
.carousel-slide img { width: 100%; display: block; aspect-ratio: 1/1; object-fit: cover; }
.carousel-meta { padding: 8px 10px; font-size: 12px; line-height: 1.4; }

/* ───── Utility ───── */
.muted { color: var(--ink-muted-48); }
.tabular { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.stack-sm { display: flex; flex-direction: column; gap: var(--sp-sm); }
.stack-md { display: flex; flex-direction: column; gap: var(--sp-md); }
