/* ============ 디자인 토큰 ============ */
:root {
  color-scheme: light;
  --font: "Pretendard Variable", Pretendard, system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --page: #f5f5f3;
  --surface: #ffffff;
  --surface-2: #f7f7f5;
  --surface-3: #efeeeb;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #6e6c66;
  --line: #e7e6e1;
  --line-2: #d9d8d2;
  --grid: #e1e0d9;
  --axis: #c3c2b7;

  --accent: #2a78d6;
  --accent-hover: #256abf;
  --accent-text: #1c5cab;
  --accent-weak: rgba(42, 120, 214, 0.09);
  --accent-ring: rgba(42, 120, 214, 0.35);
  --bar-muted: #c9c7bf;

  --good: #0ca30c;
  --good-text: #006300;
  --good-weak: rgba(12, 163, 12, 0.1);
  --critical: #d03b3b;
  --critical-text: #b42f2f;
  --critical-weak: rgba(208, 59, 59, 0.09);
  --warning: #fab219;
  --warning-text: #8a5a00;
  --warning-weak: rgba(250, 178, 25, 0.16);

  --clone: #2a78d6;
  --new: #eb6834;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-1: 0 1px 2px rgba(11, 11, 11, 0.04);
  --shadow-pop: 0 12px 32px rgba(11, 11, 11, 0.14), 0 2px 6px rgba(11, 11, 11, 0.06);
  --sidebar-w: 240px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #20201f;
    --surface-3: #2a2a28;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --text-3: #a3a198;
    --line: #2c2c2a;
    --line-2: #383835;
    --grid: #2c2c2a;
    --axis: #383835;
    --accent: #3987e5;
    --accent-hover: #5598e7;
    --accent-text: #86b6ef;
    --accent-weak: rgba(57, 135, 229, 0.14);
    --accent-ring: rgba(57, 135, 229, 0.45);
    --bar-muted: #4a4946;
    --good-text: #3fbf3f;
    --good-weak: rgba(12, 163, 12, 0.16);
    --critical-text: #ef7d7d;
    --critical-weak: rgba(208, 59, 59, 0.18);
    --warning-text: #fab219;
    --warning-weak: rgba(250, 178, 25, 0.14);
    --clone: #3987e5;
    --new: #d95926;
    --shadow-1: none;
    --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #20201f;
  --surface-3: #2a2a28;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --text-3: #a3a198;
  --line: #2c2c2a;
  --line-2: #383835;
  --grid: #2c2c2a;
  --axis: #383835;
  --accent: #3987e5;
  --accent-hover: #5598e7;
  --accent-text: #86b6ef;
  --accent-weak: rgba(57, 135, 229, 0.14);
  --accent-ring: rgba(57, 135, 229, 0.45);
  --bar-muted: #4a4946;
  --good-text: #3fbf3f;
  --good-weak: rgba(12, 163, 12, 0.16);
  --critical-text: #ef7d7d;
  --critical-weak: rgba(208, 59, 59, 0.18);
  --warning-text: #fab219;
  --warning-weak: rgba(250, 178, 25, 0.14);
  --clone: #3987e5;
  --new: #d95926;
  --shadow-1: none;
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* ============ 기본 ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss06";
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); }
.skip-link:focus { left: 8px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }

