/* 운영자가 빠르게 상태를 판단하는 작업 화면. 기본은 밝고 대비가 높은 표면으로 고정한다. */

:root {
  --bg: #f4f7f8;
  --card-bg: #ffffff;
  --card-bg-muted: #f5f8f9;
  --ink: #172b36;
  --ink-muted: #506271;
  --ink-faint: #738491;
  --line: #dce4e8;
  --line-strong: #bfccd3;
  --brand: #147868;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(30, 55, 65, .045);

  --danger: #bd3941;
  --danger-bg: #fff0ef;
  --danger-zone: #f8c9ca;
  --normal: #97600d;
  --normal-bg: #fef3e0;
  --normal-zone: #f7dfa8;
  --safe: #147a50;
  --safe-bg: #e6f7ee;
  --safe-zone: #a9e2c4;

  --p-ios: #0072B2;
  --p-android: #009E73;
  --p-toss: #D55E00;
  --p-web: #8A94A6;
  --p-unknown: #B8A26A;

  --earn: #1c8354;
  --spend: #b3690a;

  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #14161b;
  --card-bg: #1d2027;
  --card-bg-muted: #191b21;
  --ink: #edf0f4;
  --ink-muted: #9aa3af;
  --ink-faint: #6d7480;
  --line: #2b2f38;
  --line-strong: #383d48;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .35);
  --danger: #ff6369; --danger-bg: rgba(229, 72, 77, .16); --danger-zone: rgba(229, 72, 77, .35);
  --normal: #f0a63f; --normal-bg: rgba(245, 165, 36, .14); --normal-zone: rgba(245, 165, 36, .35);
  --safe: #4cc38a; --safe-bg: rgba(48, 166, 108, .16); --safe-zone: rgba(48, 166, 108, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.5;
}
#app { max-width: 1260px; margin: 0 auto; padding: 0 28px 72px; }
main { display: block; }

h1, h2, h3 { margin: 0; font-weight: 800; }
p { margin: 0; }
button { font-family: inherit; }

.segmented {
  display: inline-flex; background: var(--card-bg-muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap;
}
.segBtn {
  border: none; background: transparent; color: var(--ink-muted);
  font-size: 13px; font-weight: 700; padding: 8px 13px; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
}
.segBtn[aria-pressed="true"] {
  background: var(--card-bg); color: var(--ink);
  box-shadow: var(--shadow);
}
.segBtn:active { transform: scale(.97); }

select {
  font-family: inherit; font-size: 13px; font-weight: 650; color: var(--ink);
  background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 11px; min-width: 96px;
}

.checkboxLabel {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  color: var(--ink-muted); white-space: nowrap; cursor: pointer; padding: 7px 2px;
}
.checkboxLabel input { width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; }

/* ── 오류 배너 ─────────────────────────────────────────────────────────── */
/* ⚠️ `:not([hidden])`에만 display를 준다 — 위 열쇠 패널과 같은 이유(무조건 주면 `hidden`이 무력해진다). */
.fetchErrorBanner:not([hidden]) {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--danger-bg); border: 1px solid var(--danger-zone); color: var(--danger);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; font-size: 12.5px; font-weight: 600;
}
.fetchErrorBanner button {
  border: 1px solid var(--danger); background: transparent; color: var(--danger); font-weight: 800;
  border-radius: 999px; padding: 6px 14px; cursor: pointer; flex: none;
}

/* ── 빈 상태 안내 ─────────────────────────────────────────────────────── */
.emptyState { font-size: 12.5px; color: var(--ink-faint); padding: 18px 4px; text-align: center; }

/* ── 열쇠 입력 패널 ───────────────────────────────────────────────────── */
/* ⚠️ `display`는 `:not([hidden])`에만 준다 — 여기 무조건 주면 브라우저 기본 `[hidden]{display:none}`을
   이겨서(둘 다 클래스급 특이도라 나중 규칙이 이긴다) `hidden` 속성이 있어도 계속 떠 버린다
   (CLAUDE.md의 인라인 style 함정과 같은 종류 — 이번엔 스타일시트 쪽에서 났다). */
