/* ══════════════════════════ 비교 · 순위 v2 ══════════════════════════
   app.css 의 기존 비교 화면 스타일(.rank-*, .trend*, .compare-*, .sel-*)을 덮어쓴다.
   레이아웃: 좌측 리포트 선택(데스크톱 sticky) + 우측 결과(순위 히어로 · 백분위 목록 · 추세 카드) */

.cmp, .tcz {
  --c-gold: #B8860B;
  --c-gold-2: #e8b334;
  --c-ink: #1c1710;
  --c-sub: #6b6458;
  --c-mute: #9a9285;
  --c-line: #eeebe4;
  --c-soft: #faf9f6;
  --c-good: #059669;
  --c-good-2: #10b981;
  --c-bad: #dc2626;
  --c-bad-2: #ef4444;
  --c-warn: #d97706;
  --c-ease: cubic-bezier(.22,.61,.36,1);
  --c-shadow: 0 1px 2px rgba(23,18,8,.04), 0 6px 20px -10px rgba(23,18,8,.12);
  --c-shadow-hi: 0 2px 4px rgba(23,18,8,.04), 0 18px 36px -18px rgba(23,18,8,.22);
}

/* ── 레이아웃 ── */
.compare-layout.cmp { grid-template-columns: 300px minmax(0, 1fr); gap: 22px; }
.cmp-result { min-width: 0; gap: 20px; }
.cmp .card { border-color: var(--c-line); box-shadow: var(--c-shadow); }

