/* DPC-Super 승인 앱. 토큰과 규칙의 이유는 docs/DESIGN.md에 요소별로 적었다. */

:root {
  /* TDS 팔레트 실측값 */
  --blue700: #1b64da; /* 강조 버튼: 흰 글자 대비 5.41:1 */
  --blue500: #3182f6; /* 그래픽(진척 막대·선택 표시) */
  --blue50: #e8f3ff;
  --grey900: #191f28;
  --grey800: #333d4b;
  --grey700: #4e5968;
  --grey600: #6b7684;
  --grey500: #8b95a1;
  --grey300: #d1d6db;
  --grey200: #e5e8eb;
  --grey100: #f2f4f6;
  --grey50: #f9fafb;
  --red600: #e42939; /* 되돌릴 수 없는 행동에만 */
  --red50: #ffeeee;
  --green600: #029359;
  --bg: #ffffff;
  --surface: #ffffff;
  --section: #f2f4f6;
  --text: var(--grey900);
  --sub: var(--grey600);
  --sub-on-grey: var(--grey700);
  --line: var(--grey200);
  --primary: var(--blue700);
  --primary-text: #ffffff;
  --secondary-bg: var(--grey100);
  --secondary-text: var(--grey800);
  --overlay: rgba(0, 0, 0, 0.4);

  --t1: 600 30px/40px var(--font);
  --t3: 700 22px/31px var(--font);
  --t4: 700 20px/29px var(--font);
  --t5: 400 17px/25.5px var(--font);
  --t6: 400 15px/22.5px var(--font);
  --t7: 400 13px/19.5px var(--font);
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', sans-serif;

  --gutter: 24px;
  --radius-card: 20px;
  --radius-cta: 16px;
  --radius-sheet: 28px;
  --tabbar: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101013;
    --surface: #17171c;
    --section: #101013;
    --text: #ffffff;
    --sub: #9e9ea4;
    --sub-on-grey: #c3c3c6;
    --line: #2c2c35;
    --primary: #2970d9;
    --secondary-bg: #2c2c35;
    --secondary-text: #e4e4e5;
    --grey100: #202027;
    --grey50: #17171c;
    --blue50: #1a2738;
    --red50: #3a1a1e;
    --red600: #fa616d;
    --overlay: rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--section);
  color: var(--text);
  font: var(--t5);
  font-feature-settings: 'tnum';
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--primary); }
.emoji { font-family: Tossface, sans-serif; font-style: normal; }
[hidden] { display: none !important; }

/* 레이아웃: 휴대폰 우선. 넓은 화면에서는 같은 화면을 가운데 640px로. */
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--tabbar) + var(--safe-bottom) + 24px); }
.top { position: sticky; top: 0; z-index: 5; background: var(--section); padding: 12px var(--gutter) 8px; display: flex; align-items: center; gap: 8px; min-height: 56px; }
.top h1 { font: var(--t3); margin: 0; flex: 1; }
/* 화면이 바뀌면 h1로 초점을 옮긴다(스크린 리더가 새 화면 제목부터 읽게). 키보드로 닿는 곳이 아니라 테두리는 소음일 뿐이라 숨긴다. */
.top h1:focus { outline: none; }
.top .back { border: 0; background: none; padding: 8px; margin-left: -8px; font-size: 22px; cursor: pointer; color: var(--text); }
.icon-btn { border: 0; background: none; padding: 10px; border-radius: 12px; cursor: pointer; color: var(--sub); font: var(--t6); }
.icon-btn:active { background: var(--grey100); }

.section { background: var(--surface); margin: 0 0 12px; padding: 24px var(--gutter); }
@media (min-width: 641px) { .section { border-radius: var(--radius-card); margin: 0 12px 12px; } }
.section h2 { font: var(--t4); margin: 0 0 4px; }
.section .desc { font: var(--t6); color: var(--sub); margin: 0 0 16px; }
.eyebrow { font: var(--t7); color: var(--sub); margin: 0 0 4px; }
.big { font: var(--t1); margin: 0; letter-spacing: -0.5px; }
.muted { color: var(--sub); }
.small { font: var(--t6); }
.tiny { font: var(--t7); }