/* ============ 레이아웃 ============ */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.brand__mark { color: var(--accent); display: inline-flex; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__text strong { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.brand__text small { font-size: 12px; color: var(--text-3); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; text-decoration: none;
}
.nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-weak); color: var(--accent-text); font-weight: 600; }
.nav__count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nav a[aria-current="page"] .nav__count { color: var(--accent-text); }
.sidebar__foot { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid var(--line); }
.meta-list { margin: 0; display: grid; gap: 8px; }
.meta-list div { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.meta-list dt { color: var(--text-3); }
.meta-list dd { margin: 0; color: var(--text-2); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot--good { background: var(--good); }
.dot--muted { background: var(--axis); }
.dot--warn { background: var(--warning); }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 32px; background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__title h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.3; }
.topbar__title p { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.search {
  display: flex; align-items: center; gap: 8px; width: 300px; max-width: 42vw;
  height: 36px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.search svg { width: 16px; height: 16px; fill: none; stroke: var(--text-3); stroke-width: 1.7; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13.5px; }
.search input::placeholder { color: var(--text-3); }
.search kbd { font-family: var(--mono); font-size: 11px; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; line-height: 18px; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

main { padding: 24px 32px 48px; outline: none; }
.view { display: flex; flex-direction: column; gap: 20px; max-width: 1360px; animation: view-in .22s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============ 카드 ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); min-width: 0; }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card__head h2 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.015em; }
.card__head p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.card__body { padding: 16px 20px 20px; }
.card__foot { padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ============ 지표 타일 ============ */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 16px 20px 18px; }
.kpi__label { font-size: 13px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi__value { margin-top: 8px; font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.kpi__value small { font-size: 15px; font-weight: 600; color: var(--text-3); margin-left: 3px; letter-spacing: 0; }
.kpi__sub { margin-top: 6px; font-size: 12.5px; color: var(--text-3); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kpi__meter { margin-top: 12px; height: 6px; border-radius: 999px; background: var(--accent-weak); overflow: hidden; }
.kpi__meter i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

/* ============ 막대 차트 (가로) ============ */
.bars { position: relative; display: grid; gap: 6px; }
.bars__row {
  display: grid; grid-template-columns: var(--label-w, 168px) minmax(0, 1fr) 44px; align-items: center; gap: 12px;
  min-height: 30px; padding: 3px 6px; margin: 0 -6px; border-radius: var(--radius-sm); cursor: default;
}
.bars__row[data-href] { cursor: pointer; }
.bars__row:hover, .bars__row:focus-visible { background: var(--surface-2); }
.bars__label { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.bars__label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars__track { position: relative; height: 18px; }
.bars__fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; transition: width .4s cubic-bezier(.2,.7,.2,1); }
.bars__fill--muted { background: var(--bar-muted); }
.bars__value { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.bars__axis { display: grid; grid-template-columns: var(--label-w, 168px) minmax(0, 1fr) 44px; gap: 12px; margin-top: 4px; }
.bars__ticks { position: relative; height: 16px; border-top: 1px solid var(--axis); }
.bars__ticks span { position: absolute; top: 3px; transform: translateX(-50%); font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.bars__row { position: relative; }
.bars__overlay {
  position: absolute; inset: 0 0 20px 0; pointer-events: none;
  display: grid; grid-template-columns: var(--label-w, 168px) minmax(0, 1fr) 44px; gap: 12px;
}
.bars--padded > .bars__overlay { top: 18px; }
.bars__overlay--top { z-index: 1; }
.bars__plotcol { position: relative; }
.bars__grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid); }
.bars__label .badge { padding: 0 5px; height: 18px; }
.icon-btn[disabled] { opacity: .4; cursor: default; }
.prose code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.funnel__step { border-radius: var(--radius-sm); }
.bars__threshold { position: absolute; top: -6px; bottom: 0; width: 0; border-left: 1.5px solid var(--text-2); }
.bars__threshold span { position: absolute; top: -18px; left: 0; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--surface); padding: 0 4px; }
.bars--padded { padding-top: 18px; }

/* 퍼널 */
.funnel { display: grid; gap: 14px; }
.funnel__step { display: grid; gap: 6px; }
.funnel__top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.funnel__top b { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.funnel__bar { height: 10px; border-radius: 0 4px 4px 0; background: var(--accent); min-width: 2px; }
.funnel__rate { font-size: 12px; color: var(--text-3); }

/* ============ 배지·태그 ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1;
  background: var(--surface-3); color: var(--text-2);
}
.badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.badge--good { background: var(--good-weak); color: var(--good-text); }
.badge--critical { background: var(--critical-weak); color: var(--critical-text); }
.badge--warning { background: var(--warning-weak); color: var(--warning-text); }
.badge--accent { background: var(--accent-weak); color: var(--accent-text); }
.type-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.type-tag::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--type-color, var(--axis)); }
.type-tag--clone { --type-color: var(--clone); }
.type-tag--new { --type-color: var(--new); }
.flag { font-family: var(--mono); font-size: 11.5px; padding: 2px 6px; border-radius: 4px; background: var(--critical-weak); color: var(--critical-text); white-space: nowrap; }
.fb { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fb span { display: inline-flex; gap: 3px; align-items: center; }
.fb--empty { color: var(--text-3); font-size: 12.5px; }

/* ============ 툴바·폼 ============ */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar__spacer { flex: 1; }
.toolbar__count { font-size: 13px; color: var(--text-3); }
.seg { display: inline-flex; padding: 2px; background: var(--surface-3); border-radius: 8px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 0 12px; height: 28px; border-radius: 6px;
  font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.select {
  height: 32px; padding: 0 30px 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%23898781' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 16px;
  font-size: 13px; appearance: none; cursor: pointer;
}
.select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.link-more { font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }

/* ============ 테이블 ============ */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  position: sticky; top: 0; text-align: left; font-weight: 600; font-size: 12px; color: var(--text-3);
  padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.table th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.table th button::after { content: "↕"; font-size: 10px; opacity: .45; }
.table th[aria-sort="descending"] button::after { content: "↓"; opacity: 1; color: var(--accent-text); }
.table th[aria-sort="ascending"] button::after { content: "↑"; opacity: 1; color: var(--accent-text); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr[data-href]:hover td { background: var(--surface-2); }
.table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.table .t-right { text-align: right; }
.table .nowrap { white-space: nowrap; }
.cell-title { display: flex; flex-direction: column; gap: 2px; min-width: 240px; max-width: 460px; }
.cell-title strong { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.cell-title span { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.score-cell { display: inline-flex; align-items: center; gap: 10px; }
.score-cell b { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 22px; }
.mini-meter { width: 64px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.mini-meter i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.mini-meter--muted i { background: var(--bar-muted); }
.note-cell { color: var(--text-2); font-size: 13px; max-width: 420px; }
.note-cell details summary { cursor: pointer; list-style: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-cell details summary::-webkit-details-marker { display: none; }
.note-cell details[open] summary { white-space: normal; }
.note-cell details p { margin: 6px 0 0; }

.empty-state { padding: 48px 20px; text-align: center; color: var(--text-3); }
.empty-state strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* ============ 스캔 기록 ============ */
.run-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.run-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.run-stats { display: flex; gap: 20px; flex-wrap: wrap; margin: 0; }
.run-stats div { display: flex; gap: 6px; align-items: baseline; font-size: 13px; }
.run-stats dt { color: var(--text-3); }
.run-stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.run-head .seg { margin-left: auto; }

/* ============ 취향 프로필 ============ */
.prose { font-size: 14px; color: var(--text-2); max-width: 760px; }
.prose h2 { font-size: 14px; font-weight: 650; color: var(--text); margin: 24px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); letter-spacing: -0.01em; }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose p { margin: 0 0 8px; }
.prose ul { margin: 0; padding-left: 18px; }
.prose li { margin: 4px 0; }
.prose li.is-empty { color: var(--text-3); list-style: none; margin-left: -18px; }
.prose strong { color: var(--text); }
.prose em { color: var(--text-3); font-style: normal; font-size: 13px; }

/* ============ 상세 패널 ============ */
.drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(11, 11, 11, 0.32); animation: fade-in .18s ease-out; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(640px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; animation: slide-in .24s cubic-bezier(.2,.7,.2,1);
}
.drawer[hidden], .drawer-backdrop[hidden] { display: none; }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.drawer__inner { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.drawer__bar {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px;
  padding: 12px 16px 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.drawer__crumb { font-size: 12.5px; color: var(--text-3); font-family: var(--mono); }
.drawer__bar .spacer { flex: 1; }
.drawer__hero { padding: 20px 24px 16px; }
.drawer__hero .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drawer__hero h2 { margin: 12px 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.3; }
.drawer__hero p { margin: 0; font-size: 15px; color: var(--text-2); }
.score-panel { margin: 0 24px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 20px; align-items: center; }
.score-panel__total { text-align: left; }
.score-panel__total b { display: block; font-size: 44px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.score-panel__total span { display: block; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.score-panel__total .badge { margin-top: 10px; }
.axes { display: grid; gap: 7px; margin: 0; }
.axes div { display: grid; grid-template-columns: 76px minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 12.5px; }
.axes dt { color: var(--text-2); }
.axes dd { margin: 0; height: 6px; border-radius: 999px; background: var(--accent-weak); overflow: hidden; }
.axes dd i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.axes span { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sections { padding: 8px 24px 32px; }
.section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 0.01em; }
.section p { margin: 0; font-size: 14px; color: var(--text); white-space: pre-line; }
.section ul { margin: 0; padding-left: 18px; font-size: 14px; }
.section li + li { margin-top: 6px; }
.section a { word-break: break-all; }
.section--split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.kv { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 14px; }
.kv dt { color: var(--text-3); font-size: 13px; }
.kv dd { margin: 0; }
.callout { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.callout p + p { margin-top: 8px; }
.callout .boost { display: flex; gap: 8px; color: var(--accent-text); font-weight: 500; }
.comment { border-left: 2px solid var(--accent); padding-left: 10px; color: var(--text-2); }
.comment small { display: block; color: var(--text-3); font-size: 12px; }

/* ============ 툴팁 ============ */
.tooltip {
  position: fixed; z-index: 60; max-width: 320px; pointer-events: none;
  background: var(--text); color: var(--surface); border-radius: 8px; padding: 10px 12px;
  font-size: 12.5px; line-height: 1.5; box-shadow: var(--shadow-pop);
}
.tooltip b { display: block; font-size: 13px; margin-bottom: 2px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.tooltip .tt-note { margin-top: 6px; opacity: .8; }

/* ============ 반응형 ============ */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center;
    padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--line); gap: 12px; overflow-x: auto;
  }
  .brand { padding: 0; border: 0; margin: 0; }
  .brand__text small, .sidebar__foot { display: none; }
  .nav { flex-direction: row; gap: 2px; }
  .nav a { padding: 7px 10px; white-space: nowrap; }
  .nav a svg { display: none; }
  .topbar { position: static; padding: 14px 16px; flex-wrap: wrap; }
  .search { width: 100%; max-width: none; }
  .topbar__actions { width: 100%; }
  main { padding: 16px 16px 40px; }
}
@media (max-width: 640px) {
  .brand__text { display: none; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi__value { font-size: 24px; }
  .card__head, .card__body { padding-left: 16px; padding-right: 16px; }
  .bars__row, .bars__axis { --label-w: 104px; gap: 8px; }
  .toolbar { padding: 12px 16px; }
  /* 테이블 → 행 카드 */
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table--stack tbody tr:last-child { border-bottom: 0; }
  .table--stack td { padding: 3px 0 !important; border: 0; }
  .table--stack td[data-label]::before { content: attr(data-label); display: inline-block; width: 64px; color: var(--text-3); font-size: 12px; }
  .table--stack .cell-title { min-width: 0; max-width: none; margin-bottom: 6px; }
  .table--stack .note-cell { max-width: none; }
  .score-panel { grid-template-columns: 1fr; margin: 0 16px; }
  .drawer__hero, .sections { padding-left: 16px; padding-right: 16px; }
  .section--split { grid-template-columns: 1fr; gap: 0; }
  .run-head .seg { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .bars__fill, .funnel__bar, .mini-meter i, .axes dd i, .kpi__meter i { background: CanvasText; }
}