/* ── 리포트 선택 사이드바 ── */
.cmp .cmp-side { position: sticky; top: calc(var(--appbar-h, 68px) + 18px); padding: 20px 18px 18px; border-radius: 22px;
  background: linear-gradient(180deg, #fffdf8 0%, #fff 120px); }
.cmp-side__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cmp-side__eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; color: var(--c-gold); }
.cmp-side__eyebrow svg { width: 14px !important; height: 14px !important; }
.cmp-side__title { margin: 3px 0 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--c-ink); }
.cmp-side__count { flex: none; padding: 5px 11px; border-radius: 999px; background: #fff5dc; border: 1px solid #f1e2b6;
  font-size: 12.5px; color: #8a6408; font-variant-numeric: tabular-nums; }
.cmp-side__count b { font-weight: 800; }
.cmp-side__tools { display: flex; align-items: center; gap: 8px; margin: 12px 0 12px; }
.cmp-side__dot { width: 3px; height: 3px; border-radius: 50%; background: #d9d3c6; }
.cmp-link { border: 0; background: none; padding: 2px 0; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--c-sub); cursor: pointer;
  border-bottom: 1px dashed transparent; transition: color .2s var(--c-ease), border-color .2s var(--c-ease); }
.cmp-link:hover { color: var(--c-gold); border-bottom-color: currentColor; }

.cmp .cmp-list { display: flex; flex-direction: column; gap: 10px; position: relative; }
.cmp .sel-item { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 14px 14px;
  border: 1.5px solid var(--c-line); border-radius: 16px; background: #fff; cursor: pointer; outline: none;
  transition: border-color .22s var(--c-ease), background .22s var(--c-ease), box-shadow .22s var(--c-ease), transform .16s var(--c-ease); }
.cmp .sel-item:hover { border-color: #e7d29a; transform: translateY(-1px); box-shadow: var(--c-shadow); }
.cmp .sel-item:focus-visible { box-shadow: 0 0 0 3px rgba(232,179,52,.35); }
.cmp .sel-item.on { border-color: #e2bf5c; background: linear-gradient(135deg, #fffaf0 0%, #fff6df 100%);
  box-shadow: 0 8px 22px -14px rgba(184,134,11,.55); }
.cmp .sel-check { width: 22px; height: 22px; margin-top: 1px; border-radius: 7px; border: 1.5px solid #d8d2c4; background: #fff;
  transition: background .22s var(--c-ease), border-color .22s var(--c-ease), transform .3s cubic-bezier(.34,1.56,.64,1); }
.cmp .sel-item.on .sel-check { background: linear-gradient(135deg,#c8901a 0%,#e8b334 70%,#f0c75e 100%); border-color: transparent;
  box-shadow: 0 3px 8px -2px rgba(184,134,11,.55); transform: scale(1.04); }
.cmp .sel-check svg { width: 13px !important; height: 13px !important; stroke-width: 3; transform: scale(.4); transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .2s; }
.cmp .sel-item.on .sel-check svg { transform: scale(1); }
.sel-body { flex: 1; min-width: 0; }
.sel-top { display: flex; align-items: center; gap: 6px; }
.sel-name { font-size: 14.5px; font-weight: 800; color: var(--c-ink); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-new { flex: none; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg,#c8901a 0%,#e8b334 100%); letter-spacing: .02em; }
.sel-date { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12.5px; color: var(--c-sub); font-variant-numeric: tabular-nums; }
.sel-date svg { width: 13px !important; height: 13px !important; color: var(--c-mute); }
.sel-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.sel-age, .sel-acc { font-size: 11.5px; padding: 3px 8px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.sel-age { background: #fff3d1; color: #85600a; }
.sel-age b { font-weight: 800; }
.sel-acc { background: #f2f0ea; color: var(--c-sub); font-weight: 700; }
.sel-acc.up { background: #fef2f2; color: var(--c-bad); }
.sel-acc.down { background: #ecfdf5; color: var(--c-good); }
.sel-idx { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 800; color: #c9c2b2; font-variant-numeric: tabular-nums; }
.cmp-side__hint { display: flex; gap: 8px; margin: 14px 0 0; padding: 11px 12px; border-radius: 12px; background: var(--c-soft);
  font-size: 12.5px; line-height: 1.55; color: var(--c-sub); }
.cmp-side__hint svg { flex: none; margin-top: 2px; color: var(--c-gold); }
.cmp-side__hint b { color: var(--c-ink); }

/* ── 순위 히어로 (라이트 프리미엄) ── */
.cmp .rank-hero.rank-hero--v2 { position: relative; overflow: hidden; margin: 0; padding: 30px 34px; color: var(--c-ink);
  display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 34px; align-items: center; border-radius: 24px;
  border: 1px solid #f0e3c0;
  background:
    radial-gradient(120% 140% at 0% 0%, #fff3d4 0%, rgba(255,243,212,0) 52%),
    radial-gradient(90% 120% at 100% 100%, #dcf6ea 0%, rgba(220,246,234,0) 55%),
    linear-gradient(135deg, #fffdf7 0%, #ffffff 60%, #f6fdf9 100%);
  box-shadow: 0 1px 2px rgba(23,18,8,.04), 0 24px 48px -28px rgba(184,134,11,.35); }
.rh-deco { position: absolute; inset: 0; pointer-events: none; }
.rh-deco i { position: absolute; border-radius: 50%; border: 1px solid rgba(184,134,11,.12); }
.rh-deco i:nth-child(1) { width: 420px; height: 420px; right: -150px; top: -220px; }
.rh-deco i:nth-child(2) { width: 260px; height: 260px; right: -60px; top: -120px; border-color: rgba(16,185,129,.14); }
.rh-gauge { position: relative; width: 236px; height: 236px; z-index: 1; }
.rh-ring { width: 100%; height: 100%; display: block; overflow: visible; }
.rh-ticks line { stroke: #e6dcc4; stroke-width: 1.4; stroke-linecap: round; }
.rh-track { fill: none; stroke: #f3eee2; stroke-width: 16; }
.rh-arc { fill: none; stroke-width: 16; stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 100;
  transition: stroke-dashoffset 1.5s var(--c-ease); filter: drop-shadow(0 4px 8px rgba(184,134,11,.28)); }
.rh-knob { fill: #fff; stroke: #e8b334; stroke-width: 4; opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: rhKnob .5s 1.35s cubic-bezier(.34,1.56,.64,1) forwards; filter: drop-shadow(0 2px 4px rgba(23,18,8,.18)); }
@keyframes rhKnob { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }
.rh-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.rh-center__k { font-size: 13px; font-weight: 700; color: var(--c-sub); letter-spacing: .04em; }
.rh-center__v { font-size: 50px; font-weight: 900; letter-spacing: -.045em; line-height: 1.02; font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #9a6d06 0%, #c8901a 45%, #e3a92a 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rh-center__v small { font-size: 24px; font-weight: 800; margin-left: 2px; }
.rh-tier { margin-top: 8px; font-size: 12px; font-weight: 800; padding: 4px 11px; border-radius: 999px; }
.rh-tier--t1, .rh-tier--t2 { background: #dcfce7; color: #047857; }
.rh-tier--t3 { background: #ecfdf5; color: var(--c-good); }
.rh-tier--t4 { background: #fff7e6; color: #b45309; }
.rh-tier--t5 { background: #fef2f2; color: var(--c-bad); }
.rh-body { position: relative; z-index: 1; min-width: 0; }
.rh-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--c-sub); }
.rh-eyebrow svg { color: var(--c-gold); }
.rh-eyebrow b { color: var(--c-ink); font-weight: 800; }
.rh-eyebrow__sep { width: 1px; height: 12px; background: #e4dccb; margin: 0 4px; }
.rh-title { margin: 10px 0 8px; font-size: 30px; font-weight: 900; letter-spacing: -.035em; line-height: 1.22; color: var(--c-ink); }
.rh-title em { font-style: normal; background: linear-gradient(transparent 62%, rgba(240,199,94,.55) 62%); padding: 0 2px; }
.rh-desc { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--c-sub); max-width: 560px; }
.rh-desc b { color: var(--c-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.rh-dist { display: flex; gap: 3px; height: 8px; margin: 18px 0 12px; max-width: 520px; border-radius: 999px; overflow: hidden; }
.rh-dist i { min-width: 0; border-radius: 999px; transform-origin: left; animation: rhGrow .9s .3s var(--c-ease) both; }
.rh-dist__top { background: linear-gradient(90deg, #10b981, #34d399); }
.rh-dist__mid { background: linear-gradient(90deg, #f5c451, #fbbf24); }
.rh-dist__warn { background: linear-gradient(90deg, #f87171, #ef4444); }
@keyframes rhGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.rh-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600;
  border: 1px solid var(--c-line); background: rgba(255,255,255,.85); color: var(--c-sub); cursor: pointer; backdrop-filter: blur(4px);
  transition: transform .16s var(--c-ease), box-shadow .2s var(--c-ease), border-color .2s var(--c-ease); }
span.cmp-chip { cursor: default; }
button.cmp-chip:hover { transform: translateY(-1px); box-shadow: var(--c-shadow); }
.cmp-chip b { color: var(--c-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.cmp-chip__dot { width: 8px; height: 8px; border-radius: 50%; }
.cmp-chip--top .cmp-chip__dot { background: var(--c-good-2); }
.cmp-chip--mid .cmp-chip__dot { background: #fbbf24; }
.cmp-chip--warn .cmp-chip__dot { background: var(--c-bad-2); }
.cmp-chip--top:hover { border-color: #a7f3d0; } .cmp-chip--warn:hover { border-color: #fecaca; } .cmp-chip--mid:hover { border-color: #fde68a; }
.cmp-chip--gold { background: #fff6dd; border-color: #f1e2b6; color: #85600a; }
.cmp-chip--gold svg { width: 14px !important; height: 14px !important; }

/* ── 공통 카드 헤더 · 필터 칩 ── */
.cmp .cmp-card { padding: 22px 22px 18px; border-radius: 22px; }
.cmp-card__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.cmp-h { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--c-ink); }
.cmp-sub { margin: 3px 0 0; font-size: 13px; color: var(--c-mute); font-variant-numeric: tabular-nums; }
.cmp-filter { display: inline-flex; gap: 4px; padding: 4px; border-radius: 13px; background: #f4f2ec; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.cmp-filter::-webkit-scrollbar { display: none; }
.cmp-filter button { flex: none; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--c-sub);
  padding: 7px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap; transition: background .2s var(--c-ease), color .2s var(--c-ease), box-shadow .2s var(--c-ease); }
.cmp-filter button span { margin-left: 3px; font-size: 11.5px; font-weight: 800; color: var(--c-mute); font-variant-numeric: tabular-nums; }
.cmp-filter button:hover { color: var(--c-ink); }
.cmp-filter button.on { background: #fff; color: var(--c-ink); box-shadow: 0 1px 2px rgba(23,18,8,.06), 0 4px 10px -4px rgba(23,18,8,.14); }
.cmp-filter button.on span { color: var(--c-gold); }
.cmp-foot { display: flex; gap: 8px; margin: 14px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--c-mute); }
.cmp-foot svg { flex: none; margin-top: 2px; }
.cmp-more-wrap:empty { display: none; }
.cmp-more-wrap { display: flex; justify-content: center; margin-top: 14px; }
.cmp-more { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--c-line);
  background: #fff; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--c-ink); cursor: pointer;
  transition: border-color .2s var(--c-ease), box-shadow .2s var(--c-ease), transform .16s var(--c-ease); }
.cmp-more:hover { border-color: #e2bf5c; box-shadow: var(--c-shadow); transform: translateY(-1px); }
.cmp-more__chev { display: inline-flex; transform: rotate(90deg); transition: transform .25s var(--c-ease); color: var(--c-mute); }
.cmp-more__chev.up { transform: rotate(-90deg); }
.pr-empty { padding: 28px 12px; text-align: center; color: var(--c-mute); font-size: 14px; background: var(--c-soft); border-radius: 14px; grid-column: 1 / -1; }

/* ── 바이오마커 백분위 행 ── */
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pr-row { position: relative; padding: 14px 16px 10px; border-radius: 16px; background: var(--c-soft); border: 1px solid transparent; cursor: pointer; outline: none;
  transition: background .2s var(--c-ease), border-color .2s var(--c-ease), box-shadow .2s var(--c-ease), transform .16s var(--c-ease);
  animation: prIn .45s var(--c-ease) both; }
.pr-row:nth-child(2) { animation-delay: .03s; } .pr-row:nth-child(3) { animation-delay: .06s; } .pr-row:nth-child(4) { animation-delay: .09s; }
.pr-row:nth-child(5) { animation-delay: .12s; } .pr-row:nth-child(6) { animation-delay: .15s; } .pr-row:nth-child(n+7) { animation-delay: .18s; }
@keyframes prIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pr-row:hover, .pr-row:focus-visible { background: #fff; border-color: #ecdcae; box-shadow: var(--c-shadow-hi); }
.pr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pr-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pr-name b { font-size: 14.5px; font-weight: 800; color: var(--c-ink); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-ai { display: inline-flex; color: var(--c-gold); opacity: 0; transform: translateX(-3px); transition: opacity .2s var(--c-ease), transform .2s var(--c-ease); }
.pr-ai svg { width: 14px !important; height: 14px !important; }
.pr-row:hover .pr-ai, .pr-row:focus-visible .pr-ai { opacity: .85; transform: none; }
@media (hover: none) { .pr-ai { opacity: .6; transform: none; } }
.pr-pill { flex: none; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.pr-pill--t1 { background: #059669; color: #fff; box-shadow: 0 4px 10px -4px rgba(5,150,105,.6); }
.pr-pill--t2 { background: #d1fae5; color: #047857; }
.pr-pill--t3 { background: #ecfdf5; color: #059669; }
.pr-pill--t4 { background: #fff4db; color: #b45309; }
.pr-pill--t5 { background: #fee2e2; color: #dc2626; }
.pr-meta { margin-top: 3px; font-size: 12.5px; color: var(--c-mute); font-variant-numeric: tabular-nums; display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.pr-meta b { color: var(--c-sub); font-weight: 800; font-size: 13px; }
.pr-meta__sep { width: 3px; height: 3px; border-radius: 50%; background: #cfc8b8; margin: 0 4px; }
.pr-scale { position: relative; height: 34px; margin-top: 8px; }
.pr-bell { position: absolute; left: 0; right: 0; bottom: 9px; width: 100%; height: 22px; display: block; overflow: visible; }
.pr-bell path { fill: rgba(28,23,16,.055); stroke: rgba(28,23,16,.16); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pr-bell line { stroke: rgba(28,23,16,.16); stroke-width: 1; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.pr-track { position: absolute; left: 0; right: 0; bottom: 2px; height: 7px; border-radius: 999px; opacity: .9; }
.pr-mark { position: absolute; bottom: -2px; width: 0; height: 0; transition: left 1.1s var(--c-ease); }
.pr-mark::before { content: ""; position: absolute; left: -1px; bottom: 8px; width: 2px; height: 22px; border-radius: 2px; background: rgba(28,23,16,.55); opacity: 0; transition: opacity .3s .7s; }
.pr-mark span { position: absolute; left: -8px; bottom: 0; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  border: 3.5px solid var(--c-ink); box-shadow: 0 2px 6px rgba(23,18,8,.28); transform: scale(.6); transition: transform .5s cubic-bezier(.34,1.56,.64,1) .2s; }
.pr-mark.on::before { opacity: 1; }
.pr-mark.on span { transform: scale(1); }
.pr-row--t1 .pr-mark span, .pr-row--t2 .pr-mark span { border-color: #059669; }
.pr-row--t3 .pr-mark span { border-color: #10b981; }
.pr-row--t4 .pr-mark span { border-color: #d97706; }
.pr-row--t5 .pr-mark span { border-color: #dc2626; }
.pr-ends { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10.5px; color: #b3ab9b; letter-spacing: .02em; }

/* ── 추세 카드 ── */
.tc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.tc { position: relative; display: flex; flex-direction: column; padding: 16px 16px 10px; border-radius: 18px; background: #fff;
  border: 1px solid var(--c-line); cursor: pointer; min-width: 0;
  transition: border-color .22s var(--c-ease), box-shadow .22s var(--c-ease), transform .16s var(--c-ease); }
.tc.reveal { opacity: 0; transform: translateY(14px); }
.tc.reveal.in { opacity: 1; transform: none; transition: opacity .55s var(--c-ease), transform .55s var(--c-ease), border-color .22s var(--c-ease), box-shadow .22s var(--c-ease); }
.tc:hover { border-color: #ecdcae; box-shadow: var(--c-shadow-hi); }
.tc--out { background: linear-gradient(180deg, #fffafa 0%, #fff 90px); }
.tc-head { display: flex; align-items: center; gap: 8px; }
.tc-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; }
.tc-title b { font-size: 14.5px; font-weight: 800; color: var(--c-ink); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-ai { flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; color: var(--c-gold);
  padding: 2px 7px 2px 5px; border-radius: 999px; background: #fff6dd; opacity: 0; transition: opacity .2s var(--c-ease); }
.tc-ai svg { width: 12px !important; height: 12px !important; }
.tc:hover .tc-ai { opacity: 1; }
@media (hover: none) { .tc-ai { opacity: 1; } }
.tc-zoom { flex: none; width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--c-line); background: #fff; color: var(--c-mute);
  display: grid; place-content: center; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .15s var(--c-ease); }
.tc-zoom:hover { background: #fff6dd; color: var(--c-gold); border-color: #ecdcae; transform: scale(1.06); }
.tc-zoom:active { transform: scale(.92); }
.tc-kpi { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 2px; min-width: 0; flex-wrap: wrap; }
.tc-now { font-size: 26px; font-weight: 900; letter-spacing: -.035em; color: var(--c-ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.tc-unit { font-size: 12.5px; color: var(--c-mute); font-weight: 600; margin-right: 4px; }
.tc-spacer { flex: 1; }
.tc-delta { align-self: center; display: inline-flex; align-items: center; gap: 2px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 800;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc-delta__pct { font-weight: 700; opacity: .75; margin-left: 3px; }
.tc-delta__pct::before { content: "("; } .tc-delta__pct::after { content: ")"; }
.tc-delta--good { background: #dcfce7; color: #047857; }
.tc-delta--bad { background: #fee2e2; color: #dc2626; }
.tc-delta--neutral { background: #eff6ff; color: #2563eb; }
.tc-delta--flat { background: #f2f0ea; color: var(--c-mute); }
.tc-range, .tc-flag { align-self: center; font-size: 11.5px; font-weight: 700; white-space: nowrap; padding: 3px 8px; border-radius: 8px; }
.tc-range { color: #047857; background: #f0fdf6; }
.tc-flag { color: #fff; background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 3px 8px -3px rgba(220,38,38,.5); }

/* 차트 */
.tc-plot { position: relative; margin: 4px -4px 0; cursor: zoom-in; }
.tc-plot--zoom { margin: 6px 0 0; cursor: crosshair; }
.cmp svg.trend, .tcz svg.trend { width: 100%; height: auto; display: block; overflow: visible; -webkit-user-select: none; user-select: none; touch-action: pan-y; }
.tc-gl { stroke: #efece5; stroke-width: 1; stroke-dasharray: 3 4; }
.tc-ax { fill: #a39b8c; font-weight: 600; font-variant-numeric: tabular-nums; }
.tc-ax--u { fill: #b8b0a0; font-weight: 700; }
.tc-band { fill: rgba(16,185,129,.09); }
.tc-bandln { stroke: rgba(5,150,105,.35); stroke-width: 1; stroke-dasharray: 4 4; }
.tc-bandlbl { fill: rgba(5,150,105,.75); font-weight: 700; }
.tc-line { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.tc-area { opacity: 0; }
.tc-dot { fill: #fff; stroke: #c8901a; stroke-width: 2.4; opacity: 0; transform-box: fill-box; transform-origin: center; }
.tc-dot--out { stroke: #ef4444; }
.tc-dot--last { fill: #c8901a; stroke: #fff; stroke-width: 2.6; filter: drop-shadow(0 2px 4px rgba(184,134,11,.45)); }
.tc-dot--last.tc-dot--out { fill: #ef4444; filter: drop-shadow(0 2px 4px rgba(220,38,38,.4)); }
.tc-halo { fill: rgba(232,179,52,.18); opacity: 0; transform-box: fill-box; transform-origin: center; }
.tc-val { fill: #5c5547; font-weight: 700; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; opacity: 0; }
.tc-val--last { fill: var(--c-ink, #1c1710); font-weight: 800; }
.tc-guide { stroke: rgba(28,23,16,.22); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; transition: opacity .15s; pointer-events: none; }
.tc-focus { fill: #fff; stroke: #c8901a; stroke-width: 3; opacity: 0; pointer-events: none; transition: opacity .15s; filter: drop-shadow(0 2px 5px rgba(23,18,8,.25)); }
.tc-focus.out { stroke: #ef4444; }
svg.tc-svg.hov .tc-guide, svg.tc-svg.hov .tc-focus { opacity: 1; }

/* 등장 애니메이션 — 카드가 화면에 들어올 때(.in) 선 그리기 → 영역 → 점 */
.tc.in .tc-line, .tc-plot.in .tc-line { animation: tcDraw 1.2s .1s var(--c-ease) forwards; }
.tc.in .tc-area, .tc-plot.in .tc-area { animation: tcFade .8s .6s var(--c-ease) forwards; }
.tc.in .tc-dot, .tc.in .tc-halo, .tc-plot.in .tc-dot, .tc-plot.in .tc-halo { animation: tcPop .45s cubic-bezier(.34,1.56,.64,1) forwards; }
.tc.in .tc-halo, .tc-plot.in .tc-halo { animation: tcPop .45s 1.1s cubic-bezier(.34,1.56,.64,1) forwards, tcPulse 2.6s 1.6s ease-in-out infinite; }
.tc.in .tc-val, .tc-plot.in .tc-val { animation: tcFade .5s 1s var(--c-ease) forwards; }
@keyframes tcDraw { to { stroke-dashoffset: 0; } }
@keyframes tcFade { to { opacity: 1; } }
@keyframes tcPop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
@keyframes tcPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .35; } }

/* 툴팁 */
.tc-tip { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; min-width: 96px; padding: 8px 11px; border-radius: 12px;
  background: rgba(255,255,255,.96); border: 1px solid #ece6d8; box-shadow: 0 10px 28px -10px rgba(23,18,8,.3), 0 2px 6px rgba(23,18,8,.06);
  backdrop-filter: blur(6px); display: flex; flex-direction: column; gap: 1px; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 14px)) scale(.96); opacity: 0; transition: opacity .15s var(--c-ease), transform .15s var(--c-ease); }
.tc-tip.below { transform: translate(-50%, 16px) scale(.96); }
.tc-tip.show { opacity: 1; transform: translate(-50%, calc(-100% - 14px)); }
.tc-tip.below.show { transform: translate(-50%, 16px); }
.tc-tip span { font-size: 11px; font-weight: 700; color: #a39b8c; font-variant-numeric: tabular-nums; }
.tc-tip b { font-size: 16px; font-weight: 900; color: #1c1710; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tc-tip b small { font-size: 11px; font-weight: 600; color: #8f887a; }
.tc-tip i { font-style: normal; font-size: 10.5px; font-weight: 800; color: #dc2626; }
.tc-tip em { font-style: normal; font-size: 11px; color: #6b6458; font-variant-numeric: tabular-nums; }

/* ── 확대 모달 ── */
.tcz.modal--chart { max-width: 980px; border-radius: 24px; }
.tcz .modal__head { padding: 18px 22px; }
.tcz .modal__title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.tcz-sub { margin-left: 6px; font-size: 12.5px; font-weight: 600; color: #9a9285; }
.tcz .modal__body { padding: 18px 22px 22px; gap: 0; }
.tcz-kpi { display: flex; flex-wrap: wrap; gap: 10px; }
.tcz-kpi > div { flex: 1 1 140px; padding: 12px 14px; border-radius: 14px; background: #faf9f6; display: flex; flex-direction: column; gap: 4px; }
.tcz-k { font-size: 11.5px; font-weight: 700; color: #9a9285; }
.tcz-kpi b { font-size: 22px; font-weight: 900; letter-spacing: -.03em; color: #1c1710; font-variant-numeric: tabular-nums; }
.tcz-kpi b.tcz-range { font-size: 16px; color: #047857; }
.tcz-kpi .tc-delta { align-self: flex-start; font-size: 13px; padding: 4px 10px; }
.tcz-u { font-size: 12px; color: #9a9285; }
.tcz .trend-legend { margin-top: 10px; }
.tcz .tl-line { width: 18px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #c8901a, #e3a92a); }
.tcz .tl-band { width: 18px; height: 11px; border-radius: 3px; background: rgba(16,185,129,.16); border: 1px dashed rgba(5,150,105,.5); }
.tcz .tl-dot--warn { width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2.5px solid #ef4444; box-shadow: none; }
.tcz-actions { display: flex; justify-content: flex-end; margin-top: 14px; }

/* ── 안내 · 빈 상태 ── */
.cmp .cmp-empty { padding: 56px 24px; border-radius: 22px; background: linear-gradient(180deg, #fffdf8, #fff); }
.cmp .cmp-hint { display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-radius: 22px;
  background: linear-gradient(110deg, #fffaf0 0%, #fff 55%, #f5fcf8 100%); }
.cmp-hint__art { width: 72px; height: 72px; object-fit: contain; flex: none; filter: drop-shadow(0 10px 14px rgba(23,18,8,.14)); animation: artFloat 5s ease-in-out infinite; }
.cmp-hint__txt { flex: 1; min-width: 0; }
.cmp-hint__txt b { display: block; font-size: 15.5px; font-weight: 800; color: #1c1710; letter-spacing: -.01em; }
.cmp-hint__txt p { margin: 3px 0 0; font-size: 13.5px; color: #6b6458; line-height: 1.55; }
.cmp-hint .btn { flex: none; }

/* ── 반응형 ── */
@media (max-width: 1100px) {
  .compare-layout.cmp { grid-template-columns: 260px minmax(0, 1fr); }
  .cmp .rank-hero.rank-hero--v2 { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; padding: 26px; }
  .rh-gauge { width: 200px; height: 200px; }
  .rh-center__v { font-size: 42px; }
  .rh-title { font-size: 26px; }
}
@media (max-width: 900px) {
  .compare-layout.cmp { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .cmp .cmp-side { position: static; padding: 16px 0 14px; }
  .cmp .cmp-side__head, .cmp .cmp-side__tools, .cmp .cmp-side__hint { margin-left: 16px; margin-right: 16px; }
  /* 모바일: 리포트 카드를 가로 스와이프 */
  .cmp .compare-select .select-list.cmp-list { flex-direction: row; overflow-x: auto; overflow-y: visible; max-height: none;
    padding: 4px 16px 8px; margin: 0; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-padding: 0 16px; }
  .cmp .cmp-list::-webkit-scrollbar { display: none; }
  .cmp .sel-item { flex: 0 0 232px; scroll-snap-align: start; }
  .cmp .sel-chips { flex-wrap: nowrap; }
  .cmp .cmp-side__hint { margin-top: 8px; }
  .cmp .rank-hero.rank-hero--v2 { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 26px 20px 22px; gap: 14px; }
  .rh-body { width: 100%; }
  .rh-eyebrow, .rh-chips { justify-content: center; }
  .rh-desc { margin: 0 auto; }
  .rh-dist { margin-left: auto; margin-right: auto; }
}
@media (max-width: 560px) {
  .cmp .cmp-card { padding: 18px 14px 14px; }
  .cmp-card__head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .cmp-filter { width: 100%; }
  .cmp-filter button { flex: 1 0 auto; padding: 7px 9px; }
  .pr-grid, .tc-grid { grid-template-columns: minmax(0, 1fr); }
  .rh-gauge { width: 184px; height: 184px; }
  .rh-center__v { font-size: 40px; }
  .rh-title { font-size: 23px; }
  .rh-desc { font-size: 13.5px; }
  .tc { padding: 14px 12px 8px; }
  .cmp .cmp-hint { flex-direction: column; text-align: center; gap: 10px; }
  .tcz .modal__body { padding: 14px; }
  .tcz-kpi b { font-size: 18px; }
}

/* ── 동작 줄이기 ── */
@media (prefers-reduced-motion: reduce) {
  .rh-arc, .pr-mark, .pr-mark span, .pr-mark::before { transition: none !important; }
  .rh-knob { animation: none; opacity: 1; }
  .rh-dist i, .pr-row, .cmp-hint__art { animation: none !important; }
  .tc-line { stroke-dasharray: none; stroke-dashoffset: 0; }
  .tc-area, .tc-dot, .tc-halo, .tc-val { opacity: 1; }
  .tc.in .tc-line, .tc.in .tc-area, .tc.in .tc-dot, .tc.in .tc-halo, .tc.in .tc-val,
  .tc-plot.in .tc-line, .tc-plot.in .tc-area, .tc-plot.in .tc-dot, .tc-plot.in .tc-halo, .tc-plot.in .tc-val { animation: none !important; }
  .tc.reveal { opacity: 1; transform: none; }
}
