/* 본사 '홈페이지 유입' 탭 4판(admin/site-traffic.js · site-traffic-charts.js, 2026-12-02 기획 12절 · 3판 11절 · 2판 10절).
   모든 규칙은 .tf 아래로 한정한다 — 문의함의 다른 화면 색·글꼴(Pretendard)은 건드리지 않는다.
   색: 값(크기) = 파랑 한 색 · 종류(경로·기기)만 여러 색, 순서 고정 · 늘어남/줄어듦 = 상태색 + 화살표 + 글자.
   3판 강조(focus): 하나를 고르면 전체 = 회색 --tf-whole(#a0a7b2, 흰 바탕 대비 2.42:1), 고른 것 = 파랑 #257de0.
   dataviz validate_palette.js(light)로 검증: 파랑↔회색 ΔE 20.4(보통 눈) · 17.5(색약 모의) — 회색이 '채도 기준'에서
   떨어지는 것은 강조형의 배경 회색이라 맞다. 글자는 색을 입히지 않고 색 점(●)으로 '전체 / 고른 것'을 가른다.
   경로 8색·기기 3색은 검증했다 — 연한 색(주황·청록·노랑·분홍)은 바탕 대비 3:1 미만이라 색만으로 읽게 하지 않는다.
   자리 고정: 상태마다 다른 글은 .tf-swap 칸에 겹쳐 두고 [data-off]로 숨긴다(자리는 남는다 → 누를 때 높이가 그대로).
   4판 항목별 선: 색은 dataviz 고정 순서 8색(s0~s7 = 파랑 · 주황 · 청록 · 노랑 · 분홍 · 초록 · 보라 · 빨강) — 9번째 색은 없다.
   validate_palette.js(light): 밝기 · 채도 · 색약 분리(이웃 최저 ΔE 11.8) · 보통 눈(20.5) 모두 통과, 연한 4색은 바탕 대비 3:1 미만 →
   옆 목록(이름 · 합계) · 선 끝 이름표 · 표로 보기 · 말풍선이 같은 값을 글자로 싣는다(색만으로 읽게 하지 않는다).
   그 밖 · 알 수 없음 = 회색 --tf-whole(채도 기준 미달은 회색이라 맞다), 끈 항목 = 속 빈 고리. */
