/* Wondig v2.5 — 브랜드 토큰 (원본: rabbit/wondig-brand) */
:root {
  color-scheme: light;
  --bg: #FAF8F2;            /* Warm Cream */
  --surface: #FFFFFF;       /* 패널 */
  --surface-2: #F2EFE7;
  --ink: #171717;           /* Ink */
  --ink-2: #525252;
  --muted: #6E6A62;
  --line: #DAD5CB;
  --line-2: #C6C0B4;
  --accent: #146A68;        /* Deep Teal — 링크·선택 */
  --accent-ink: #146A68;
  --accent-wash: rgba(20, 106, 104, 0.10);
  --primary: #171717;       /* 주요 버튼 */
  --primary-ink: #FAF8F2;
  --good: #2E8B45; --good-ink: #1F6B34;
  --warn: #D9961A; --warn-ink: #855700;
  --bad: #C4473D; --bad-ink: #A2362D;
  /* 등급: 딥 틸 한 색 계열 (C → S 진해짐) */
  /* 등급색: S·A·B는 서로 다른 색상(전체 쌍 색각 검증 통과), C는 배경 역할의 중립 회색 */
  --g-S: #EB6834; --g-A: #2A78D6; --g-B: #1BAF7A; --g-C: #C4BFB4; --g-none: #DAD5CB;
  --g-S-ink: #171717; --g-A-ink: #FFFFFF; --g-B-ink: #171717; --g-C-ink: #171717;
  --bar-muted: #BCDAD6;
  --shadow: 0 1px 2px rgba(23,23,23,.04), 0 8px 24px rgba(23,23,23,.05);
  --radius: 12px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --font-display: Manrope, "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121211; --surface: #1B1A18; --surface-2: #24231F;
    --ink: #F2EFE8; --ink-2: #BDB8AE; --muted: #928D83;
    --line: #2E2C28; --line-2: #3D3B35;
    --accent: #5FB8B2; --accent-ink: #7CCBC5; --accent-wash: rgba(95, 184, 178, 0.14);
    --primary: #FAF8F2; --primary-ink: #171717;
    --good: #4FB86A; --good-ink: #6FCF86; --warn: #E6AE45; --warn-ink: #E6AE45; --bad: #E0736A; --bad-ink: #F08A81;
    --g-S: #D95926; --g-A: #3987E5; --g-B: #199E70; --g-C: #5E5B55; --g-none: #3D3B35;
    --g-S-ink: #171717; --g-A-ink: #171717; --g-B-ink: #171717; --g-C-ink: #FFFFFF;
    --bar-muted: #2B5552;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 상단 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px max(16px, calc((100vw - 1240px) / 2)); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.brand svg.lockup { height: 38px; width: auto; display: block; color: var(--ink); margin: -4px 0 -4px -10px; }
.brand:hover { text-decoration: none; }
.brand small { font-weight: 600; color: var(--muted); font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
.brand .tagline { font-size: 12px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); white-space: nowrap; }
.top-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.demo { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn-ink); }
.badge.live { background: var(--accent-wash); color: var(--accent-ink); }
.quota { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.banner { padding: 8px max(16px, calc((100vw - 1240px) / 2)); background: color-mix(in srgb, var(--warn) 12%, var(--bg)); color: var(--ink); font-size: 13px; border-bottom: 1px solid var(--line); }

/* ---------- 레이아웃 ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 16px; padding-block: 18px 40px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field-label em { font-style: normal; font-weight: 500; color: var(--muted); margin-left: 6px; }
textarea, input[type=text], input[type=password], input[type=url], input[type=search], select {
  width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 8px 10px; min-height: 38px;
}
textarea { resize: vertical; min-height: 58px; font-size: 15px; }
/* 키워드는 한 줄짜리 입력이다. 엔터가 바로 분석을 시작하도록 textarea가 아닌 input을 쓰고,
   크기는 기존 입력창과 같게 맞춘다. */
#kwInput { min-height: 58px; font-size: 15px; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-wash); }
.filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.btns { display: flex; gap: 8px; margin-left: auto; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.muted { color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.primary:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 45%, var(--line-2)); background: transparent; }
.btn.sm { min-height: 28px; padding: 3px 10px; font-size: 12px; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 700; cursor: pointer; }
.iconbtn { background: none; border: 0; cursor: pointer; font-size: 17px; line-height: 1; padding: 4px; color: var(--muted); }
.iconbtn.on { color: #eda100; }

.progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.progress .track { flex: 1; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress .track i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .25s ease; }
.progress .msg { font-size: 12px; color: var(--ink-2); min-width: 0; }
.alert { margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-size: 13px; border: 1px solid var(--line); background: var(--surface-2); }
.alert.error { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
.alert.warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }

.tabs { scroll-margin-top: 64px; display: flex; gap: 4px; margin: 18px 0 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; padding: 10px 12px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs button .count { font-weight: 600; font-size: 11px; color: var(--muted); margin-left: 4px; }

/* ---------- 공통 블록 ---------- */
.section { margin-bottom: 18px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 10px; flex-wrap: wrap; }
.section-head h2 { font-size: 16px; margin: 0; letter-spacing: -0.01em; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar select, .toolbar input { width: auto; min-width: 120px; }
.own-mark { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .02em; color: var(--accent-ink); background: var(--accent-wash); border-radius: 4px; padding: 0 4px; vertical-align: 1px; margin-left: 3px; }
.info { cursor: help; color: var(--muted); border-bottom: 1px dotted var(--muted); }

.empty { text-align: center; padding: 48px 16px; color: var(--ink-2); }
.empty h2 { margin: 0 0 6px; font-size: 20px; color: var(--ink); }
.empty-sm { color: var(--muted); font-size: 13px; padding: 12px 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-weight: 600; }
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-top: 24px; text-align: left; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.step b { display: block; margin-bottom: 4px; }

/* 키워드 카드 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kcard.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.kcard h3 { margin: 0; font-size: 15px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kcard h3 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero { display: flex; align-items: baseline; gap: 6px; }
.hero b { font-size: 40px; line-height: 1; letter-spacing: -0.03em; }
.hero span { color: var(--muted); font-size: 12px; }
.lvl { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.lvl::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: currentColor; }
.lvl.low { color: var(--good-ink); background: color-mix(in srgb, var(--good) 12%, transparent); }
.lvl.mid { color: var(--warn-ink); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.lvl.high { color: var(--bad-ink); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 13px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.meter { height: 6px; border-radius: 99px; background: var(--accent-wash); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.mini-video { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; cursor: pointer; border-top: 1px solid var(--line); padding-top: 10px; }
.mini-video img { width: 64px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.mini-video p { margin: 0; font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 1px; height: 26px; align-items: end; }
.hours i { display: block; height: max(2px, var(--h)); background: var(--accent); border-radius: 2px 2px 0 0; opacity: .85; }
.hours-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }

/* 테이블 */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; white-space: nowrap; font-variant-numeric: tabular-nums; }
th { font-size: 12px; color: var(--ink-2); font-weight: 700; background: var(--surface); position: sticky; top: 0; z-index: 1; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th.sorted::after { content: " ↓"; color: var(--accent); }
th.sorted.asc::after { content: " ↑"; }
td.l, th.l { text-align: left; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.cmp th:first-child, .cmp td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 2; }
.cmp td.best { font-weight: 800; color: var(--accent-ink); }
.vcell { display: grid; grid-template-columns: 96px minmax(180px, 360px); gap: 10px; align-items: center; text-align: left; white-space: normal; }
.vcell img { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.vcell .t { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); }
.vcell .m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 0 5px; margin-right: 4px; background: var(--surface-2); color: var(--ink-2); vertical-align: 1px; }
.tag.shorts { background: rgba(227,73,72,.12); color: var(--bad-ink); }
.grade { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.grade i { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-style: normal; font-size: 12px; color: #fff; background: var(--g-none); }
.grade.S i { background: var(--g-S); color: var(--g-S-ink); } .grade.A i { background: var(--g-A); color: var(--g-A-ink); } .grade.B i { background: var(--g-B); color: var(--g-B-ink); } .grade.C i { background: var(--g-C); color: var(--g-C-ink); }
.up { color: var(--good-ink); } .down { color: var(--bad-ink); }
.more { display: flex; justify-content: center; padding: 12px; }

/* 차트 */
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 6px; overflow-x: auto; }
.chart { width: 100%; height: auto; display: block; min-width: 420px; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .tick, .chart .axis-title, .chart .reflabel { fill: var(--muted); font-size: 11px; }
.chart .axis-title { font-weight: 600; }
.chart .refline { stroke: var(--line-2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .dot { stroke: var(--surface); stroke-width: 2; cursor: pointer; }
.chart .dot:hover, .chart .dot:focus { r: 7; }
.dot.g-S { fill: var(--g-S); } .dot.g-A { fill: var(--g-A); } .dot.g-B { fill: var(--g-B); } .dot.g-C { fill: var(--g-C); } .dot.g-none { fill: var(--g-none); }
.chart .bar-track { fill: var(--surface-2); }
.chart .bar-fill { fill: var(--bar-muted); }
.chart .bar-fill.best { fill: var(--accent); }
.chart .bar-label { fill: var(--ink-2); font-size: 13px; font-weight: 600; }
.chart .bar-value { fill: var(--ink); font-size: 13px; font-weight: 700; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); padding: 6px 4px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 3px 10px 3px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.legend-btn i { width: 12px; height: 12px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.legend-btn b { color: var(--ink); }
.legend-btn small { color: var(--muted); font-variant-numeric: tabular-nums; }
.legend-btn[aria-pressed=false] { opacity: .45; text-decoration: line-through; }
.legend-btn:hover { border-color: var(--line-2); }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.effect-bar { display: inline-block; height: 8px; border-radius: 4px; vertical-align: middle; margin-right: 6px; }
.effect-bar.pos { background: var(--accent); } .effect-bar.neg { background: var(--line-2); }

.grid-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.wordlist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.wordlist li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 13px; font-variant-numeric: tabular-nums; }
.wordlist li:last-child { border-bottom: 0; }
.wordlist b { font-weight: 700; }

/* 가이드 */
.guide { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.guide h3 { margin: 18px 0 6px; font-size: 15px; }
.guide h3:first-child { margin-top: 0; }
.guide p, .guide li { color: var(--ink-2); }
.guide code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* 드로어 */
.drawer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.drawer.open { pointer-events: auto; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .2s; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; height: 100%; width: min(520px, 100%); background: var(--surface); border-left: 1px solid var(--line); padding: 18px; overflow-y: auto; transform: translateX(102%); transition: transform .22s ease; }
.drawer.open .drawer-panel { transform: none; }
.drawer-panel { padding-top: 0; }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; margin: 0 -18px 12px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer-head b { font-size: 14px; }
.d-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; background: var(--surface-2); margin-bottom: 12px; }
.d-title { font-size: 17px; margin: 0 0 4px; line-height: 1.35; }
.d-sub { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.d-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.d-box h4 { margin: 0 0 8px; font-size: 13px; }
.stat4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.stat4 div { background: var(--surface-2); border-radius: 8px; padding: 8px; }
.stat4 span { display: block; font-size: 11px; color: var(--muted); }
.stat4 b { font-size: 15px; }
.comp { display: grid; grid-template-columns: 110px 1fr 90px; gap: 8px; align-items: center; font-size: 12px; margin: 6px 0; }
.comp .meter { height: 8px; }
.comp b { text-align: right; font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tags span { font-size: 12px; background: var(--surface-2); border-radius: 999px; padding: 2px 8px; }
.comments { list-style: none; margin: 0; padding: 0; }
.comments li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.comments li:last-child { border-bottom: 0; }
.comments .who { font-size: 11px; color: var(--muted); }
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* 설정 */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(560px, calc(100% - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog form { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; max-height: 88vh; overflow-y: auto; }
dialog h2 { margin: 0; font-size: 18px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; }
legend { font-size: 12px; font-weight: 700; color: var(--ink-2); padding: 0 4px; }
.radio { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; cursor: pointer; }
.radio input { margin-top: 4px; }
.inline { display: flex; gap: 6px; align-items: center; }
.wrap-inline { flex-wrap: wrap; }
.file-btn { cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; }
#settingsForm:not([data-mode=key]) .mode-key, #settingsForm:not([data-mode=proxy]) .mode-proxy { display: none; }

.tooltip { position: fixed; z-index: 80; max-width: 300px; background: var(--ink); color: var(--surface); padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.4; pointer-events: none; box-shadow: var(--shadow); }
.tooltip b { display: block; margin-bottom: 2px; }
.tt-row { opacity: .85; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

.footer { max-width: 1240px; margin: 0 auto; padding-inline: 16px; padding-block: 8px 32px; color: var(--muted); font-size: 12px; }
.footer p { margin: 4px 0; }
.mbadge { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--warn-ink); background: color-mix(in srgb, var(--warn) 16%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 38%, transparent); vertical-align: 2px; }
.mbadge.ex { color: var(--ink-2); background: var(--surface-2); border-color: var(--line-2); }
.basis-panel .basis-table td, .basis-panel .basis-table th { text-align: center; }
.basis-panel .basis-table .l { text-align: left; }
.rpt-basis .alert { margin: 8px 0; }
.field.chk { justify-content: flex-end; }
.chk-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); line-height: 1.3; }
.chk-line input { flex: none; }
.foot-links { margin-top: 10px !important; padding-top: 10px; border-top: 1px solid var(--line); }
.foot-links a { color: var(--accent-ink); }

@media (max-width: 900px) {
  .filters { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar { padding-inline: 12px; flex-wrap: nowrap; }
  .brand .tagline { display: none; }
  .top-meta { flex-wrap: nowrap; gap: 6px; }
  .top-meta .badge { font-size: 11px; padding: 2px 7px; }
  .quota { display: none; }
  .hero b { font-size: 34px; }
  .stat4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid2 { grid-template-columns: 1fr; }
  .vcell { grid-template-columns: 72px minmax(160px, 240px); }
  .vcell img { width: 72px; }
  .btns { width: 100%; }
  .btns .btn { flex: 1; }
}


/* ---------- v2.5: 타이포·브랜드 ---------- */
h1, h2, h3, .section-head h2, .empty h2, dialog h2 { font-family: var(--font-display); letter-spacing: -0.01em; text-wrap: balance; }
.hero b { font-family: var(--font-display); font-weight: 800; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--primary-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }
.tabs button[aria-selected=true] { border-bottom-color: var(--ink); }
.btn.primary:hover { filter: none; background: color-mix(in srgb, var(--primary) 88%, var(--accent)); }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 키워드 칩 */
.kw-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; min-height: 0; }
.kw-chips:empty { display: none; }
.kw-count { font-size: 12px; font-weight: 700; color: var(--muted); margin-right: 2px; font-variant-numeric: tabular-nums; }
.kw-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--accent-wash); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.kw-chip.over { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.kw-chip button { border: 0; background: none; color: inherit; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; font-size: 15px; line-height: 1; }
.kw-chip button:hover { background: color-mix(in srgb, currentColor 14%, transparent); }

/* 진행 단계 */
.progress { flex-direction: column; align-items: stretch; gap: 8px; }
.progress-row { display: flex; align-items: center; gap: 12px; }
.steps-line { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.steps-line li { font-size: 12px; color: var(--muted); padding: 2px 10px; border-radius: 999px; background: var(--surface-2); }
.steps-line li.done { color: var(--accent-ink); background: var(--accent-wash); }
.steps-line li.done::before { content: "✓ "; }
.steps-line li.now { color: var(--primary-ink); background: var(--primary); font-weight: 600; }
.progress .track i { background: var(--accent); }

/* 빈 화면 */
.empty-mark { width: 72px; height: 72px; margin: 0 auto 10px; color: var(--ink); }
.empty-mark svg { width: 100%; height: 100%; }
.empty h2 { font-size: 24px; }
.empty > p { max-width: 52ch; margin: 0 auto; }
.chips-label { width: 100%; font-size: 12px; color: var(--muted); font-weight: 600; }
.steps { list-style: none; padding: 0; counter-reset: step; }
.step { counter-increment: step; position: relative; padding-top: 38px; }
.step::before { content: counter(step); position: absolute; top: 12px; left: 14px; width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.empty-note { margin-top: 18px; font-size: 13px; color: var(--muted); }

/* 모바일 카드 목록 */
.cards-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.vcard, .ccard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.vcard { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.vcard-thumb { position: relative; padding: 0; border: 0; background: var(--surface-2); border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 16 / 9; }
.vcard-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vcard-thumb .tag { position: absolute; left: 4px; bottom: 4px; margin: 0; }
.vcard-body { min-width: 0; }
.vcard-body .t { font-weight: 600; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard-body .m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.vcard-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; margin: 8px 0 0; font-size: 12px; }
.vcard-stats div { display: flex; justify-content: space-between; gap: 6px; }
.vcard-stats dt { color: var(--muted); }
.vcard-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.vcard-side { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ccard-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ccard-head a { color: var(--ink); }
.ccard-video { display: block; margin-top: 8px; font-size: 12px; color: var(--accent-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .vcard { grid-template-columns: 88px minmax(0, 1fr); } .vcard-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; } }

/* API 키 가이드 */
.key-guide { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface-2); }
.key-guide summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.key-guide ol { margin: 8px 0 0; padding-left: 20px; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }

/* ---------- 리포트 빌더 ---------- */
.rpt-shell { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
.rpt-form { position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px 14px; display: flex; flex-direction: column; }
.rpt-form details { border-bottom: 1px solid var(--line); padding: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.rpt-form details:last-child { border-bottom: 0; }
.rpt-form details > *:not(summary) { margin-top: 8px; }
.rpt-form summary { cursor: pointer; font-weight: 700; font-size: 14px; list-style-position: inside; }
.rpt-form textarea { min-height: 64px; font-size: 13px; line-height: 1.5; }
.rpt-form input[type=date] { width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 8px 10px; min-height: 38px; }
.checks { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.checks label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.logo-thumb { height: 32px; width: auto; max-width: 120px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 2px; }
.rpt-preview { min-width: 0; background: color-mix(in srgb, var(--line) 45%, var(--bg)); border-radius: var(--radius); padding: 16px; overflow-x: auto; }
@media (max-width: 960px) { .rpt-shell { grid-template-columns: 1fr; } .rpt-form { position: static; max-height: none; } }

/* ---------- 리포트 문서 (화면·인쇄 공통, 테마와 무관한 종이 색) ---------- */
.rpt-doc { --p-ink: #171717; --p-ink2: #525252; --p-muted: #6E6A62; --p-line: #DAD5CB; --p-cream: #FAF8F2; --p-teal: #146A68; --p-teal-wash: #E3EFEE;
  color: var(--p-ink); font-family: var(--font); font-size: 13px; line-height: 1.6; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.rpt-page { background: #FFFFFF; width: 100%; max-width: 794px; min-height: 360px; padding: 48px 52px; box-shadow: 0 1px 3px rgba(23,23,23,.08), 0 10px 30px rgba(23,23,23,.08); border-radius: 4px; display: flex; flex-direction: column; gap: 28px; }
.rpt-page.cover { min-height: 1000px; background: var(--p-cream); justify-content: space-between; }
.cover-top { display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
.cover-client img { max-height: 56px; max-width: 220px; object-fit: contain; }
.cover-mark svg { height: 34px; width: auto; color: var(--p-ink); display: block; }
.cover-main h1 { font-size: 38px; line-height: 1.2; margin: 6px 0 0; color: var(--p-ink); }
.rpt-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--p-teal); margin: 0; }
.cover-for { font-size: 18px; margin: 14px 0 0; color: var(--p-ink2); }
.cover-meta { margin: 0; display: grid; gap: 8px; border-top: 1px solid var(--p-line); padding-top: 18px; }
.cover-meta div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; }
.cover-meta dt { color: var(--p-muted); font-size: 12px; }
.cover-meta dd { margin: 0; }
.cover-foot { font-size: 11px; color: var(--p-muted); margin: 0; }
.rpt-sec { display: flex; flex-direction: column; gap: 12px; }
.rpt-sec h2 { font-size: 20px; margin: 0; display: flex; align-items: center; gap: 10px; color: var(--p-ink); }
.rpt-sec h2 .no { width: 26px; height: 26px; border-radius: 50%; background: var(--p-ink); color: #fff; font-size: 13px; display: grid; place-items: center; flex: none; }
.rpt-h3 { font-size: 14px; margin: 6px 0 0; color: var(--p-ink); }
.rpt-bullets, .rpt-ideas { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.rpt-bullets li::marker { color: var(--p-teal); }
.rpt-note { font-size: 11px; color: var(--p-muted); margin: 0; }
.rpt-muted { color: var(--p-muted); margin: 0; }
.rpt-comment { border-left: 3px solid var(--p-teal); background: var(--p-teal-wash); padding: 10px 14px; border-radius: 0 6px 6px 0; }
.rpt-comment span { font-size: 11px; font-weight: 700; color: var(--p-teal); }
.rpt-comment p { margin: 2px 0 0; }
.rpt-rec { border: 1px solid var(--p-line); border-radius: 8px; padding: 14px 16px; break-inside: avoid; }
.rec-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.rec-head h3 { margin: 0; font-size: 17px; color: var(--p-ink); }
.rec-rank { font-size: 11px; font-weight: 700; color: #fff; background: var(--p-teal); padding: 2px 8px; border-radius: 999px; }
.rec-score { text-align: right; line-height: 1.1; }
.rec-score b { font-family: var(--font-display); font-size: 28px; display: block; }
.rec-score small { font-size: 10px; color: var(--p-muted); }
.rpt-rec ul { margin: 10px 0 0; padding-left: 18px; color: var(--p-ink2); }
.rec-ex { margin: 8px 0 0; font-size: 12px; }
.rec-ex span { color: var(--p-muted); }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.rpt-table th { text-align: right; font-weight: 600; color: var(--p-muted); border-bottom: 1.5px solid var(--p-ink); padding: 6px 6px; white-space: nowrap; position: static; background: none; font-size: 11px; }
.rpt-table td { text-align: right; padding: 7px 6px; border-bottom: 1px solid var(--p-line); white-space: nowrap; font-variant-numeric: tabular-nums; vertical-align: middle; }
.rpt-table .l { text-align: left; }
.rpt-table td.wrap, .rpt-table.vids td.l { white-space: normal; }
.rpt-table small { display: block; color: var(--p-muted); font-size: 10.5px; white-space: normal; }
.rpt-table tr { break-inside: avoid; }
.rpt-table .pos { color: var(--p-teal); } .rpt-table .neg { color: #A2362D; }
.rv { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; }
.rv img { width: 64px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; }
.rpt-grade { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; font-size: 10px; font-weight: 700; color: #fff; background: #86BCB7; vertical-align: 1px; }
.rpt-grade.gS { background: #EB6834; color: #171717; } .rpt-grade.gA { background: #2A78D6; } .rpt-grade.gB { background: #1BAF7A; color: #171717; } .rpt-grade.gC { background: #C4BFB4; color: #171717; }
.rpt-bars { width: 100%; max-width: 640px; height: auto; }
.rpt-bars .bl { font-size: 12px; fill: #525252; } .rpt-bars .bv { font-size: 12px; font-weight: 700; fill: #171717; }
.rpt-bars .bt { fill: #F2EFE7; } .rpt-bars .bf { fill: #BCDAD6; } .rpt-bars .bb { fill: #146A68; }
.rpt-words { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.rpt-words span { color: var(--p-muted); margin-right: 4px; }
.rpt-words em { font-style: normal; background: var(--p-teal-wash); color: var(--p-teal); padding: 1px 8px; border-radius: 999px; }
.rpt-defs { margin: 0; display: grid; gap: 8px; }
.rpt-defs div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; }
.rpt-defs dt { font-weight: 600; }
.rpt-defs dd { margin: 0; color: var(--p-ink2); }
.rpt-disclaimer { font-size: 11px; color: var(--p-muted); border-top: 1px solid var(--p-line); padding-top: 12px; margin: 0; }
@media (max-width: 640px) { .rpt-page { padding: 28px 22px; } .rpt-page.cover { min-height: 620px; } .cover-main h1 { font-size: 28px; } .rpt-defs div, .cover-meta div { grid-template-columns: 1fr; gap: 0; } }

.print-report { display: none; }

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  html, body { background: #fff !important; }
  body { padding: 0; }
  body > *:not(#printReport) { display: none !important; }
  .print-report { display: block !important; }
  .rpt-doc { gap: 0; display: block; }
  .rpt-page { box-shadow: none; border-radius: 0; max-width: none; min-height: 0; padding: 0; break-after: auto; gap: 22px; }
  .rpt-page:not(.cover) { display: block; margin-top: 22px; }
  .rpt-page:not(.cover) .rpt-sec + .rpt-sec { margin-top: 22px; }
  .rpt-page.cover { min-height: 262mm; padding: 10mm 8mm; break-after: page; }
  .rpt-page.patterns-page, .rpt-page.appendix { break-before: page; }
  .rpt-sec { break-inside: auto; }
  .rpt-sec h2 { break-after: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- v2.6: 키워드 비교 ---------- */
.insight { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; }
.insight b { font-size: 12px; color: var(--accent-ink); }
.insight ul { margin: 4px 0 0; padding-left: 18px; }
.insight li { margin: 3px 0; line-height: 1.5; }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: grid; grid-template-columns: 44px minmax(150px, 1.2fr) 92px minmax(200px, 1fr) minmax(220px, 1.1fr); gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.rank-row.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
/* 키워드 1개일 때: 순위 번호와 기회 점수 칸이 없다 */
.rank-row.solo { grid-template-columns: minmax(150px, 1.2fr) minmax(200px, 1fr) minmax(220px, 1.1fr); }
.rk-no { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--ink-2); text-align: center; line-height: 1; }
.rk-no small { font-size: 11px; font-weight: 600; margin-left: 1px; }
.rank-row.best .rk-no { color: var(--accent-ink); }
.rk-main { min-width: 0; }
.rk-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rk-title b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-why { margin: 3px 0 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.rk-score { display: flex; flex-direction: column; align-items: flex-start; }
.rk-score b { font-family: var(--font-display); font-size: 34px; line-height: 1; letter-spacing: -0.03em; }
.rk-score span { font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.rk-parts { display: flex; flex-direction: column; gap: 7px; }
.rk-part { display: grid; grid-template-columns: 44px minmax(60px, 1fr) 26px 34px; gap: 8px; align-items: center; font-size: 12px; }
.rk-part span { color: var(--ink-2); }
.rk-part b { text-align: right; font-variant-numeric: tabular-nums; }
.rk-part em { font-style: normal; font-size: 11px; color: var(--muted); }
.meter.comp.low i { background: var(--good); } .meter.comp.mid i { background: var(--warn); } .meter.comp.high i { background: var(--bad); }
.meter.comp { background: var(--surface-2); }
.lvl-t.low { color: var(--good-ink); } .lvl-t.mid { color: var(--warn-ink); } .lvl-t.high { color: var(--bad-ink); }
.tag.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn-ink); }
.tag.up { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-ink); }
.tag.muted-tag { color: var(--muted); }
.rk-video { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink); font: inherit; min-width: 0; }
.rk-video img { width: 88px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.rk-video > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rk-video small { font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rk-video:hover small { color: var(--accent-ink); text-decoration: underline; }
table.cmp2 { table-layout: fixed; min-width: 560px; }
.cmp2 col.lab { width: 230px; }
.cmp2 th, .cmp2 td { white-space: normal; }
.cmp2 th:first-child, .cmp2 td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 2; }
.cmp2 thead th { font-size: 13px; color: var(--ink); }
.cmp2 tr.grp th { background: var(--surface-2); font-size: 12px; color: var(--ink); padding: 6px 10px; position: static; }
.cmp2 tr.grp th span { font-weight: 500; color: var(--muted); margin-left: 8px; }
.cmp2 td.lab { color: var(--ink-2); }
.cmp2 .cv { font-weight: 600; }
.cmp2 td.win .cv { color: var(--accent-ink); font-weight: 800; }
.cbar { display: block; height: 4px; margin-top: 5px; background: var(--surface-2); border-radius: 99px; max-width: 160px; overflow: hidden; }
.cbar i { display: block; height: 100%; background: var(--bar-muted, var(--g-C)); border-radius: 99px; }
td.win .cbar i { background: var(--accent); }
.cbar.inline { display: inline-block; width: 90px; margin: 0 8px 0 0; vertical-align: middle; }
.rk-mini { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-2); font-size: 11px; margin-right: 6px; color: var(--ink-2); }
.win-key { color: var(--accent-ink); font-weight: 800; }
.hours-note { font-size: 11px; color: var(--muted); margin-top: 3px; }
.cmp2 .hours { max-width: 220px; }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
/* 키워드가 하나면 칩이 한 칸에 갇히지 않고 가로를 다 쓴다 */
.rel-grid:has(> .rel-box:only-child) { grid-template-columns: 1fr; }
.rel-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.rel-box h4 { margin: 0 0 8px; font-size: 13px; }
.rel-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.rel { font-size: 12px; padding: 4px 10px; font-weight: 500; }
.chip.rel small { margin-left: 5px; color: var(--muted); font-size: 11px; }
.chip.rel.on { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-ink); }

/* ---------- v2.6: 영상 목록 ---------- */
.vtable td { padding-block: 10px; }
.vtable th.ck, .vtable td.ck, table td.ck, table th.ck { width: 34px; text-align: center; padding-inline: 6px; }
.vtable .fmt { width: 40px; text-align: center; padding-inline: 4px; }
.vtable .act { width: 1%; }
.vtable td.act { display: table-cell; }
.vtable td.act .btn { margin-left: 4px; }
.vtable tr.selected td, table tr.selected td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
/* 형식 배지: 등급(채운 사각형)과 헷갈리지 않게 원형 테두리만 사용 */
.fbadge { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 800; font-family: var(--font-display); background: transparent; }
.fbadge.l { color: var(--muted); border: 1px solid var(--line-2); }
.fbadge.s { color: var(--ink); border: 1.5px solid var(--ink-2); }
.vrow { display: grid; grid-template-columns: 136px minmax(220px, 380px); gap: 12px; align-items: center; white-space: normal; text-align: left; }
.vthumb { position: relative; display: block; padding: 0; border: 0; background: var(--surface-2); border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 16/9; width: 136px; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dur { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.78); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 5px; border-radius: 4px; font-variant-numeric: tabular-nums; line-height: 1.4; }
.vinfo { min-width: 0; }
.vinfo .t, .vcard-top .t { font-weight: 600; line-height: 1.38; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chline { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; min-width: 0; }
.chline .chname { color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.chline .muted { white-space: nowrap; }
.av { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.av-fb { display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--ink-2); border: 1px solid var(--line-2); }
.av.lg { width: 72px; height: 72px; font-size: 28px; }
.why { margin-top: 4px; font-size: 12px; color: var(--accent-ink); font-weight: 600; }
.sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.mult { font-weight: 600; } .mult.hi { color: var(--accent-ink); font-weight: 800; } .mult.lo { color: var(--muted); font-weight: 500; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.colmenu { position: relative; }
.colmenu summary { list-style: none; }
.colmenu summary::-webkit-details-marker { display: none; }
.colmenu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 10px 12px; min-width: 230px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.colmenu-pop .hint { margin: 0 0 4px; font-size: 11px; }
.colmenu-pop label { display: flex; gap: 6px; align-items: center; }
.bulk-host { position: sticky; bottom: 12px; z-index: 15; display: flex; justify-content: center; pointer-events: none; }
.bulk { pointer-events: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 8px 10px 8px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.22); margin-top: 12px; }
.bulk b { margin-right: 4px; font-size: 13px; }
.bulk .btn { background: var(--surface); color: var(--ink); border-color: transparent; }
.bulk .btn.ghost { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
.vcard .dur { right: 3px; bottom: 3px; font-size: 10px; }
.vcard-top { display: flex; gap: 6px; align-items: flex-start; }
.vcard-top .ck { display: flex; padding-top: 2px; }
.vcard-top .fbadge { flex: none; width: 20px; height: 20px; font-size: 10px; }
.vcard.selected { border-color: var(--accent); }
.recent-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; }
.recent-chips .chips-label { width: auto; margin-right: 2px; }
.rchip { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); overflow: hidden; }
.rchip button { border: 0; background: none; font: inherit; color: var(--ink-2); cursor: pointer; padding: 3px 4px 3px 10px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rchip button:only-child { padding-right: 10px; }
.rchip button:hover { color: var(--accent-ink); }
.rchip .x { padding: 3px 8px 3px 2px; color: var(--muted); }
.linklike.sm { font-size: 12px; }

/* ---------- v2.6: 채널 ---------- */
.chcell { display: flex; gap: 10px; align-items: center; min-width: 200px; white-space: normal; }
.chcell .av { width: 34px; height: 34px; font-size: 13px; }
.chcell a b { color: var(--ink); margin-right: 5px; }
.chcell .tag { vertical-align: 2px; }
.ccard-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ccard-foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 8px; }
.ccard-foot .ccard-video { font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctable td.act, .ctable th.act { width: 1%; }
.d-ch { display: flex; align-items: center; gap: 8px; }
.d-ai .hint { margin: 0 0 8px; }
.d-box .why { margin: 0 0 8px; }

/* ---------- v2.6: 채널 분석 ---------- */
.ch-form { margin-bottom: 16px; }
.ch-form .field { margin-bottom: 6px; }
.ch-form-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 8px; }
.ch-form-row input { min-width: 0; }
.ch-form .hint { margin: 8px 0 0; }
.ch-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.ch-id h2 { margin: 0; font-size: 22px; }
.ch-id p { margin: 3px 0 8px; font-size: 13px; }
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(92px, auto)); gap: 4px 18px; margin: 0; }
.stat-strip div { display: flex; flex-direction: column; }
.stat-strip dt { font-size: 11px; color: var(--muted); }
.stat-strip dd { margin: 0; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-strip small { font-size: 11px; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.kpis + .hint { margin: 8px 0 20px; font-size: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi > span { font-size: 12px; color: var(--ink-2); }
.kpi b { font-size: 20px; font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.kpi small { font-size: 11px; color: var(--muted); line-height: 1.35; }
.points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.points li { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.points li.pt-cadence { border-left-color: var(--warn); }
.chart.columns .col.long { fill: var(--accent); cursor: pointer; }
.chart.columns .col.shorts { fill: var(--warn); cursor: pointer; }
.chart.columns .col.fresh { opacity: .38; }
.chart.columns .col:hover, .chart.columns .col:focus { fill: var(--ink); outline: none; }
.bd-grid { align-items: start; }
.bd { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 0; overflow-x: auto; }
.bd h3 { margin: 0; font-size: 14px; }
.bd .hint { margin: 2px 0 0; font-size: 11px; }
.bd-table th { position: static; }
.bd-table tr.win td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.bd-table tr.win td b { color: var(--accent-ink); }
.mini-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 0; }
.mini-list h3 { margin: 0 0 8px; font-size: 14px; }
.mini-list ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mini-list li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; }
.mini-list li a { font-weight: 600; font-size: 13px; color: var(--ink); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-list small { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.mini-list small .fbadge { width: 16px; height: 16px; font-size: 9px; border-radius: 4px; }
.mthumb { position: relative; padding: 0; border: 0; border-radius: 6px; overflow: hidden; aspect-ratio: 16/9; background: var(--surface-2); cursor: pointer; }
.mthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mthumb .dur { font-size: 10px; right: 3px; bottom: 3px; }
.chv .vrow { grid-template-columns: 112px minmax(220px, 420px); }
.chv .vthumb { width: 112px; }

@media (max-width: 1100px) {
  .rank-row { grid-template-columns: 40px minmax(140px, 1fr) 84px minmax(190px, 1fr); }
  .rank-row.solo { grid-template-columns: minmax(140px, 1fr) minmax(190px, 1fr); }
  .rk-video { grid-column: 2 / -1; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ch-head { grid-template-columns: auto minmax(0, 1fr); }
  .stat-strip { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .rank-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px 10px; padding: 12px; }
  .rank-row.solo { grid-template-columns: minmax(0, 1fr); }
  .rk-no { font-size: 18px; }
  .rk-score b { font-size: 28px; }
  .rk-parts, .rk-video { grid-column: 1 / -1; }
  .cmp2 col.lab { width: 132px; }
  table.cmp2 { min-width: 0; }
  .cmp2 td, .cmp2 th { padding: 8px; }
  .cbar { max-width: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-form-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ch-form-row input { grid-column: 1 / -1; }
  .ch-head { padding: 12px; gap: 12px; }
  .av.lg { width: 52px; height: 52px; font-size: 20px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .points { grid-template-columns: 1fr; }
  .bulk { justify-content: center; }
  .bulk b { width: 100%; text-align: center; }
  .bd-table .bd-views { display: none; }
  .cbar.inline { width: 56px; }
}

/* 채널 판정 */
.vd-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.vd-badge { font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; cursor: help; }
.vd-badge.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 35%, var(--line)); }
.vd-badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.vd-sum { margin-top: 12px; border-radius: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.vd-sum.good { border-left-color: var(--good); }
.vd-sum.warn { border-left-color: var(--warn); }
.vd-sum.neutral { border-left-color: var(--line-2); }
.vd-sum b { display: block; font-size: 14px; margin-bottom: 3px; }
.vd-sum p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.vd-lim { margin-top: 10px; }
.vd-obs-h { margin: 14px 0 6px; font-size: 13px; }
.vd-obs-h small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.vd-obs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.vd-obs div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.vd-obs dt { font-size: 12px; color: var(--ink-2); }
.vd-obs dd { margin: 0; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vd-obs small { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
@media (max-width: 720px) { .vd-obs { grid-template-columns: 1fr; } }
.kpi small .kpi-lim { font-style: normal; font-weight: 700; color: var(--ink-2); }

/* 이름으로 찾았을 때의 채널 후보 */
.av.sm { width: 40px; height: 40px; font-size: 16px; }
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.cand { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.cand:hover { border-color: var(--accent); background: var(--accent-wash); }
.cand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cand-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cand-id b { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand-id small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand-go { font-size: 12px; font-weight: 700; color: var(--accent-ink); flex: none; }
.cands-wrap .hint { margin-top: 10px; }

.guide-note { background: var(--surface-2); border-radius: 8px; padding: 12px 14px; margin: 10px 0 14px; font-size: 13.5px; line-height: 1.7; }
.perf-early small { opacity: .75; font-size: 11.5px; }