.keyPanelOverlay:not([hidden]) {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.keyPanelCard {
  background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px 22px; width: 100%; max-width: 340px;
  display: flex; flex-direction: column; gap: 12px;
}
.keyPanelCard h2 { font-size: 15.5px; font-weight: 800; line-height: 1.4; }
.keyPanelCard input {
  font-family: inherit; font-size: 15px; padding: 11px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--card-bg-muted); color: var(--ink);
}
.keyPanelCard button {
  font-family: inherit; font-size: 14px; font-weight: 800; padding: 11px 12px; border-radius: var(--radius-sm);
  border: none; background: var(--ink); color: var(--card-bg); cursor: pointer;
}
.keyPanelCard button:disabled { opacity: .6; cursor: default; }
.keyMsg { font-size: 12.5px; color: var(--danger); font-weight: 700; }
.keyMsg.info { color: var(--ink-muted); }
.keyMsg[hidden] { display: none; }

#pageFooter a { color: var(--ink-muted); }

/* ── 공통 카드 ────────────────────────────────────────────────────────── */
.sectionTitle { font-size: 17px; color: var(--ink); margin: 20px 0 10px; }
.sectionHead { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 12px; }
.sectionHead h2 { font-size: 20px; letter-spacing: -.025em; line-height: 1.25; }
.sectionHead p { color: var(--ink-muted); font-size: 12.5px; }
.card {
  background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px;
}