/* 버튼: 화면당 강조(primary) 하나. 나머지는 회색(secondary)이나 글자(text) 버튼. */
.btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 56px; border: 0; border-radius: var(--radius-cta); font-weight: 600; font-size: 17px; cursor: pointer; transition: transform 0.12s ease; text-decoration: none; }
.btn:active { transform: scale(0.96); }
.btn.primary { background: var(--primary); color: var(--primary-text); }
.btn.secondary { background: var(--secondary-bg); color: var(--secondary-text); }
.btn.danger { background: var(--red600); color: #fff; }
.btn.small { height: 40px; width: auto; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; }
.text-btn { border: 0; background: none; color: var(--sub); font: var(--t6); padding: 12px 8px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }
/* 입력 옆 작은 버튼은 글자 폭만 차지한다. Why: 좁은 화면에서 '저장'이 '저/장'으로 꺾이면 버튼으로 안 읽힌다. */
.btn-row .btn.small { flex: none; white-space: nowrap; }
.cta-bar { position: sticky; bottom: calc(var(--tabbar) + var(--safe-bottom)); z-index: 4; padding: 12px 20px 16px; background: linear-gradient(to top, var(--surface) 75%, transparent); }
.cta-bar .hint { font: var(--t7); color: var(--sub); text-align: center; margin: 0 0 8px; }
.cta-bar .text-row { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

/* 목록 */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); cursor: pointer; text-decoration: none; color: inherit; }
.row:first-child { border-top: 0; }
.row:active { opacity: 0.6; }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; }
.row .sub { font: var(--t6); color: var(--sub); margin-top: 2px; }
.row .end { font: var(--t6); color: var(--sub); text-align: right; white-space: nowrap; }
.row .chev { color: var(--grey500); }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 8px; background: var(--grey100); color: var(--sub-on-grey); font: var(--t7); font-weight: 500; max-width: 100%; }
.chip.blue { background: var(--blue50); color: var(--primary); }
.chip.human { background: var(--blue50); color: var(--primary); }
.chip.red { background: var(--red50); color: var(--red600); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--grey100); border-radius: 16px; padding: 14px 16px; }
.stat .label { font: var(--t7); color: var(--sub-on-grey); }
.stat .value { font-weight: 700; font-size: 20px; line-height: 29px; }
.stat .of { font: var(--t7); color: var(--sub-on-grey); }

.bar { height: 6px; border-radius: 3px; background: var(--grey200); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--blue500); border-radius: 3px; transition: width 0.4s ease; }

/* 세그먼트 */
.seg { display: flex; background: var(--grey100); border-radius: 12px; padding: 4px; margin: 0 var(--gutter) 12px; }
.seg button { flex: 1 0 auto; white-space: nowrap; border: 0; background: none; padding: 8px 4px; border-radius: 9px; font: var(--t6); font-weight: 600; color: var(--sub); cursor: pointer; }
.seg button[aria-selected='true'] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