.tf {
  --tf-ink: #14171a; --tf-ink-2: #454b54; --tf-muted: #6b7280; --tf-line: #e7e9ee; --tf-soft: #f5f6f8;
  --tf-blue: #257de0; --tf-blue-deep: #1b64be; --tf-blue-ink: #0f4a96; --tf-blue-wash: #eaf2fd; --tf-blue-line: #b9d3f5;
  --tf-track: #eef1f5; --tf-prev: #b8bec8; --tf-base: #d5d9e0; --tf-grid: #eceef2;
  --tf-whole: #a0a7b2; --tf-whole-deep: #7f8794;
  --tf-up: #006c10; --tf-down: #c0302f; --tf-wait-bg: #fff3dc; --tf-wait-ink: #7a4a00;
  position: relative; max-width: 1480px; margin: 0 auto; color: var(--tf-ink);
}
/* 종류 색(순서 고정: 검색 · 직접 방문 · SNS·블로그 · AI 답변 · 다른 사이트 · 광고 · 메일 · 캠페인 링크, 그 밖은 회색) */
.tf [data-seg=search], .tf [data-tone=search] { --c: #257de0; }
.tf [data-seg=direct], .tf [data-tone=direct] { --c: #f47230; }
.tf [data-seg=social], .tf [data-tone=social] { --c: #00b894; }
.tf [data-seg=ai], .tf [data-tone=ai] { --c: #f2a600; }
.tf [data-seg=referral], .tf [data-tone=referral] { --c: #ee7fac; }
.tf [data-seg=ads], .tf [data-tone=ads] { --c: #008a17; }
.tf [data-seg=email], .tf [data-tone=email] { --c: #6a4ce2; }
.tf [data-seg=campaign], .tf [data-tone=campaign] { --c: #ec4647; }
.tf [data-seg=internal], .tf [data-tone=internal] { --c: #b8bec8; }
.tf [data-seg=unknown], .tf [data-tone=unknown] { --c: #d5d9e0; }
.tf [data-seg=d-desktop], .tf [data-tone=d-desktop] { --c: #257de0; }
.tf [data-seg=d-mobile], .tf [data-tone=d-mobile] { --c: #f47230; }
.tf [data-seg=d-tablet], .tf [data-tone=d-tablet] { --c: #00b894; }
.tf [data-tone=cur] { --c: var(--tf-blue); }
.tf [data-tone=prev] { --c: var(--tf-prev); }
.tf [data-tone=whole] { --c: var(--tf-whole); }
.tf [data-tone=part] { --c: var(--tf-blue); }
/* 항목별 선의 색 자리(항목에 붙는다 — 순위가 바뀌어도 같은 항목은 같은 색) */
.tf [data-tone=s0] { --c: #257de0; }
.tf [data-tone=s1] { --c: #f47230; }
.tf [data-tone=s2] { --c: #00b894; }
.tf [data-tone=s3] { --c: #f2a600; }
.tf [data-tone=s4] { --c: #ee7fac; }
.tf [data-tone=s5] { --c: #008a17; }
.tf [data-tone=s6] { --c: #6a4ce2; }
.tf [data-tone=s7] { --c: #ec4647; }
.tf [data-tone=gray] { --c: var(--tf-whole); }
.tf [data-tone=off] { --c: #d5d9e0; }

/* 자리 고정 칸: 여러 상태의 글을 같은 칸에 겹쳐 두고 보이는 것만 바꾼다 */
.tf-swap { display: grid; min-width: 0; }
.tf-swap > * { grid-area: 1 / 1; min-width: 0; }
.tf [data-off] { visibility: hidden; }
/* 고른 것을 가르는 색 점 */
.tf-key { flex: none; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--tf-blue)); }
/* 고른 것을 기다리는 자리(옅게) */
.tf-pv-wait { display: inline-block; width: 2.6em; height: .72em; border-radius: 4px; background: linear-gradient(100deg, #e3e9f2 30%, #f3f6fa 50%, #e3e9f2 70%) 0 0 / 300% 100%; animation: fx-shimmer 1.3s linear infinite; vertical-align: middle; }

/* 다시 받는 동안: 옛 화면을 그대로 두고 맨 위에 가는 진행 선만(빠른 응답이면 흐려지지 않게 120ms 뒤부터) */
.tf-progress { position: sticky; top: 60px; z-index: 25; height: 0; pointer-events: none; }
.tf-progress::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--tf-blue), transparent) no-repeat; background-size: 35% 100%; opacity: 0; transition: opacity .14s; }
.tf[data-busy] .tf-progress::before { opacity: 1; animation: tf-progress 1.1s linear infinite; }
@keyframes tf-progress { from { background-position: -60% 0; } to { background-position: 160% 0; } }
.tf-body { transition: opacity .16s ease .12s; }
/* 전체(base)를 다시 받을 때만 옛 화면을 옅게. 고른 것만 기다릴 때는 전체를 그대로 둔다. */
.tf[data-base-wait] .tf-body { opacity: .62; }
.tf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* A. 머리줄 */
.tf-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin: 0 0 14px; }
.tf-title { flex: 1 1 360px; min-width: 0; }
.tf .tf-title h1 { margin: 0; color: var(--tf-ink); font-size: 28px; font-weight: 750; letter-spacing: -.03em; line-height: 1.2; }
.tf-sub { max-width: 760px; margin: 6px 0 0; color: var(--tf-ink-2); font-size: 13px; line-height: 1.6; }
.tf-sub b { color: var(--tf-ink); font-weight: 700; }
.tf-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tf-periods { display: inline-flex; padding: 3px; border: 1px solid var(--tf-line); border-radius: 11px; background: var(--tf-soft); }
.tf-periods button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--tf-ink-2); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; transition: background-color .14s, color .14s, box-shadow .14s; }
.tf-periods button:hover { color: var(--tf-ink); }
.tf-periods button[aria-pressed=true] { background: #fff; color: var(--tf-ink); box-shadow: 0 1px 2px rgba(20, 23, 26, .14), 0 0 0 1px rgba(20, 23, 26, .05); }
.tf-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tf .tf-actions .secondary, .tf .tf-guide-actions .secondary, .tf .tf-empty .secondary { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.tf .tf-icon-btn { width: 38px; padding: 0; }
.tf .tf-icon-btn.is-spinning .xi { animation: fx-spin .8s linear infinite; }

/* 보는 기간 · 비교 기간 · 강조 줄(● 미국 강조 중 · 전체의 22% · 강조 풀기) */
.tf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; min-height: 48px; margin: 0 0 16px; padding: 0 0 12px; border-bottom: 1px solid var(--tf-line); }
.tf-range { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.tf-range b { color: var(--tf-ink); font-weight: 700; }
.tf-range span { color: var(--tf-muted); }
.tf-focus { flex: 1 1 360px; align-items: center; }
.tf-focus-hint { color: var(--tf-ink-2); font-size: 13px; line-height: 1.5; }
.tf-focus-on { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--tf-ink-2); font-size: 13px; line-height: 1.5; }
.tf-focus-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 3px 12px 3px 10px; border: 1px solid var(--tf-blue-line); border-radius: 999px; background: var(--tf-blue-wash); color: var(--tf-ink); }
.tf-focus-name small { color: var(--tf-ink-2); font-size: 12px; font-weight: 600; }
.tf-focus-name b { min-width: 0; font-weight: 750; overflow-wrap: anywhere; }
.tf-focus-share { font-variant-numeric: tabular-nums; }
.tf-focus-share b { color: var(--tf-ink); font-weight: 750; }
.tf-focus-share[data-wait] { color: var(--tf-muted); }
.tf-focus-share[data-err] { color: var(--tf-down); font-weight: 650; }
.tf-link-btn { padding: 4px 2px; border: 0; background: none; color: var(--tf-blue-ink); font: inherit; font-size: 13px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tf-foot { margin: 0 0 16px; color: var(--tf-muted); font-size: 12.5px; line-height: 1.7; }
.tf-foot b { color: var(--tf-ink-2); font-weight: 650; }
.tf-foot:empty { display: none; }

/* B. 숫자 넷 — 칸마다 단추 */
.tf-kpis, .tf-skel-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.tf-kpi { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; padding: 14px 16px 10px; border: 1px solid var(--tf-line); border-radius: 14px; background: #fff; color: var(--tf-ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .14s, box-shadow .14s, background-color .14s; }
.tf-kpi:hover { border-color: #cdd3dc; box-shadow: 0 6px 16px -10px rgba(20, 23, 26, .25); }
.tf-kpi:active { transform: translateY(1px); }
.tf-kpi[aria-pressed=true] { border-color: var(--tf-blue); background: linear-gradient(180deg, #f4f8fe, #fff 72%); box-shadow: inset 0 0 0 1px var(--tf-blue); }
.tf-kpi[data-pending] { background: #fcfcfd; }
.tf-kpi-label { display: flex; align-items: center; gap: 8px; width: 100%; color: var(--tf-ink-2); font-size: 13.5px; font-weight: 650; }
.tf-kpi-on { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--tf-blue); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tf-num { display: block; color: var(--tf-ink); font-size: 36px; font-weight: 760; line-height: 1.12; letter-spacing: -.035em; overflow-wrap: anywhere; }
.tf-num[data-pending] { color: var(--tf-muted); font-weight: 600; }
.tf-delta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tf-delta b { font-weight: 750; }
.tf-delta[data-dir=up] b { color: var(--tf-up); }
.tf-delta[data-dir=down] b { color: var(--tf-down); }
.tf-delta[data-dir=none], .tf-delta[data-dir=flat], .tf-delta[data-dir=partial] { color: var(--tf-ink-2); }
.tf-kpi-help { color: var(--tf-ink-2); font-size: 12.5px; line-height: 1.45; }
.tf-delta-prev { color: var(--tf-ink-2); }
/* 증감 줄 ↔ 고른 것 줄(비중 막대 + ● 미국 1,154 · 22%)이 같은 칸 */
.tf-kpi-swap { width: 100%; align-items: start; }
.tf-kpi-part { display: flex; flex-direction: column; }
.tf-meter { position: relative; display: block; height: 4px; margin: 4px 0 6px; border-radius: 2px; background: var(--tf-whole); }
.tf-meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: var(--tf-blue); }
.tf-kpi-part[data-wait] .tf-meter { background: var(--tf-track); }
.tf-kpi-part-text { display: flex; align-items: baseline; gap: 4px 8px; min-width: 0; color: var(--tf-ink-2); font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-kpi-part-name { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--tf-ink); font-weight: 650; }
.tf-kpi-part-name > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tf-kpi-part-val { display: inline-flex; align-items: baseline; gap: 5px; flex: none; }
.tf-kpi-part-val b { color: var(--tf-ink); font-weight: 750; }
.tf-spark { display: block; width: 100%; height: 30px; margin-top: 6px; overflow: visible; }
.tf-spark-line { fill: none; stroke: var(--tf-prev); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.tf-spark-area { fill: transparent; }
.tf-kpi[aria-pressed=true] .tf-spark-line { stroke: var(--tf-blue); stroke-width: 2; }
.tf-kpi[aria-pressed=true] .tf-spark-area { fill: rgba(37, 125, 224, .1); }
.tf-spark-whole { fill: none; stroke: var(--tf-whole); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.tf-spark-part { fill: none; stroke: var(--tf-blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tf-wait { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--tf-wait-bg); color: var(--tf-wait-ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
.tf-wait .xi { width: 14px; height: 14px; }
.tf-kpi .tf-wait { margin-top: 6px; }

/* 카드 */
.tf-card { position: relative; min-width: 0; padding: 18px 20px 16px; border: 1px solid var(--tf-line); border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(20, 23, 26, .03); }
.tf-card:focus { outline: none; }
.tf-card[data-flash] { animation: tf-flash 1.4s ease-out; }
@keyframes tf-flash { 0%, 45% { box-shadow: 0 0 0 3px rgba(37, 125, 224, .4); } 100% { box-shadow: 0 0 0 3px rgba(37, 125, 224, 0); } }
.tf-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 14px; margin: 0 0 14px; }
.tf-card-head > div:first-child { flex: 1 1 240px; min-width: 0; }
.tf .tf-card-head h2 { margin: 0; color: var(--tf-ink); font-size: 16px; font-weight: 700; letter-spacing: -.02em; line-height: 1.35; }
.tf-card-head p { margin: 4px 0 0; color: var(--tf-ink-2); font-size: 13px; line-height: 1.55; }
/* 머리 오른쪽: 기준 표시 + 범례(● 전체 ● 미국). 범례 자리는 늘 잡혀 있다. */
.tf-head-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 100%; }
.tf-basis { flex: none; padding: 3px 9px; border-radius: 999px; background: var(--tf-soft); color: var(--tf-ink-2); font-size: 12px; font-weight: 650; white-space: nowrap; }
.tf-card-legend { flex-wrap: nowrap; margin: 0; }
.tf-legend-name { display: inline-block; width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.tf-card-legend .tf-legend-name { width: 7em; }
.tf-legend li[data-wait] { animation: tf-wait-pulse 1.2s ease-in-out infinite; }
@keyframes tf-wait-pulse { 50% { opacity: .45; } }
.tf-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 4px 0 0; padding: 14px 16px; border-radius: 10px; background: var(--tf-soft); color: var(--tf-ink-2); font-size: 13px; }
.tf-empty p { margin: 0; }
.tf-rest { margin: 10px 0 0; color: var(--tf-ink-2); font-size: 12.5px; line-height: 1.6; }
.tf-rest b { color: var(--tf-ink); font-weight: 650; }
/* 좁은 카드(나란히 놓인 작은 카드 · 휴대폰): 머리 오른쪽(기준 · 범례)을 제목 아래 한 줄로. 카드 폭으로 정해지므로 강조 전후로 같다. */
.tf-card { container-type: inline-size; }
@container (max-width: 470px) {
  .tf-card-head { flex-direction: column; flex-wrap: nowrap; }
  .tf-card-head > div:first-child { flex: none; width: 100%; }
  .tf-head-side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
  .tf-legend-swap { justify-items: start; }
}
.tf-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 16px; margin: 0 0 16px; }
/* 순위 카드(정렬되는 표): 숫자 열 넷이 다 들어가는 폭(620px)이면 두 칸, 아니면 한 칸 — 1280 화면에서는 한 칸이라 모든 숫자가 보인다. */
.tf-sheets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 620px), 1fr)); gap: 16px; align-items: start; margin: 0 0 16px; }

/* C. 날짜별 추이 */
.tf-trend { margin: 0 0 16px; }
.tf-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 2px 0 0; padding: 0; list-style: none; color: var(--tf-ink-2); font-size: 12.5px; }
.tf-legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tf-legend i { width: 16px; height: 3px; border-radius: 2px; background: var(--c); }
.tf-legend i[data-tone=prev] { height: 2px; }
.tf-legend i.tf-key { width: 8px; height: 8px; border-radius: 50%; }
.tf-legend small { color: var(--tf-muted); font-size: 12px; }
.tf-legend-swap { justify-items: end; }
.tf-chart { position: relative; margin: 0 -4px; padding: 0 4px; border-radius: 10px; cursor: crosshair; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.tf-chart:focus-visible { outline: 2px solid var(--tf-blue); outline-offset: 4px; }
.tf-chart-plot { height: 260px; }
/* 큰 그래프의 보기 단추 한 줄(12-1) — 기간 단추와 같은 모양 */
.tf-views { display: flex; flex-wrap: wrap; gap: 2px; width: fit-content; max-width: 100%; margin: 0 0 14px; padding: 3px; border: 1px solid var(--tf-line); border-radius: 11px; background: var(--tf-soft); }
.tf-views button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--tf-ink-2); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; transition: background-color .14s, color .14s, box-shadow .14s; }
.tf-views button:hover { color: var(--tf-ink); }
.tf-views button[aria-pressed=true] { background: #fff; color: var(--tf-ink); box-shadow: 0 1px 2px rgba(20, 23, 26, .14), 0 0 0 1px rgba(20, 23, 26, .05); }
.tf-chart-note { color: var(--tf-ink); font-weight: 600; }
/* 숫자 넷: 높이 고정(방문을 세지 않으면 그 자리를 안내 한 줄과 나머지 그래프가 나눈다) */
.tf-four { display: flex; flex-direction: column; height: 500px; }
.tf-four-plot { flex: 1 1 auto; min-height: 0; }
.tf-four-wait { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 10px; padding: 6px 10px; border-radius: 9px; background: var(--tf-soft); color: var(--tf-ink-2); font-size: 13px; }
.tf-four-wait b { color: var(--tf-ink); font-weight: 700; }
.tf-g-ptitle { fill: var(--tf-ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tf-g-pname { fill: var(--tf-ink); font-size: 13px; font-weight: 700; }
/* 항목별 선: 그래프 + 옆 목록(좁으면 아래). 그래프 자리 높이 고정 — 받는 중 · 안내 · 실패도 같은 자리. */
.tf-lines { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 18px; height: 260px; }
.tf-lines > .tf-chart { min-width: 0; margin: 0; padding: 0; } /* 추이의 -4px 여백(초점 테두리 자리)을 두면 한 칸 배치에서 4px 넘친다 */
.tf-lines[data-wait] { opacity: .5; pointer-events: none; }
.tf-lines-msg { display: flex; align-items: center; }
.tf-lines-msg > * { flex: 1 1 auto; }
.tf-plot-wait { border-radius: 10px; background: linear-gradient(100deg, #eef1f5 30%, #f7f8fa 50%, #eef1f5 70%) 0 0 / 300% 100%; animation: fx-shimmer 1.3s linear infinite; }
.tf-lines-empty { position: absolute; inset: 0 0 30px 40px; display: grid; place-items: center; margin: 0; color: var(--tf-ink-2); font-size: 13px; pointer-events: none; }
.tf-slist-box { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding-left: 16px; border-left: 1px solid var(--tf-line); }
.tf-slist-head { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 4px; padding: 0 6px; color: var(--tf-ink-2); font-size: 12px; font-weight: 650; }
.tf-slist { flex: 1 1 auto; min-height: 0; margin: 0; padding: 0; overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.tf-sitem { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 3.4em; align-items: center; gap: 8px; width: 100%; min-height: 30px; margin: 0; padding: 3px 6px; border: 0; border-radius: 7px; background: transparent; color: var(--tf-ink-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; transition: background-color .14s; }
.tf-sitem:hover { background: var(--tf-soft); }
.tf-sitem:focus-visible { outline: 2px solid var(--tf-blue); outline-offset: -2px; }
.tf-sitem[aria-pressed=true] { color: var(--tf-ink); }
.tf-sitem[aria-pressed=true] .tf-sname { font-weight: 650; }
.tf-sitem[data-picked] { background: var(--tf-blue-wash); }
.tf-skey { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--tf-whole)); }
.tf-skey[data-tone=off] { background: transparent; box-shadow: inset 0 0 0 1.5px #a0a7b2; }
.tf-sname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-sval { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-sitem[aria-pressed=false] .tf-sval { font-weight: 600; }
.tf-sshare { color: var(--tf-ink-2); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-sitem-wait { display: block; height: 14px; margin: 8px 6px; border-radius: 4px; background: linear-gradient(100deg, #eef1f5 30%, #f7f8fa 50%, #eef1f5 70%) 0 0 / 300% 100%; animation: fx-shimmer 1.3s linear infinite; }
.tf-slist-note { flex: none; min-height: 1.6em; margin: 6px 0 0; padding: 0 6px; color: var(--tf-ink-2); font-size: 12px; line-height: 1.5; }
.tf-slist-note[data-full] { color: var(--tf-down); font-weight: 650; }
.tf-g-sline { fill: none; stroke: var(--c, var(--tf-whole)); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tf-g-sline[data-tone=gray] { stroke-width: 1.5; }
.tf-g-sline[data-bold] { stroke-width: 3.5; }
.tf-g-sline[data-dim], .tf-g-sdot[data-dim] { opacity: .22; }
.tf-g-sdot, .tf-g-send { fill: var(--c, var(--tf-whole)); stroke: #fff; stroke-width: 2; }
.tf-g-label { fill: var(--tf-ink-2); font-size: 12px; font-weight: 600; }
@container (max-width: 700px) {
  .tf-lines { grid-template-columns: minmax(0, 1fr); grid-template-rows: 210px 236px; gap: 12px; height: auto; }
  .tf-lines .tf-chart-plot { height: 210px; }
  .tf-lines-msg { height: 458px; }
  .tf-slist-box { padding: 8px 0 0; border-left: 0; border-top: 1px solid var(--tf-line); }
}
.tf-g { display: block; overflow: visible; }
.tf-g-grid { stroke: var(--tf-grid); stroke-width: 1; shape-rendering: crispEdges; }
.tf-g-base { stroke: var(--tf-base); stroke-width: 1; shape-rendering: crispEdges; }
.tf-g-tick { fill: var(--tf-ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.tf-g-prev { fill: none; stroke: var(--tf-prev); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.tf-g-area { fill: rgba(37, 125, 224, .1); }
.tf-g-line { fill: none; stroke: var(--tf-blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tf-g-end, .tf-g-dot { fill: var(--tf-blue); stroke: #fff; stroke-width: 2; }
.tf-g-dot-prev { fill: var(--tf-prev); stroke: #fff; stroke-width: 2; }
/* 강조 중: 전체 = 회색 면+선, 고른 것 = 파랑 선 */
.tf-g-area-whole { fill: rgba(160, 167, 178, .16); }
.tf-g-line-whole { fill: none; stroke: var(--tf-whole); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tf-g-part { fill: none; stroke: var(--tf-blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tf-g-end-whole, .tf-g-dot-whole { fill: var(--tf-whole); stroke: #fff; stroke-width: 2; }
.tf-chart[data-wait] .tf-g-line-whole { animation: tf-wait-pulse 1.2s ease-in-out infinite; }
.tf-g-cross { stroke: rgba(20, 23, 26, .38); stroke-width: 1; shape-rendering: crispEdges; }
.tf-g-pin { stroke: var(--tf-blue-deep); stroke-width: 1.5; }
.tf-pinned { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--tf-blue-wash); color: var(--tf-ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.tf-pinned b { color: var(--tf-blue-ink); }
.tf-pin-ic { width: 3px; height: 14px; border-radius: 2px; background: var(--tf-blue-deep); }
.tf-pinned .tf-link-btn { margin-left: auto; }

/* 표로 보기 */
.tf-more { margin-top: 12px; }
.tf-more > summary { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--tf-ink-2); font-size: 13px; font-weight: 650; list-style: none; cursor: pointer; }
.tf-more > summary::-webkit-details-marker { display: none; }
.tf-more > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .14s; }
.tf-more[open] > summary::before { transform: rotate(45deg); }
.tf-more .tf-table-wrap { max-height: 360px; margin-top: 8px; overflow: auto; border: 1px solid var(--tf-line); border-radius: 10px; }
/* position: relative — 표 안의 화면 낭독용 글(.tf-sr, absolute)이 스크롤 칸 밖으로 새어 페이지 폭을 늘리지 않게 */
.tf-table-wrap { position: relative; max-width: 100%; overflow-x: auto; }
.tf-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tf-table th, .tf-table td { padding: 7px 10px; border-bottom: 1px solid var(--tf-line); color: var(--tf-ink); text-align: right; white-space: nowrap; }
.tf-table thead th { position: sticky; top: 0; z-index: 1; background: #fafbfc; color: var(--tf-ink-2); font-size: 12px; font-weight: 650; }
.tf-table th:first-child, .tf-table td:first-child { text-align: left; }
.tf-table tbody th { font-weight: 600; }
.tf-table tbody tr:last-child > * { border-bottom: 0; }
.tf-th-part .tf-key { margin-right: 5px; vertical-align: 1px; }

/* 정렬되는 표 + 막대(12-2): 머리 줄(열 제목 단추) + 줄들. 머리와 줄은 같은 격자(열 수는 data-ncol).
   줄 전체를 누르면 강조 — 이름 칸의 단추(.tf-rank-btn)가 ::after로 줄 전체를 덮는다. 출처 펼치기 단추만 그 위에 올라온다.
   막대 안: 전체(tf-w) 위에 고른 것(tf-p)을 같은 기준선에서 겹친다. 끝 칸은 비중 ↔ 고른 것 값(같은 칸). */
.tf-sheet { --tf-name: minmax(7.5em, 1.2fr); }
.tf-sheet[data-sheet=pages] { --tf-name: minmax(9.5em, 1.45fr); }
.tf-sheet[data-sheet=campaigns] { --tf-name: minmax(9em, 1.4fr); }
.tf-sheet-head, .tf-rank, .tf-src { display: grid; align-items: center; column-gap: 12px; }
.tf-sheet[data-ncol="4"] :is(.tf-sheet-head, .tf-rank, .tf-src) { grid-template-columns: var(--tf-name) minmax(56px, 1fr) repeat(4, 5.6em) 5.4em; }
.tf-sheet[data-ncol="3"] :is(.tf-sheet-head, .tf-rank, .tf-src) { grid-template-columns: var(--tf-name) minmax(56px, 1fr) repeat(3, 5.6em) 5.4em; }
.tf-sheet[data-ncol="2"] :is(.tf-sheet-head, .tf-rank, .tf-src) { grid-template-columns: var(--tf-name) minmax(56px, 1fr) repeat(2, 5.6em) 5.4em; }
.tf-sheet-head { min-height: 34px; margin: 0 0 2px; padding: 0 10px 4px 22px; border-bottom: 1px solid var(--tf-line); font-size: 14px; }
.tf-sh { min-width: 0; color: var(--tf-ink-2); font-size: 12px; font-weight: 650; line-height: 1.25; }
.tf-sh[data-col]:not([data-col=name]), .tf-sh-end { text-align: right; justify-items: end; }
/* 열 제목은 줄을 바꾸지 않는다(정렬 화살표가 옮겨 다녀도 머리 줄 높이가 같게) */
.tf-sh button { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; white-space: nowrap; margin: 0; padding: 4px 2px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; text-align: inherit; cursor: pointer; transition: color .14s, background-color .14s; }
/* 오른쪽 맞춤 열은 화살표를 글자 앞에 둔다 — 글자 끝이 숫자 끝과 맞는다 */
.tf-sh[data-col]:not([data-col=name]) button { flex-direction: row-reverse; justify-content: flex-start; }
.tf-sh button:hover { color: var(--tf-ink); background: var(--tf-soft); }
.tf-sh:is([aria-sort=ascending], [aria-sort=descending]) button { color: var(--tf-ink); font-weight: 750; }
.tf-sort-ic { flex: none; width: 1em; font-size: 10px; font-style: normal; text-align: center; }
.tf-sh-part { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; color: var(--tf-ink); white-space: nowrap; }
.tf-sh-part > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tf-ranks { display: grid; gap: 2px; }
.tf-rank, .tf-src { position: relative; min-height: 38px; margin: 0; padding: 6px 10px 6px 22px; border-radius: 9px; color: var(--tf-ink); font-size: 14px; transition: background-color .14s, box-shadow .14s; }
.tf-rank:hover, .tf-rank[data-tip-on], .tf-src:hover, .tf-src[data-tip-on] { background: var(--tf-soft); }
.tf-rank:has(.tf-rank-btn:active) { background: #eceff3; }
.tf-rank:has(.tf-rank-btn[aria-pressed=true]) { background: var(--tf-blue-wash); box-shadow: inset 3px 0 0 var(--tf-blue); }
.tf-rank:has(.tf-rank-btn[aria-pressed=true]) :is(.tf-rank-name, .tf-rank-val) { font-weight: 750; }
.tf-rank:has(.tf-rank-btn:focus-visible), .tf-rank[data-static]:focus-visible, .tf-src:focus-visible { outline: 2px solid var(--tf-blue); outline-offset: 1px; }
.tf-rank-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; line-height: 1.35; }
.tf-rank-btn { display: flex; align-items: center; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tf-rank-btn::after { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: 9px; }
.tf-rank-btn:focus-visible { outline: none; }
.tf-rank-btn[data-static] { cursor: default; }
.tf-rank-btn[data-static]::after { content: none; }
.tf-rank-label { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.tf-rank-label > span { min-width: 0; word-break: keep-all; overflow-wrap: anywhere; } /* 한글 이름은 띄어쓰기에서만 줄을 바꾼다(넘칠 때만 글자 단위) */
.tf-rank-label small { flex: none; color: var(--tf-muted); font-size: 12px; font-weight: 500; }
/* 페이지 · 캠페인: 이름 아래에 주소(출처 · 종류)를 작게 */
.tf-sheet:is([data-sheet=pages], [data-sheet=campaigns]) .tf-rank-label { flex-direction: column; align-items: flex-start; gap: 0; }
.tf-sheet:is([data-sheet=pages], [data-sheet=campaigns]) .tf-rank-label small { overflow-wrap: anywhere; }
/* 눌린 줄의 색 점(자리는 왼쪽 여백 안 — 이름이 밀리지 않는다) */
.tf-pick { position: absolute; left: 8px; top: calc(50% - 4px); width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.tf-rank-btn[aria-pressed=true] .tf-pick { background: var(--tf-blue); }
.tf-rank-track { position: relative; display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--tf-track); }
/* 막대(위치를 가진 칸)가 줄을 덮는 강조 단추(::after)보다 위에 그려지므로, 막대 위를 눌러도 줄이 눌리게 막대는 누름을 받지 않는다 */
.tf-rank > .tf-rank-track { pointer-events: none; }
.tf-rank-track i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 0 4px 4px 0; transition: background-color .14s; }
.tf-rank-track .tf-w { background: var(--c, var(--tf-blue)); }
.tf-rank-track .tf-w[data-nz] { min-width: 3px; }
.tf-rank-track .tf-p { background: var(--tf-blue); }
.tf-rank:hover .tf-w:not([data-seg]), .tf-rank[data-tip-on] .tf-w:not([data-seg]), .tf-fn-row:hover .tf-w, .tf-fn-row[data-tip-on] .tf-w { background: var(--tf-blue-deep); }
.tf-src[data-tip-on] .tf-w[data-seg], .tf-rank[data-tip-on] .tf-w[data-seg] { background: var(--c); filter: brightness(.88); }
/* 강조 중: over 카드는 전체 막대가 회색, own 카드는 고른 줄만 파랑(색 막대도) */
.tf-card[data-mode=over] .tf-w, .tf-card[data-mode=own] .tf-rank:not(:has(.tf-rank-btn[aria-pressed=true])) .tf-w, .tf-card[data-mode=over] .tf-w[data-seg] { background: var(--tf-whole); filter: none; }
.tf-card[data-mode=own] .tf-rank:has(.tf-rank-btn[aria-pressed=true]) .tf-w { background: var(--tf-blue); filter: none; }
.tf-card[data-mode=over] :is(.tf-rank, .tf-src, .tf-fn-row):is(:hover, [data-tip-on]) .tf-w,
.tf-card[data-mode=own] .tf-rank:not(:has(.tf-rank-btn[aria-pressed=true])):is(:hover, [data-tip-on]) .tf-w { background: var(--tf-whole-deep); }
.tf-card[data-mode=over] :is(.tf-rank, .tf-fn-row):is(:hover, [data-tip-on]) .tf-p { background: var(--tf-blue-deep); }
/* 숫자 열: 오른쪽 맞춤 · 고정폭 숫자. 정렬 기준 열(tf-rank-val)은 진하게, 0은 흐리게. */
.tf-rank-num { min-width: 0; color: var(--tf-ink-2); font-size: 13.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-rank-val { color: var(--tf-ink); font-size: 14px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-rank-num[data-zero] { color: var(--tf-muted); font-weight: 500; }
.tf-rank-end { justify-items: end; align-items: center; }
.tf-rank-share { color: var(--tf-ink-2); font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-rank-part { text-align: right; white-space: nowrap; }
.tf-pv { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; color: var(--tf-ink); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-dot { flex: none; align-self: center; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--tf-blue)); }
.tf-more-rows { margin: 6px 0 0 10px; }
/* 좁은 카드에서만 보이는 정렬 단추 줄 */
.tf-sortbar { display: none; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 10px; color: var(--tf-ink-2); font-size: 12.5px; }
.tf-sortbar-label { font-weight: 650; }
.tf-sortbar-set, .tf-toggle { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--tf-line); border-radius: 10px; background: var(--tf-soft); }
.tf-sortbar button, .tf-toggle button { min-height: 28px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--tf-ink-2); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; transition: background-color .14s, color .14s; }
.tf-sortbar button[aria-pressed=true], .tf-toggle button[aria-pressed=true] { background: #fff; color: var(--tf-ink); box-shadow: 0 1px 2px rgba(20, 23, 26, .14), 0 0 0 1px rgba(20, 23, 26, .05); }
@container (max-width: 600px) {
  .tf-sortbar { display: flex; }
  /* 기준 숫자 칸은 고정 폭(줄마다 auto면 이름 칸 끝 · 출처 단추 자리가 줄마다 달라진다) */
  .tf-sheet[data-ncol] :is(.tf-rank, .tf-src) { grid-template-columns: minmax(0, 1fr) 4.6em 4.8em; grid-template-areas: "name val end" "bar bar bar"; gap: 6px 8px; padding: 8px 10px 8px 22px; }
  /* 머리 줄의 기준 숫자 칸은 글자만큼(auto) — 오른쪽 끝은 비중 칸(고정 폭) 앞이라 아래 숫자 끝과 맞는다 */
  .tf-sheet[data-ncol] .tf-sheet-head { grid-template-columns: minmax(0, 1fr) auto 4.8em; grid-template-areas: "name val end"; column-gap: 8px; }
  .tf-sheet .tf-expand { min-width: 0; padding: 0 4px 0 8px; }
  .tf-sheet :is(.tf-rank-name, .tf-sh[data-col=name]) { grid-area: name; }
  .tf-sheet :is(.tf-rank, .tf-src) > .tf-rank-track { grid-area: bar; }
  .tf-sheet :is(.tf-rank-val, .tf-sh.is-key) { grid-area: val; }
  .tf-sheet :is(.tf-rank-end, .tf-sh-end) { grid-area: end; }
  .tf-sheet :is(.tf-rank-num:not(.tf-rank-val), .tf-sh[data-col]:not([data-col=name]):not(.is-key), .tf-sh-bar) { display: none; }
  .tf-pick { top: 15px; }
}
/* 전환 흐름: [이름 · 값 · 앞 단계 대비 · 처음 대비] / [막대 · ● 고른 것 값 · 앞 단계 대비 · 처음 대비]. 값·비율 칸은 너비 고정(막대 길이가 강조 전후로 같게) */
.tf-fn { display: grid; gap: 2px; }
.tf-fn-head { display: grid; grid-template-columns: minmax(0, 1fr) 4.8em 6.4em 6.4em; gap: 0 12px; padding: 0 10px 4px; border-bottom: 1px solid var(--tf-line); color: var(--tf-ink-2); font-size: 12px; font-weight: 650; }
.tf-fn-head > span:not(:first-child) { text-align: right; }
.tf-fn-row { display: grid; grid-template-columns: minmax(0, 1fr) 4.8em 6.4em 6.4em; grid-template-areas: "name val rate first" "bar pval prate pfirst"; align-items: center; gap: 4px 12px; width: 100%; margin: 0; padding: 7px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--tf-ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; transition: background-color .14s, box-shadow .14s; }
.tf-fn-row:hover, .tf-fn-row[data-tip-on] { background: var(--tf-soft); }
.tf-fn-name { grid-area: name; min-width: 0; font-weight: 600; line-height: 1.4; }
.tf-fn-val { grid-area: val; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-fn-rate, .tf-fn-first { grid-area: rate; color: var(--tf-ink-2); font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-fn-first { grid-area: first; }
.tf-fn-row > .tf-rank-track { grid-area: bar; }
.tf-fn-pval { grid-area: pval; justify-self: end; }
.tf-fn-prate { grid-area: prate; }
.tf-fn-pfirst { grid-area: pfirst; }
.tf-fn-why { color: var(--tf-ink); font-weight: 600; }
.tf-side { display: grid; gap: 2px; width: 100%; margin: 10px 0 0; padding: 10px 12px; border: 1px solid var(--tf-line); border-radius: 10px; background: #fff; color: var(--tf-ink-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; transition: background-color .14s, border-color .14s; }
.tf-side-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.tf-side-part { flex-wrap: nowrap; align-items: center; white-space: nowrap; }
.tf-side b { color: var(--tf-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.tf-side small { color: var(--tf-ink-2); font-size: 12.5px; }
.tf-side:hover, .tf-side[data-tip-on] { background: var(--tf-soft); }
.tf-side[aria-pressed=true] { border-color: var(--tf-blue-line); background: var(--tf-blue-wash); }

/* 얇은 조각 막대(글자 없음) — 조각 사이 2px 틈, 양 끝만 둥글게. 닿는 범위는 위아래로 넓게.
   강조 중에는 '전체' 줄 아래에 고른 것 줄을 하나 더(왼쪽에 이름표). 둘째 줄 자리는 늘 있다. */
.tf-segs { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); align-items: center; gap: 8px 10px; margin: 2px 0 14px; }
.tf-seg-label { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--tf-ink-2); font-size: 12.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.tf-seg-label > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tf-seg-slot { min-width: 0; }
.tf-seg { display: flex; gap: 2px; height: 8px; margin: 0; border-radius: 999px; }
.tf-seg:empty { background: var(--tf-track); }
.tf-seg[data-wait] { background: linear-gradient(100deg, #e3e9f2 30%, #f3f6fa 50%, #e3e9f2 70%) 0 0 / 300% 100%; animation: fx-shimmer 1.3s linear infinite; }
.tf-seg-part { position: relative; flex: 0 1 0; min-width: 4px; background: var(--c, var(--tf-blue)); transition: opacity .14s; }
.tf-seg-part:first-child { border-radius: 999px 0 0 999px; }
.tf-seg-part:last-child { border-radius: 0 999px 999px 0; }
.tf-seg-part:only-child { border-radius: 999px; }
.tf-seg-part::after { content: ""; position: absolute; inset: -10px 0; }
.tf-seg:has([data-tip-on]) .tf-seg-part:not([data-tip-on]) { opacity: .35; }
.tf-seg[data-pick] .tf-seg-part:not([data-picked]) { opacity: .3; }
.tf-seg-part:focus-visible { outline: 2px solid var(--tf-ink); outline-offset: 3px; }

/* 경로 줄의 출처 펼치기(이름 칸 오른쪽 — 줄을 덮는 강조 단추보다 위에 올라온다) + 출처 줄(같은 격자, 이름만 들여 쓴다) */
.tf-expand { position: relative; z-index: 1; margin-left: auto; flex: none; display: inline-flex; align-items: center; justify-content: space-between; gap: 3px; min-width: 5.4em; min-height: 28px; padding: 0 6px 0 10px; border: 1px solid var(--tf-line); border-radius: 999px; background: #fff; color: var(--tf-ink-2); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; transition: border-color .14s, color .14s; }
.tf-expand:hover { border-color: #c6ccd5; color: var(--tf-ink); }
.tf-expand .xi { width: 12px; height: 12px; transition: transform .14s; }
.tf-expand[aria-expanded=true] .xi { transform: rotate(90deg); }
.tf-src-list { display: grid; gap: 2px; margin: 0 0 6px; }
.tf-src-list > .tf-rest { margin: 2px 0 4px 22px; }
/* 열 너비가 em이라 줄 글자 크기(14px)는 경로 줄과 같게 두고, 칸 안 글자만 작게(열이 어긋나지 않게) */
.tf-src { min-height: 32px; color: var(--tf-ink-2); }
.tf-src-name { padding-left: 12px; border-left: 2px solid var(--tf-line); font-size: 13px; font-weight: 500; }
.tf-src .tf-rank-num { font-size: 13px; }
.tf-src-name > span { min-width: 0; overflow-wrap: anywhere; }

/* D. 요일별 — 기둥 7개(24px 이하, 위만 둥글게). 가장 많은 요일만 값. 강조 중: 전체 기둥(회색) 안에 고른 것(파랑).
   옆 전환 흐름 카드와 높이가 같아지면(나란히 놓일 때) 그래프가 남는 높이를 채운다. */
.tf-weekday { display: flex; flex-direction: column; }
.tf-cols { flex: 1 1 auto; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 196px; padding-top: 22px; }
.tf-col { display: flex; flex-direction: column; min-width: 0; height: 100%; border-radius: 8px 8px 0 0; transition: background-color .14s; }
.tf-col-plot { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 0; border-bottom: 1px solid var(--tf-base); }
.tf-col-bars { position: relative; flex: none; width: min(24px, 56%); border-radius: 4px 4px 0 0; background: var(--tf-blue); transition: background-color .14s; }
.tf-col-bars[data-nz] { min-height: 2px; }
.tf-col-part { position: absolute; left: 0; right: 0; bottom: 0; height: 0; border-radius: 4px 4px 0 0; background: var(--tf-blue); }
.tf-card[data-mode=over] .tf-col-bars { background: var(--tf-whole); }
.tf-col-val { flex: none; margin-bottom: 4px; color: var(--tf-ink); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-col-tick { padding-top: 7px; color: var(--tf-ink-2); font-size: 12px; text-align: center; }
.tf-col:hover, .tf-col[data-tip-on] { background: linear-gradient(180deg, transparent, var(--tf-soft)); }
.tf-col:hover .tf-col-bars, .tf-col[data-tip-on] .tf-col-bars { background: var(--tf-blue-deep); }
.tf-card[data-mode=over] .tf-col:hover .tf-col-bars, .tf-card[data-mode=over] .tf-col[data-tip-on] .tf-col-bars { background: var(--tf-whole-deep); }
.tf-col:hover .tf-col-part, .tf-col[data-tip-on] .tf-col-part { background: var(--tf-blue-deep); }
.tf-col:focus-visible { outline: 2px solid var(--tf-blue); outline-offset: -2px; }
/* 요일 표(늘 펼쳐 둔다): 네 숫자의 하루 평균. 기준 숫자 열은 진하게, 고른 것 열은 자리를 늘 잡아 둔다. */
.tf-wd-wrap { margin-top: 14px; border: 1px solid var(--tf-line); border-radius: 10px; }
.tf-wd-table th, .tf-wd-table td { padding: 6px 9px; }
.tf-wd-table thead th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.tf-wd-table tbody th { white-space: nowrap; }
.tf-wd-table tbody th small { margin-left: 5px; color: var(--tf-muted); font-size: 11.5px; font-weight: 500; }
.tf-wd-table td { color: var(--tf-ink-2); }
.tf-wd-table .is-key { color: var(--tf-ink); font-weight: 750; }
.tf-wd-part { width: 5.4em; }
.tf-wd-table .tf-th-part { display: inline-flex; align-items: center; gap: 5px; max-width: 6em; }
.tf-wd-table .tf-th-part > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 아직 세지 않는 칸: 무엇이 언제부터 보이는지 */
.tf-guide { display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: 12px; background: linear-gradient(180deg, #f7f9fc, #f2f4f8); }
.tf-guide-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--tf-blue); box-shadow: 0 0 0 1px var(--tf-line); }
.tf-guide-ic .xi { width: 20px; height: 20px; }
.tf-guide b { display: block; color: var(--tf-ink); font-size: 14px; line-height: 1.45; }
.tf-guide p { margin: 4px 0 0; color: var(--tf-ink-2); font-size: 13px; line-height: 1.6; }
.tf-guide-keys { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; padding: 0; list-style: none; color: var(--tf-ink-2); font-size: 12.5px; }
.tf-guide-keys li { display: inline-flex; align-items: center; gap: 6px; }
.tf-guide-keys i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.tf-guide-actions { margin-top: 12px; }

/* G. 캠페인 성과 */
.tf-campaigns { margin: 0 0 16px; }

/* 기간 안에 횟수가 0 · 맨 처음 불러오는 중 */
.tf-zero { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0 0 16px; padding: 44px 16px; border: 1px solid var(--tf-line); border-radius: 14px; background: #fff; text-align: center; }
.tf-zero-ic { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 14px; background: var(--tf-blue-wash); color: var(--tf-blue); }
.tf-zero-ic .xi { width: 24px; height: 24px; }
.tf-zero small { max-width: 520px; color: var(--tf-ink-2); }
.tf-zero .secondary { margin-top: 10px; }
.tf-skel-kpis i, .tf-skel-chart { display: block; border-radius: 14px; background: linear-gradient(100deg, #eef1f5 30%, #f7f8fa 50%, #eef1f5 70%) 0 0 / 300% 100%; animation: fx-shimmer 1.3s linear infinite; }
.tf-skel-kpis i { height: 132px; }
.tf-skel-chart { height: 330px; }

/* 말풍선 하나(돌려 쓴다): 값이 굵게 앞, 이름은 보조. 계열은 짧은 선으로 */
.tf-tip { position: absolute; top: 0; left: 0; z-index: 30; min-width: 180px; max-width: 300px; padding: 10px 12px 9px; border-radius: 10px; background: rgba(255, 255, 255, .98); box-shadow: 0 12px 32px -12px rgba(20, 23, 26, .4), 0 0 0 1px rgba(20, 23, 26, .08); color: var(--tf-ink); font-size: 13px; line-height: 1.45; pointer-events: none; }
.tf-tip-title { margin: 0 0 6px; color: var(--tf-ink-2); font-size: 12.5px; font-weight: 650; overflow-wrap: anywhere; }
.tf-tip-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; margin: 0; padding: 1px 0; }
.tf-tip-key { width: 12px; height: 3px; border-radius: 2px; background: var(--c, var(--tf-blue)); }
.tf-tip-key[data-none] { background: transparent; }
.tf-tip-label { min-width: 0; color: var(--tf-ink-2); overflow-wrap: anywhere; }
.tf-tip-val { color: var(--tf-ink); font-size: 14px; font-weight: 760; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-tip-row[data-minor] .tf-tip-val { color: var(--tf-ink-2); font-size: 12.5px; font-weight: 650; }
.tf-tip-row:not([data-minor]) + .tf-tip-row[data-minor] { margin-top: 5px; padding-top: 6px; border-top: 1px solid var(--tf-line); }
.tf-tip-foot { margin: 7px 0 0; color: var(--tf-muted); font-size: 12px; }
.tf-tip[data-layout=vf] { max-width: 320px; }
.tf-tip[data-layout=vf] .tf-tip-row { grid-template-columns: 14px 4.6em minmax(0, 1fr); gap: 2px 10px; }
.tf-tip[data-layout=vf] .tf-tip-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-tip-row[data-sum] { margin-top: 5px; padding-top: 6px; border-top: 1px solid var(--tf-line); }
.tf-tip-row[data-sum] .tf-tip-label { color: var(--tf-ink); font-weight: 650; }

/* H. 캠페인 링크 만들기 (1판 동작 그대로) */
.tf-builder { margin: 0; }
.tf-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.tf-form-grid .field { margin: 0; }
.tf-hint { margin: 0; color: var(--tf-muted); font-size: 12px; line-height: 1.5; }
.tf-hint[data-tone=error] { color: var(--tf-down); font-weight: 650; }
.tf-link-form input[aria-invalid=true] { border-color: var(--tf-down); }
.tf-link-out { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; color: var(--tf-ink-2); font-size: 12px; }
.tf-link-out textarea { width: 100%; min-height: 58px; padding: 10px 12px; border: 1px solid var(--tf-line); border-radius: 10px; background: var(--tf-soft); color: var(--tf-ink); font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: none; overflow-wrap: anywhere; word-break: break-all; }
.tf-link-out .form-actions { align-items: center; margin-top: 0; }
.tf-copied { color: var(--tf-up); font-size: 12.5px; font-weight: 650; }

/* 눌린 모양 */
.tf-periods button:active, .tf-expand:active, .tf-side:active, .tf-link-btn:active, .tf-fn-row:active, .tf-views button:active, .tf-sh button:active, .tf-sortbar button:active, .tf-toggle button:active { transform: translateY(1px); }

/* 초점 테두리 */
.tf-periods button:focus-visible, .tf-kpi:focus-visible, .tf-fn-row:focus-visible, .tf-views button:focus-visible, .tf-sh button:focus-visible, .tf-sortbar button:focus-visible, .tf-toggle button:focus-visible, .tf-side:focus-visible, .tf-expand:focus-visible, .tf-link-btn:focus-visible, .tf-src:focus-visible, .tf-more > summary:focus-visible { outline: 2px solid var(--tf-blue); outline-offset: 2px; }

@media (max-width: 1280px) {
  .tf-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .tf-kpis, .tf-skel-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .tf-progress { top: 0; }
  .tf .tf-title h1 { font-size: 24px; }
  .tf-tools { width: 100%; }
  .tf-head { align-items: flex-start; }
  /* 강조 줄은 두 줄(이름 / 비중 · 풀기)까지 자리를 잡아 둔다 — 긴 이름을 골라도 아래 화면이 밀리지 않게 */
  .tf-focus { flex-basis: 100%; min-height: 60px; }
  /* 전환 흐름: 좁으면 막대를 한 줄 전체로(막대가 짧아지지 않게), 고른 것 값은 그 아래 */
  .tf-fn-head { grid-template-columns: minmax(0, 1fr) 4.4em 5.4em 5.4em; gap: 0 8px; }
  .tf-fn-row { grid-template-columns: minmax(0, 1fr) 4.4em 5.4em 5.4em; grid-template-areas: "name val rate first" "bar bar bar bar" ". pval prate pfirst"; gap: 4px 8px; }
  .tf-kpis, .tf-skel-kpis { gap: 10px; }
  .tf-kpi { padding: 12px 12px 8px; }
  .tf-num { font-size: 32px; }
  .tf-kpi-on { display: none; }
  /* 좁으면 고른 것 값은 이름 아랫줄로(강조가 없어도 같은 두 줄 자리를 잡아 둔다) */
  .tf-kpi-part-text { flex-direction: column; align-items: flex-start; gap: 1px; }
  .tf-kpi-part-name { max-width: 100%; }
  .tf-card { padding: 16px 14px 14px; }
  .tf-chart-plot { height: 210px; }
  .tf-four { height: 440px; }
  .tf-views button { padding: 0 10px; }
  /* 순위 카드의 좁은 모양(막대가 이름 아래)은 카드 폭으로 정한다 — 위 @container (max-width: 600px) */
  .tf-segs { grid-template-columns: 6.5em minmax(0, 1fr); }
  .tf-cols { min-height: 170px; }
  .tf-wd-table th, .tf-wd-table td { padding: 6px 6px; font-size: 12.5px; }
  .tf-guide { flex-direction: column; gap: 10px; padding: 14px; }
  .tf-form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .tf *, .tf *::before, .tf *::after { transition: none !important; animation: none !important; }
  .tf[data-busy] .tf-progress::before { background-position: 50% 0; }
}
@media (forced-colors: active) {
  .tf-rank-track i, .tf-col-bars, .tf-col-part, .tf-seg-part, .tf-dot, .tf-key, .tf-pick, .tf-meter, .tf-meter i, .tf-tip-key, .tf-guide-keys i, .tf-legend i { forced-color-adjust: none; }
  .tf-rank-track i, .tf-skey, .tf-g-sline, .tf-g-sdot, .tf-g-send { forced-color-adjust: none; }
  .tf-rank:has(.tf-rank-btn[aria-pressed=true]), .tf-fn-row[aria-pressed=true], .tf-kpi[aria-pressed=true], .tf-periods button[aria-pressed=true], .tf-views button[aria-pressed=true], .tf-sitem[aria-pressed=true], .tf-sortbar button[aria-pressed=true], .tf-toggle button[aria-pressed=true] { outline: 2px solid Highlight; }
}