/* ── 플랫폼 비교 ─────────────────────────────────────────────────────── */
.platformTableWrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card-bg); box-shadow: var(--shadow); }
.platformTable { min-width: 780px; font-size: 13px; }
.platformTable th, .platformTable td { padding: 13px 14px; }
.platformTable thead th { font-size: 11.5px; position: static; cursor: default; }
.platformTable tbody th { text-align: left; border-left: 4px solid var(--accent); white-space: nowrap; }
.platformTable tbody tr.selectedPlatform { background: #eaf6f3; }
.platformName { display: block; font-size: 15px; font-weight: 800; color: var(--ink); }
.platformStore, .platformSub { display: block; font-size: 11px; font-weight: 500; color: var(--ink-muted); }
.platformDau { font-size: 22px; font-weight: 850; color: var(--ink); }
.platformNote { margin: 8px 2px 0; font-size: 12px; color: var(--ink-muted); }
.platHead { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.platName { font-size: 13.5px; font-weight: 800; }
.platStore { font-size: 10.5px; color: var(--ink-faint); }

.sampleTag {
  font-size: 10px; font-weight: 750; color: var(--ink-muted);
  background: var(--card-bg-muted); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 5px; margin-left: 5px; vertical-align: middle;
}
.faded { opacity: 1; }

/* ── §3.2 건강 게이지 ─────────────────────────────────────────────────── */
.meaning { font-size: 12.5px; color: var(--ink-muted); margin-top: 3px; line-height: 1.5; }

/* ── 탭 ──────────────────────────────────────────────────────────────── */
.tabsWrap { position: relative; margin: 0 0 20px; padding-top: 4px; background: var(--bg); border-bottom: 1px solid var(--line); }
.tabsWrap::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 2px; width: 30px;
  background: linear-gradient(to right, transparent, var(--bg) 75%);
  pointer-events: none; opacity: 0; transition: opacity .15s ease;
}
.tabsWrap.hasOverflow::after { opacity: 1; }
.tabs {
  display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabBtn {
  border: none; background: transparent; color: var(--ink-muted); font-weight: 700; font-size: 13.5px;
  padding: 11px 15px; white-space: nowrap; cursor: pointer; border-bottom: 3px solid transparent;
  flex: none;
}
.tabBtn[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }

.tabPanel { padding-top: 2px; }
.panelGrid { display: flex; flex-direction: column; gap: 14px; }
.panelHead { display: flex; flex-direction: column; gap: 2px; margin-bottom: 2px; }
.panelHead h3 { font-size: 15px; }
.panelHead .meaning { font-size: 12px; }

/* ── 테이블(가로 스크롤은 자기 안에서) ───────────────────────────────── */
.tableScroll { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th, td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child {
  text-align: left; white-space: normal; word-break: keep-all; max-width: 150px;
}
thead th {
  background: var(--card-bg-muted); color: var(--ink-muted); font-weight: 700; font-size: 11.5px;
  position: sticky; top: 0; cursor: pointer; user-select: none;
}
thead th.sortable::after { content: " ↕"; color: var(--ink-faint); font-size: 10px; }
thead th.sorted-asc::after { content: " ▲"; color: var(--ink); font-size: 9px; }
thead th.sorted-desc::after { content: " ▼"; color: var(--ink); font-size: 9px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--card-bg-muted); }

/* ── KPI 타일 ───────────────────────────────────────────────────────── */
.kpiGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.kpiTile { padding: 12px 14px; }
.kpiLabel { font-size: 11.5px; color: var(--ink-muted); font-weight: 700; }
.kpiValue { font-size: 20px; font-weight: 800; margin-top: 4px; letter-spacing: -.01em; }

/* ── 막대/차트 공용 ─────────────────────────────────────────────────── */
.chartCard { padding: 14px; }
.barRow { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.barRowLabel { width: 84px; flex: none; font-size: 11.5px; color: var(--ink-muted); text-align: right; }
.barTrack { flex: 1; background: var(--card-bg-muted); border-radius: 6px; height: 16px; position: relative; overflow: hidden; }
.barFill { height: 100%; border-radius: 6px; }
.barValue { width: 54px; flex: none; font-size: 11.5px; font-weight: 700; }
.dropTag { font-size: 10.5px; color: var(--danger); font-weight: 700; width: 60px; flex: none; }

.legendRow { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--ink-muted); margin-top: 6px; }
.legendDot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }

svg.chartSvg { width: 100%; height: auto; display: block; }
.axisText { font-size: 8px; fill: var(--ink-faint); }

/* ── 첫 경험 깔때기 ─────────────────────────────────────────────────── */
.funnelStep { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.funnelStep:last-child { border-bottom: none; }
.funnelStepHead { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.funnelStepHead .stepName { font-weight: 700; }
.funnelStepHead .stepDrop { color: var(--danger); font-weight: 700; }
.funnelMulti { display: flex; flex-direction: column; gap: 3px; }
.funnelMultiRow { display: flex; align-items: center; gap: 6px; }
.funnelPlatTag { width: 46px; flex: none; font-size: 10px; color: var(--ink-muted); text-align: right; }
.funnelBarTrack { flex: 1; background: var(--card-bg-muted); border-radius: 4px; height: 11px; overflow: hidden; }
.funnelBarFill { height: 100%; border-radius: 4px; }
.funnelPct { width: 40px; flex: none; font-size: 10.5px; text-align: right; color: var(--ink-muted); }

/* ── 코호트 테이블 ─────────────────────────────────────────────────── */
.cohortCell { text-align: center; border-radius: 4px; font-size: 11px; padding: 6px 4px; min-width: 44px; color: var(--ink); }
.cohortCell.empty { color: var(--ink-faint); }
.cohortCell.onDark { color: #fff; font-weight: 700; }

/* ── 기능 참여 리스트 ───────────────────────────────────────────────── */
.featureList { display: flex; flex-direction: column; gap: 10px; }
/* 광고 실패 원인 — 사유 이름이 길어(「광고를 못 불러옴(재고 없음)」) 막대 이름 칸만 넓힌다 */
.adFailBars .barRowLabel { width: 150px; }
/* 광고 본 사람 — 번들별: 사람 30명 미만 번들은 흐리게(.faded는 일부러 1이라 따로 둔다) · 막힌 이유 칸은 왼쪽 맞춤 */
.adReachTable tr.adReachThin td { opacity: .45; }
.adReachTable td:last-child, .adReachTable th:last-child { text-align: left; }

/* ── 반응형: 390px 기준 최소 여백 보정 ─────────────────────────────── */
@media (max-width: 760px) {
  #app { padding: 0 16px 48px; }
  .sectionHead { align-items: start; flex-direction: column; gap: 4px; }
  .sectionHead p { max-width: 44ch; }
}
@media (max-width: 480px) {
  #pageTitle { font-size: 24px; }
  .kpiGrid { grid-template-columns: repeat(2, 1fr); }
  .barRowLabel { width: 80px; font-size: 10.5px; }
  .adFailBars .barRowLabel { width: 118px; }
  .funnelPlatTag { width: 38px; }
}

/* ── 하단 안내 ─────────────────────────────────────────────────────── */
#pageFooter {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
}
#pageFooter p {
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.5;
}

/* ── 여러 게임용으로 더한 것 ─────────────────────────────────────────── */
/* 게임 고르기 — 제목 옆. ⚠️ display는 `:not([hidden])`에만(열쇠 패널과 같은 이유 — 무조건 주면 hidden이 무력해진다). */
.tabsWrap[hidden], #tabPanel[hidden] { display: none; }
.sqlHint {
  margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; overflow-x: auto;
  background: var(--card-bg-muted); border: 1px solid var(--line);
  font-size: 11px; line-height: 1.5; color: var(--ink-muted); white-space: pre;
}
.manualRevenueHelp { margin-top: 12px; }
.manualRevenueHelp summary { cursor: pointer; color: var(--brand); font-size: 13px; font-weight: 750; }
.manualRevenueHelp .meaning { margin-top: 8px; }
code { font-size: 11.5px; }
.splitTables { display: flex; gap: 10px; flex-wrap: wrap; }
.splitTables > .tableScroll { flex: 1; min-width: 220px; }
body.loading main { opacity: .55; transition: opacity .15s ease; }

/* 그래프 숫자 풍선(app.js chartTip) — 막대에 마우스를 올리거나 누르면 바로 뜬다. */
.chartTip {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none;
  max-width: 260px; padding: 6px 10px; border-radius: 8px;
  background: var(--ink); color: var(--card-bg); font-size: 12.5px; line-height: 1.4;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.chartTip[hidden] { display: none; }

/* ══ 2026-10-12 재설계 — 전체 게임 → 평소와 달라진 것 → 핵심 숫자 → 추이 → 플랫폼 → 진단 → 원인 찾기 ══ */
.eyebrow { display: block; color: var(--brand); font-size: 11px; font-weight: 850; letter-spacing: .08em; }
.asOf { font-size: 12.5px; color: var(--ink-muted); }
.filterLabel { font-size: 12px; color: var(--ink-muted); font-weight: 700; }
.block { margin-bottom: 30px; }
.block[hidden], #detailSection[hidden], #trendSection[hidden], #healthSection[hidden] { display: none; }
.dim { color: var(--ink-faint); }

/* 머리 */
.pageHead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 24px 0 16px; }
.pageHead h1 { font-size: 28px; letter-spacing: -.035em; line-height: 1.2; }
.titleBlock { display: grid; gap: 4px; min-width: 0; }
.titleRow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.headMeta { display: flex; align-items: center; gap: 10px; }
.backLink { font-size: 13px; font-weight: 750; color: var(--brand); text-decoration: none; }
.backLink:hover { text-decoration: underline; }
.backLink[hidden] { display: none; }
.ghostBtn { border: 1px solid var(--line-strong); background: var(--card-bg); color: var(--ink); font-size: 12.5px; font-weight: 750; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.ghostBtn:hover { border-color: var(--brand); }
.gameSelect {
  font-size: 13px; font-weight: 750; padding: 6px 28px 6px 11px; border: 1px solid var(--line-strong); border-radius: 999px;
  appearance: none; -webkit-appearance: none; color: var(--ink-muted);
  background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239aa1ac' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 11px center;
}
.gameSelect[hidden] { display: none; }

/* 필터 줄 — 화면 위에 붙어 다닌다(긴 게임 화면에서 지금 무엇을 보고 있는지 잃지 않게) */
.filterBar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap;
  margin: 0 -28px 24px; padding: 10px 28px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
}
.segmented.small .segBtn { font-size: 12px; padding: 5px 10px; }
.moreFilters { position: relative; margin-left: auto; }
.moreFilters summary { list-style: none; cursor: pointer; font-size: 12.5px; font-weight: 750; color: var(--ink-muted); padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card-bg); display: inline-flex; gap: 6px; align-items: center; }
.moreFilters summary::-webkit-details-marker { display: none; }
.moreFilters[open] summary { border-color: var(--brand); color: var(--ink); }
.moreFiltersBody { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; gap: 8px; min-width: 240px; padding: 14px; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(30,55,65,.12); }
.filterBadge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; }
.filterBadge[hidden] { display: none; }
body.loading #gameView main, body.loading #homeView { opacity: .55; transition: opacity .15s ease; }