/* 카드(승인함 목록) */
.card-item { display: block; background: var(--surface); border-radius: var(--radius-card); padding: 20px; margin: 0 12px 10px; text-decoration: none; color: inherit; }
.card-item:active { transform: scale(0.98); }
.card-item .k { font: var(--t7); color: var(--sub); display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.card-item .t { font-weight: 700; font-size: 17px; line-height: 25.5px; }
.card-item .s { font: var(--t6); color: var(--sub); margin-top: 4px; }

/* 입력 */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font: var(--t6); color: var(--sub); }
.input, textarea.input, select.input { width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.input:focus { outline: 2px solid var(--blue500); outline-offset: 0; border-color: transparent; }
textarea.input { min-height: 96px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font: var(--t6); color: var(--sub-on-grey); padding: 12px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--primary); flex: none; }
/* 다크 모드에서 기본 체크박스가 흰 사각형으로 튀어 시선을 뺏는다. 폼 컨트롤도 테마를 따르게 한다. */
:root { color-scheme: light dark; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.file-pick { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.file-pick:focus-within { outline: 2px solid var(--blue500); outline-offset: 2px; }
.counter { font: var(--t7); color: var(--sub); text-align: right; }

/* 후보 선택 */
.choice { display: block; border: 2px solid var(--line); border-radius: var(--radius-card); padding: 18px; margin-bottom: 12px; cursor: pointer; }
.choice[aria-checked='true'] { border-color: var(--blue500); background: var(--blue50); }
.choice .head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.choice .name { font-weight: 700; font-size: 18px; }
.choice .score { font-weight: 700; color: var(--primary); }
.scores { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; margin: 12px 0; font: var(--t7); color: var(--sub-on-grey); }
.scores .bar { margin: 0; }
/* 니치 보드: 후보 카드와 카테고리 지도 행 */
.niche { border: 1px solid var(--line); border-radius: var(--radius-card); padding: 20px; margin-bottom: 12px; background: var(--surface); }
.niche.map { padding: 16px 20px; margin-bottom: 8px; }
.niche.map summary { list-style: none; }
.niche.map summary::-webkit-details-marker { display: none; }
.risk { font: var(--t6); background: var(--grey100); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }

/* 복사 필드(사람 카드) */
.copy { display: flex; align-items: center; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.copy:first-child { border-top: 0; }
.copy .l { font: var(--t7); color: var(--sub); }
.copy .v { font-weight: 600; word-break: break-all; }
.copy button { flex: none; }
.steps { margin: 0; padding-left: 20px; font: var(--t6); color: var(--sub-on-grey); }
.steps li { margin-bottom: 6px; }
.answer { background: var(--blue50); border-radius: 16px; padding: 14px 16px; font: var(--t6); margin-top: 12px; white-space: pre-wrap; }
.why { font: var(--t6); color: var(--sub); border-left: 3px solid var(--grey300); padding-left: 12px; margin: 16px 0 0; }

table.t { width: 100%; border-collapse: collapse; font: var(--t6); }
table.t th, table.t td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
table.t th { color: var(--sub); font-weight: 500; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }

/* 타임라인 */
.tl { list-style: none; padding: 0; margin: 0; }
.tl li { position: relative; padding: 0 0 16px 20px; }
.tl li::before { content: ''; position: absolute; left: 4px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--grey300); }
.tl li.stage::before { background: var(--blue500); }
.tl li::after { content: ''; position: absolute; left: 7px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl .when { font: var(--t7); color: var(--sub); }

/* 생명주기 진행 */
.steps-line { display: flex; gap: 3px; margin: 12px 0 6px; }
.steps-line i { flex: 1; height: 6px; border-radius: 3px; background: var(--grey200); }
.steps-line i.done { background: var(--blue500); }
.steps-line i.now { background: var(--primary); }
.steps-line i.human { outline: 1px dashed var(--grey500); outline-offset: 1px; }

/* 탭 바 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom); }
.tabbar nav { max-width: 640px; margin: 0 auto; display: flex; height: var(--tabbar); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--grey500); text-decoration: none; font: var(--t7); font-weight: 600; }
.tabbar a[aria-current='page'] { color: var(--text); }
.tabbar svg { width: 24px; height: 24px; }
.tabbar .count { font: var(--t7); }

/* 토스트·시트 */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--safe-bottom) + 88px); transform: translate(-50%, 20px); opacity: 0; z-index: 30; background: var(--grey800); color: #fff; padding: 12px 18px; border-radius: 14px; font: var(--t6); max-width: calc(100% - 40px); transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; background: var(--surface); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; padding: 12px var(--gutter) calc(20px + var(--safe-bottom)); max-height: 90vh; overflow: auto; animation: up 0.25s ease; }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--grey300); margin: 0 auto 16px; }
.sheet h3 { font: var(--t4); margin: 0 0 8px; }
@keyframes up { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }

.empty { text-align: center; padding: 56px var(--gutter); color: var(--sub); }
.empty .emoji { font-size: 48px; display: block; margin-bottom: 12px; }
.empty b { color: var(--text); display: block; font-size: 18px; margin-bottom: 4px; }
.notice { background: var(--blue50); border-radius: 16px; padding: 14px 16px; font: var(--t6); margin-bottom: 12px; }
.skeleton { height: 120px; margin: 12px; border-radius: var(--radius-card); background: linear-gradient(90deg, var(--grey100), var(--grey50), var(--grey100)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

.md h1, .md h2, .md h3 { font: var(--t4); margin: 20px 0 8px; }
.md p, .md li { font: var(--t6); }
.md pre { background: var(--grey100); padding: 12px; border-radius: 12px; overflow: auto; font: 13px/1.5 ui-monospace, monospace; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .btn:active, .card-item:active { transform: none; }
}

/* 작업(실시간) */
.run-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.run-card + .run-card { margin-top: 12px; }
.run-head { display: flex; gap: 12px; align-items: flex-start; }
.run-head .main { flex: 1; min-width: 0; }
.run-head .title { font-weight: 600; }
.run-head .sub { font: var(--t6); color: var(--sub); margin-top: 2px; font-variant-numeric: tabular-nums; }
.pulse { flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--blue500); box-shadow: 0 0 0 0 rgba(49, 130, 246, 0.5); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(49, 130, 246, 0); } 100% { box-shadow: 0 0 0 0 rgba(49, 130, 246, 0); } }
.live-log { list-style: none; margin: 12px 0 0; padding: 10px 12px; max-height: 360px; overflow-y: auto; background: var(--grey50); border-radius: 12px; font: var(--t7); overscroll-behavior: contain; }
.live-log.done { max-height: 280px; margin-bottom: 12px; }
.live-log li { display: flex; gap: 10px; padding: 3px 0; word-break: break-word; }
.live-log li.sub { padding-left: 16px; color: var(--sub); }
.live-log li.bad span { color: var(--red600); }
.live-log time { flex: none; color: var(--grey500); font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dot.on { background: var(--green600); }
.dot.off { background: var(--grey500); }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ───────── 넓은 화면(웹) ─────────
   휴대폰은 위 규칙 그대로(아래 탭 바, 한 줄). 1024px부터는 웹답게: 왼쪽 사이드바, 넓은 본문, 여러 칸 그리드, 가운데 대화상자, 마우스 hover.
   Why: 휴대폰 화면을 가운데 640px로 늘려 두면 데스크톱에서 양옆이 비고, 승인함·니치 보드를 한 번에 훑어볼 수 없다. */
.tabbar .brand, .tabbar .side-only { display: none; }
.card-grid, .niche-grid, .map-grid { display: block; }

@media (min-width: 1024px) {
  :root { --gutter: 32px; --side: 240px; }
  body { background: var(--section); }
  #app { max-width: none; margin: 0 0 0 var(--side); padding: 8px 48px 64px; }
  #view { max-width: 1200px; margin: 0 auto; }
  /* 읽는 화면(카드 결정·설정·리서치 리포트)은 읽기 좋은 폭으로 */
  #view[data-page='card'], #view[data-page='settings'], #view[data-page='topic'], #view[data-page='token'] { max-width: 820px; }

  .top { position: static; background: none; padding: 32px 0 20px; min-height: 0; }
  .top h1 { font: 700 28px/38px var(--font); letter-spacing: -0.4px; }
  #view[data-page='home'] .top .icon-btn, #view[data-page='settings'] .top .back { display: none; } /* 설정은 사이드바에 있다 */

  .section { margin: 0 0 16px; border-radius: var(--radius-card); padding: 28px 32px; }
  .seg { margin: 0 0 16px; width: fit-content; max-width: 100%; }
  .seg button { flex: none; padding: 8px 18px; }
  .stats { grid-template-columns: repeat(4, 1fr); }

  /* 여러 칸 그리드 */
  .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
  .card-grid .card-item { margin: 0; height: 100%; }
  .niche-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; align-items: start; }
  .niche-grid .niche { margin: 0; }
  .map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-items: start; }
  .map-grid .niche.map { margin: 0; }

  /* 마우스 */
  .card-item { transition: box-shadow 0.15s ease, transform 0.15s ease; }
  .card-item:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06); transform: translateY(-1px); }
  .card-item:active { transform: none; }
  .row:hover .title { color: var(--primary); }
  .row:active { opacity: 1; }
  .btn:hover:not([disabled]) { filter: brightness(0.97); }
  .btn.primary:hover:not([disabled]) { filter: brightness(1.08); }
  .btn:active { transform: none; }
  .text-btn:hover { color: var(--text); }
  .niche.map summary:hover b { color: var(--primary); }

  /* 결정 버튼: 화면 아래 고정은 그대로, 폭은 오른쪽 480px로 */
  .cta-bar { bottom: 0; padding: 20px 0 28px; background: linear-gradient(to top, var(--section) 70%, transparent); }
  .cta-bar > * { max-width: 480px; margin-left: auto; }

  /* 사이드바(같은 탭 바를 왼쪽 세로로) */
  .tabbar { top: 0; bottom: 0; right: auto; width: var(--side); border-top: 0; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 16px; }
  .tabbar .brand { display: flex; flex: none; flex-direction: row; justify-content: flex-start; align-items: center; gap: 10px; padding: 6px 12px 10px; color: var(--text); text-decoration: none; font: 700 18px/26px var(--font); }
  .tabbar nav { flex-direction: column; height: auto; max-width: none; margin: 0; gap: 2px; }
  .tabbar a:not(.brand) { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 12px; border-radius: 12px; font: 600 15px/22px var(--font); color: var(--sub-on-grey); }
  .tabbar a:not(.brand):hover { background: var(--grey100); color: var(--text); }
  .tabbar a[aria-current='page'] { background: var(--grey100); color: var(--text); }
  .tabbar svg { width: 20px; height: 20px; }
  .tabbar .side-only { display: flex; }

  /* 시트 → 가운데 대화상자 */
  .scrim { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: var(--radius-sheet); padding: 28px 32px 32px; animation: pop 0.18s ease; }
  .sheet .grab { display: none; }
  .toast { bottom: 32px; left: calc(50% + var(--side) / 2); }
  .skeleton { margin: 16px 0; }
  .empty { padding: 72px var(--gutter); }
}
@keyframes pop { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* 화면 미리보기 */
.shots-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; align-items: flex-start; }
.shots-strip .shot { flex: 0 0 auto; width: 96px; scroll-snap-align: start; }
.shots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; align-items: start; }
.shot { padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--grey100); cursor: zoom-in; display: block; align-self: start; }
.shot img { width: 100%; height: auto; min-height: 60px; display: block; }
.shot img.broken { visibility: hidden; }
.shot.more { min-height: 120px; align-self: stretch; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; padding: 8px; text-decoration: none; cursor: pointer; }
.app-icon-lg { width: 64px; height: 64px; border-radius: 14px; }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.88); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.lightbox .lb-img { max-width: 100%; max-height: calc(100vh - 96px); object-fit: contain; border-radius: 12px; }
.lightbox .lb-bar { display: flex; gap: 16px; align-items: center; margin-top: 12px; color: #fff; }
.lightbox .lb-bar .text-btn { color: #fff; }

/* 분석 탭(자체 지표 v2) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 16px; }
.kpi { background: var(--section); border-radius: 12px; padding: 12px; }
.kpi-v { font: var(--t4); color: var(--text); margin: 2px 0; }
.chart { width: 100%; min-width: 320px; height: auto; display: block; }
.chart .bar { fill: var(--blue500); }
.chart .line { fill: none; stroke: var(--grey800); stroke-width: 2; }
.chart .axis { stroke: var(--line); }
.chart .lbl { fill: var(--sub); font-size: 11px; font-family: var(--font); }
.funnel, .share { display: grid; gap: 6px; }
.f-row { display: grid; grid-template-columns: minmax(80px, 1.2fr) 2fr minmax(90px, auto); gap: 8px; align-items: center; }
.f-bar { height: 10px; background: var(--section); border-radius: 5px; overflow: hidden; }
.f-bar i { display: block; height: 100%; background: var(--blue500); border-radius: 5px; }
.panel { background: var(--section); border-radius: 12px; padding: 12px; margin-top: 12px; }
.seg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.t.cohort td { min-width: 44px; }