/* 신호(평소와 달라진 것) — 색만으로 말하지 않는다: 아이콘 + 등급 글자 + 왼쪽 띠 */
.alertList { display: grid; gap: 8px; }
.sig {
  display: grid; grid-template-columns: 28px 1fr auto auto; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; text-align: left; font: inherit; color: var(--ink); text-decoration: none;
  background: var(--card-bg); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius-sm);
}
button.sig, a.sig { cursor: pointer; }
button.sig:hover, a.sig:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.sig.critical { border-left-color: var(--danger); }
.sig.warning { border-left-color: var(--normal); }
.sig.good { border-left-color: var(--safe); }
.sigIcon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 12px; font-weight: 900; background: var(--card-bg-muted); color: var(--ink-muted); }
.sig.critical .sigIcon { background: var(--danger-bg); color: var(--danger); }
.sig.warning .sigIcon { background: var(--normal-bg); color: var(--normal); }
.sig.good .sigIcon { background: var(--safe-bg); color: var(--safe); }
.sigText { display: grid; gap: 2px; min-width: 0; }
.sigTitle { font-size: 14.5px; font-weight: 800; line-height: 1.35; }
.sigGame { font-weight: 850; color: var(--ink); margin-right: 2px; padding: 1px 7px; border-radius: 6px; background: var(--card-bg-muted); border: 1px solid var(--line); font-size: 12.5px; }
.sigDetail { font-size: 12.5px; color: var(--ink-muted); line-height: 1.4; }
.sigLevel { font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; color: var(--ink-muted); background: var(--card-bg-muted); }
.sig.critical .sigLevel { color: var(--danger); background: var(--danger-bg); }
.sig.warning .sigLevel { color: var(--normal); background: var(--normal-bg); }
.sig.good .sigLevel { color: var(--safe); background: var(--safe-bg); }
.sigGo { font-size: 20px; color: var(--ink-faint); line-height: 1; }
.sigCalm { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--safe-bg); color: var(--safe); font-size: 14px; font-weight: 750; }
.sigCalm .sigIcon { background: var(--card-bg); color: var(--safe); }
.alertList .sig.extra { display: none; }
.alertList.showAll .sig.extra { display: grid; }
.moreBtn { justify-self: start; border: none; background: none; color: var(--brand); font-size: 13px; font-weight: 800; cursor: pointer; padding: 4px 2px; }

/* 증감 칩 — 글자는 잉크 색 계열, 방향은 화살표가 말한다 */
.chg { font-weight: 800; white-space: nowrap; }
.chg.good { color: var(--safe); }
.chg.bad { color: var(--danger); }
.chg.flat { color: var(--ink-faint); font-weight: 700; }
.vs { color: var(--ink-faint); font-weight: 600; }

/* 핵심 숫자 */
.kGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.kTile { position: relative; display: grid; gap: 3px; align-content: start; padding: 14px 16px 12px; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.kLabel { font-size: 12.5px; font-weight: 750; color: var(--ink-muted); }
.kValue { font-size: 30px; font-weight: 850; letter-spacing: -.035em; line-height: 1.15; font-variant-numeric: proportional-nums; }
.kValue small { font-size: 15px; font-weight: 750; margin-left: 2px; color: var(--ink-muted); }
.kChange { font-size: 12.5px; min-height: 18px; }
.kSub { font-size: 11.5px; color: var(--ink-faint); }
.kTile .spark { width: 100%; height: 30px; margin-top: 4px; }
.kTile.quiet .kValue { color: var(--ink-muted); }

/* 날짜별 추이 */
.sectionHead .segmented { flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-muted); margin: 0 0 8px; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg i.lgLine { width: 16px; height: 2px; border-radius: 2px; background: var(--ink); opacity: .75; }
.lg i.lgPartial { background: var(--ink-faint); opacity: .42; }
.trendSvg .axisText { font-size: 11px; }
.trendSvg rect.hit:hover { fill: var(--ink); fill-opacity: .04; }
.tableView { margin-top: 10px; }
.tableView summary { cursor: pointer; font-size: 12.5px; font-weight: 750; color: var(--brand); }
.tableView .tableScroll { margin-top: 8px; max-height: 320px; overflow: auto; }
.chartTip { white-space: pre-line; }

/* 지표 진단 표 */
.healthCard { padding: 4px 4px; }
.healthTable { font-size: 13px; }
.healthTable th, .healthTable td { padding: 11px 12px; }
.healthTable tbody th { text-align: left; }
.hName { font-weight: 800; cursor: help; border-bottom: 1px dotted var(--line-strong); }
.hValue { font-size: 16px; font-weight: 850; }
.hValue.faded { color: var(--ink-muted); }
.hBar { width: 32%; text-align: left; }
.miniZones { position: relative; display: flex; height: 8px; border-radius: 999px; overflow: visible; background: var(--card-bg-muted); }
.miniZones i:first-child { border-radius: 999px 0 0 999px; }
.miniZones i:last-of-type { border-radius: 0 999px 999px 0; }
.miniZones i { display: block; height: 100%; }
.miniZones i.danger { background: var(--danger-zone); }
.miniZones i.normal { background: var(--normal-zone); }
.miniZones i.safe { background: var(--safe-zone); }
.miniZones b { position: absolute; top: -4px; width: 3px; height: 16px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--card-bg); }
.miniZoneLabel { display: block; margin-top: 5px; font-size: 11px; color: var(--ink-faint); white-space: normal; }

/* 전체 게임 표 */
.tableCard { padding: 0; overflow: hidden; }
.homeTable { font-size: 13px; }
.homeTable th, .homeTable td { padding: 13px 14px; vertical-align: middle; }
.homeTable tbody tr { cursor: pointer; }
.homeTable tbody tr:hover td, .homeTable tbody tr:hover th { background: var(--card-bg-muted); }
.homeTable tbody tr:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.homeTable tbody th { text-align: left; }
.gName { display: block; font-size: 15px; font-weight: 850; color: var(--ink); text-decoration: none; margin-bottom: 4px; }
.cMain { display: block; font-size: 17px; font-weight: 850; color: var(--ink); }
.cSub { display: block; font-size: 11.5px; color: var(--ink-faint); font-weight: 600; }
.sparkCell { width: 140px; }
.sparkCell .spark { width: 120px; height: 30px; }
.stat { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; padding: 2px 8px 2px 4px; border-radius: 999px; background: var(--card-bg-muted); color: var(--ink-muted); }
.stat i { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-style: normal; font-size: 9.5px; background: var(--card-bg); }
.stat.critical { color: var(--danger); background: var(--danger-bg); }
.stat.warning { color: var(--normal); background: var(--normal-bg); }
.stat.good { color: var(--safe); background: var(--safe-bg); }
.stat.ok { color: var(--safe); background: var(--safe-bg); }
.idleLine { margin-top: 10px; font-size: 12.5px; color: var(--ink-faint); }
.idleLine a { color: var(--ink-muted); }

/* ── 폰: 요약 먼저 · 표는 카드로 ─────────────────────────────────────── */
@media (max-width: 760px) {
  .pageHead { padding: 18px 0 12px; }
  .pageHead h1 { font-size: 24px; }
  .filterBar { margin: 0 -16px 18px; padding: 8px 16px; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filterBar::-webkit-scrollbar { display: none; }
  .filterBar .segmented { flex-wrap: nowrap; flex: none; }
  .filterBar .segBtn { padding: 6px 10px; font-size: 12.5px; }
  .moreFilters { margin-left: 0; flex: none; }
  .moreFilters summary { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
  .moreFiltersBody { position: fixed; left: 16px; right: 16px; top: auto; min-width: 0; }
  .sig { grid-template-columns: 26px 1fr auto; gap: 10px; padding: 11px 12px; }
  .sig .sigGo { display: none; }
  .sigLevel { grid-column: 2; grid-row: 2; justify-self: start; display: none; }
  .sigTitle { font-size: 13.5px; }
  .kGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kTile { padding: 12px 12px 10px; }
  .kValue { font-size: 24px; }
  .kChange { font-size: 11.5px; }
  .kChange .vs { display: block; }
  .sectionHead .segmented { align-self: flex-start; }

  /* 표 → 칸 나눈 카드: 머리줄을 숨기고 칸마다 이름(data-label)을 위에 붙인다. 열 수는 표마다 --cols */
  table.gridOnPhone { min-width: 0; }
  table.gridOnPhone thead { display: none; }
  table.gridOnPhone, table.gridOnPhone tbody { display: block; width: 100%; }
  table.gridOnPhone tr { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 10px 12px; padding: 14px; border-bottom: 1px solid var(--line); }
  table.gridOnPhone tbody tr:last-child { border-bottom: none; }
  table.gridOnPhone th, table.gridOnPhone td { display: block; padding: 0; border: none; text-align: left; white-space: normal; position: static; background: none; min-width: 0; }
  table.gridOnPhone tbody th { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  table.gridOnPhone td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 11.5px; color: var(--ink-muted); font-weight: 700; }
  table.gridOnPhone tbody tr:hover td, table.gridOnPhone tbody tr:hover th { background: none; }
  .platformTableWrap { overflow: visible; }
  .platformTable tbody th { border-left: none; }
  .platformTable tbody tr { border-left: 4px solid var(--accent); }
  .platformName { display: inline; }
  .platformStore { display: inline; margin-left: 6px; }
  .platformDau { font-size: 18px; }
  .gName { margin: 0; font-size: 16px; }
  .homeTable tbody th { justify-content: flex-start; flex-wrap: wrap; }
  .cMain { font-size: 18px; }
  .homeTable td.noRev { display: none; }
  .sparkCell { grid-column: 1 / -1; width: auto; }
  .sparkCell::before { display: none !important; }
  .sparkCell .spark { width: 100%; height: 34px; }
  .healthTable td:nth-of-type(1) { order: 1; }
  .healthTable td:nth-of-type(3) { order: 2; }
  .healthTable td:nth-of-type(4) { order: 3; }
  .healthTable td.hBar { order: 4; grid-column: 1 / -1; width: auto; }
  .healthTable td.hBar::before { display: none; }
  .healthTable td:nth-of-type(5) { display: none; }
  .healthTable .statusPill { margin-left: 0; }

  /* 접어 두는 섹션 — 머리만 보이고 「펼치기」로 연다 */
  .foldOnPhone:not(.open) > :not(.sectionHead) { display: none !important; }
  .foldOnPhone .sectionHead { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .foldOnPhone .sectionHead > div, .foldOnPhone .sectionHead > h2 { flex: 1; }
  .foldOnPhone:not(.open) .sectionHead p { display: none; }
  .foldOnPhone .sectionHead p { order: 3; flex-basis: 100%; }
  .foldBtn { display: inline-flex !important; }
}

/* 접기 단추는 폰에서만 */
.foldBtn { display: none; border: 1px solid var(--line-strong); background: var(--card-bg); color: var(--ink); font-size: 12.5px; font-weight: 750; padding: 6px 12px; border-radius: 999px; cursor: pointer; flex: none; }
