:root {
  color-scheme: light;
  --page: #f3f5fa;
  --surface: #ffffff;
  --nav-surface: #ffffff;
  --text-primary: #10131c;
  --text-secondary: #4b5163;
  --text-muted: #7d8494;
  --gridline: #e3e6ee;
  --baseline: #c4c9d6;
  --border: rgba(16, 19, 34, 0.08);
  --shadow: 0 1px 2px rgba(16, 19, 34, 0.04), 0 4px 16px rgba(16, 19, 34, 0.05);
  --success: #006300;

  --series-1: #2a78d6; /* 위챗 / 문의량 */
  --series-1-rgb: 42, 120, 214;
  --series-2: #eb6834; /* 라인 / 예약완료 */
  --series-2-rgb: 235, 104, 52;
  --series-3: #1baf7a; /* 미니 */
  --series-4: #eda100; /* 시술문의 */
  --series-5: #e87ba4; /* 예약문의 */
  --series-6: #008300; /* 가격문의 */
  --series-7: #4a3aa7; /* 변경/취소 */
  --series-8: #e34948; /* 기타/그외 */
  --series-muted: #9a998f; /* 미상 */
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0a0c12;
    --surface: #14171f;
    --nav-surface: #1c1f29;
    --text-primary: #f4f5f8;
    --text-secondary: #b8bfcc;
    --text-muted: #7d8494;
    --gridline: #262b36;
    --baseline: #3a3f4d;
    --border: rgba(184, 191, 204, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --success: #0ca30c;

    --series-1: #3987e5;
    --series-1-rgb: 57, 135, 229;
    --series-2: #d95926;
    --series-2-rgb: 217, 89, 38;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
    --series-muted: #6f6e66;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0a0c12;
  --surface: #14171f;
  --nav-surface: #1c1f29;
  --text-primary: #f4f5f8;
  --text-secondary: #b8bfcc;
  --text-muted: #7d8494;
  --gridline: #262b36;
  --baseline: #3a3f4d;
  --border: rgba(184, 191, 204, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --success: #0ca30c;

  --series-1: #3987e5;
  --series-1-rgb: 57, 135, 229;
  --series-2: #d95926;
  --series-2-rgb: 217, 89, 38;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
  --series-muted: #6f6e66;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14.5px;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav-surface);
  border-bottom: 1px solid var(--gridline);
  box-shadow: var(--shadow);
}

.site-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.demo-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--series-2);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.demo-banner strong {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--series-2);
}

.demo-banner span {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.demo-banner .demo-banner-en {
  font-size: 11px;
  color: var(--text-muted);
}

header.app-header {
  margin-bottom: 20px;
}

header.app-header h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

header.app-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 18px 0 20px;
  flex-wrap: wrap;
}

.filter-row select {
  font: inherit;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
}

.filter-row label {
  color: var(--text-secondary);
  font-size: 12px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.stat-tile .label {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 6px;
}

.stat-tile .value {
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: proportional-nums;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tab-btn {
  font: inherit;
  background: none;
  border: none;
  padding: 14px 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--series-1);
  font-weight: 600;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, 1fr);
}

.tab-panel .card.full {
  grid-column: 1 / -1;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 2px;
}

.card .subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: none;
}

.legend-swatch.line {
  width: 14px;
  height: 2px;
  border-radius: 1px;
}

.axis-label {
  fill: var(--text-muted);
  font-size: 10px;
}

.gridline {
  stroke: var(--gridline);
  stroke-width: 1;
}

.baseline {
  stroke: var(--baseline);
  stroke-width: 1;
}

.value-label {
  fill: var(--text-secondary);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 50;
  display: none;
  max-width: 220px;
}

.tooltip .row {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.tooltip .key {
  width: 10px;
  height: 2px;
  flex: none;
}

.tooltip .title {
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.tooltip strong {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

table.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

table.matrix th,
table.matrix td {
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid var(--gridline);
}

table.matrix th:first-child,
table.matrix td:first-child {
  text-align: left;
  color: var(--text-secondary);
}

table.matrix thead th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
}

table.matrix td.cell {
  font-variant-numeric: tabular-nums;
  border-radius: 4px;
}

table.matrix td .rate {
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
}

footer.app-footer {
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 11px;
}

@media (max-width: 860px) {
  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .tab-panel.active {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Executive Analytics layout — scoped to #tab-greater-china only
   ============================================================ */
#tab-greater-china {
  --ex-ink: #0d1117;
  --ex-body: #3d4451;
  --ex-mute: #767f8e;
  --ex-rule: #e2e5ea;
  --ex-hair: #eef0f3;
  --ex-accent: #1b4fd8;
  --ex-flat: #c9cfd8;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) #tab-greater-china {
    --ex-ink: #f2f4f8;
    --ex-body: #c2c8d2;
    --ex-mute: #8b93a1;
    --ex-rule: #2b3140;
    --ex-hair: #21262f;
    --ex-accent: #6b95ff;
    --ex-flat: #3a4151;
  }
}

#tab-greater-china.active {
  display: block;
  max-width: 1160px;
  margin: 0 auto;
  color: var(--ex-body);
}

/* ---------- hero ---------- */
.exec-hero {
  padding: 8px 0 40px;
  border-bottom: 1px solid var(--ex-rule);
}

.exec-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.exec-eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ex-mute);
}

.exec-title {
  margin: 0 0 14px;
  font-size: 40px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--ex-ink);
}

.exec-chain {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ex-mute);
}

.exec-chain i {
  font-style: normal;
  margin: 0 5px;
  color: var(--ex-flat);
}

.exec-hero-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  text-align: right;
}

.exec-badge {
  padding: 5px 11px;
  border: 1px solid var(--ex-rule);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ex-mute);
  white-space: nowrap;
}

.exec-meta {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--ex-mute);
}

/* ---------- hero KPI band ---------- */
.exec-headline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.exec-hk {
  padding: 0 34px;
  border-left: 1px solid var(--ex-rule);
}

.exec-hk:first-child {
  padding-left: 0;
  border-left: 0;
}

.exec-hk-value {
  font-size: 48px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.032em;
  color: var(--ex-ink);
  font-variant-numeric: tabular-nums;
}

.exec-hk-lead .exec-hk-value {
  color: var(--ex-accent);
}

.exec-hk-label {
  margin-top: 12px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ex-mute);
}

/* ---------- section scaffolding ---------- */
.exec-block {
  padding: 48px 0;
  border-bottom: 1px solid var(--ex-hair);
}

.exec-block-last {
  border-bottom: 0;
  padding-bottom: 16px;
}

.exec-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
}

.exec-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ex-accent);
  font-variant-numeric: tabular-nums;
}

.exec-head h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.012em;
  color: var(--ex-ink);
}

.exec-sub {
  margin: 0 0 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ex-rule);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ex-mute);
}

/* ---------- 01 funnel ---------- */
.exec-funnel {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
}

.exec-stage {
  padding: 26px 28px;
  border: 1px solid var(--ex-rule);
}

.exec-stage-rev {
  border-color: var(--ex-accent);
}

.exec-stage-k {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ex-mute);
  margin-bottom: 14px;
}

.exec-stage-v {
  font-size: 38px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ex-ink);
  font-variant-numeric: tabular-nums;
}

.exec-stage-rev .exec-stage-v {
  color: var(--ex-accent);
}

.exec-stage-n {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ex-mute);
}

.exec-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 22px;
  min-width: 132px;
}

.exec-link-rate {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ex-ink);
  font-variant-numeric: tabular-nums;
}

.exec-link-k {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ex-mute);
  text-align: center;
}

.exec-arrow {
  width: 100%;
  height: 1px;
  background: var(--ex-rule);
  position: relative;
}

.exec-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  border-left: 6px solid var(--ex-rule);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
}

/* ---------- 02 ranked bars ---------- */
.exec-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}

.exec-rank {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.exec-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.exec-row-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ex-ink);
}

.exec-row-fig {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

.exec-row-val {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ex-ink);
}

.exec-row-share {
  font-size: 11.5px;
  color: var(--ex-mute);
  min-width: 42px;
  text-align: right;
}

.exec-track {
  height: 6px;
  background: var(--ex-hair);
}

.exec-fill {
  height: 100%;
  background: var(--ex-flat);
}

.exec-rank-lead .exec-fill {
  background: var(--ex-accent);
}

.exec-row-meta {
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--ex-mute);
  font-variant-numeric: tabular-nums;
}

/* ---------- 03 attribution quality ---------- */
.exec-quality {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
}

.exec-q-figure {
  padding-right: 32px;
  border-right: 1px solid var(--ex-rule);
}

.exec-q-value {
  font-size: 40px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ex-ink);
  font-variant-numeric: tabular-nums;
}

.exec-q-label {
  margin-top: 12px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ex-mute);
}

.exec-q-note {
  margin-top: 16px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ex-mute);
}

.exec-recon-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.exec-recon-k {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ex-mute);
}

.exec-recon-total {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ex-ink);
  font-variant-numeric: tabular-nums;
}

.exec-recon-bar {
  display: flex;
  height: 30px;
  overflow: hidden;
}

.exec-seg-1 { background: var(--ex-accent); }
.exec-seg-2 { background: var(--ex-flat); }
.exec-seg-3 {
  background: transparent;
  border: 1px solid var(--ex-rule);
  border-left: 0;
}

.exec-recon-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--ex-hair);
}

.exec-leg-k {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ex-mute);
  margin-bottom: 8px;
}

.exec-dot {
  width: 8px;
  height: 8px;
  flex: none;
}

.exec-leg-v {
  font-size: 15px;
  font-weight: 650;
  color: var(--ex-ink);
  font-variant-numeric: tabular-nums;
}

.exec-leg-s {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ex-mute);
  font-variant-numeric: tabular-nums;
}

.exec-cohort {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--ex-hair);
}

.exec-co-k {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ex-mute);
  margin-bottom: 8px;
}

.exec-co-v {
  font-size: 17px;
  font-weight: 650;
  color: var(--ex-ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- 04 methodology ---------- */
.exec-method {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.exec-rule {
  padding: 0 28px;
  border-left: 1px solid var(--ex-rule);
}

.exec-rule:first-child {
  padding-left: 0;
  border-left: 0;
}

.exec-rule-n {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ex-accent);
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.exec-rule-t {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ex-ink);
  margin-bottom: 10px;
}

.exec-rule-d {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ex-body);
}

.exec-foot {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--ex-rule);
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ex-mute);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .exec-split { grid-template-columns: 1fr; gap: 44px; }
  .exec-quality { grid-template-columns: 1fr; gap: 34px; }
  .exec-q-figure { padding-right: 0; padding-bottom: 26px; border-right: 0; border-bottom: 1px solid var(--ex-rule); }
  .exec-method { grid-template-columns: repeat(2, 1fr); row-gap: 34px; }
  .exec-rule:nth-child(3) { padding-left: 0; border-left: 0; }
}

@media (max-width: 640px) {
  #tab-greater-china.active { max-width: none; }
  .exec-hero { padding-bottom: 30px; }
  .exec-hero-top { flex-direction: column; gap: 22px; margin-bottom: 32px; }
  .exec-hero-aside { align-items: flex-start; text-align: left; }
  .exec-title { font-size: 30px; }

  /* Hero KPI: revenue spans the full width beneath the two ratios */
  .exec-headline { grid-template-columns: 1fr 1fr; row-gap: 26px; }
  .exec-hk { padding: 0 0 0 20px; }
  .exec-hk:nth-child(3) {
    grid-column: 1 / -1;
    padding: 24px 0 0;
    border-left: 0;
    border-top: 1px solid var(--ex-rule);
  }
  .exec-hk-value { font-size: 34px; }
  .exec-hk:nth-child(3) .exec-hk-value { font-size: 42px; }

  .exec-block { padding: 34px 0; }
  .exec-head { margin-bottom: 24px; }
  .exec-head h3 { font-size: 17px; }

  /* Funnel becomes a vertical flow */
  .exec-funnel { grid-template-columns: 1fr; }
  .exec-stage { padding: 20px 22px; }
  .exec-stage-v { font-size: 32px; }
  .exec-link { flex-direction: row; gap: 12px; padding: 14px 0; min-width: 0; }
  .exec-link-k { text-align: left; }
  .exec-arrow { width: 1px; height: 22px; }
  .exec-arrow::after {
    right: auto; top: auto; left: -3px; bottom: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 6px solid var(--ex-rule);
    border-bottom: 0;
  }

  .exec-recon-legend { grid-template-columns: 1fr; gap: 16px; }
  .exec-cohort { grid-template-columns: 1fr; gap: 16px; }
  .exec-method { grid-template-columns: 1fr; row-gap: 28px; }
  .exec-rule { padding: 0; border-left: 0; }
}

/* Executive view owns the first screen: the shared filter row, the booking
   KPI tiles and the generic page header belong to the other tabs and are
   not used by this one. Pure CSS — navigation logic is untouched. */
.app:has(#tab-greater-china.active) > .filter-row,
.app:has(#tab-greater-china.active) > #kpiRow,
.app:has(#tab-greater-china.active) > .app-header {
  display: none;
}

#tab-greater-china.active {
  background: var(--surface);
  border: 1px solid var(--ex-hair);
  padding: 44px 56px 36px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  #tab-greater-china.active {
    padding: 26px 20px 24px;
    margin-left: -20px;
    margin-right: -20px;
    border-left: 0;
    border-right: 0;
  }
}

/* Keep the three funnel figures on one baseline even when a stage label wraps */
.exec-stage-k {
  min-height: 2.6em;
}

/* Market has 4 rows against the channel column's 7 — breathe the shorter
   list so the two columns read as a pair rather than a ragged gap */
#execMarket .exec-rank {
  gap: 34px;
}

@media (max-width: 900px) {
  #execMarket .exec-rank { gap: 20px; }
}

@media (max-width: 640px) {
  .exec-stage-k { min-height: 0; }
}

/* Fit the whole hero KPI band above the fold at 390x844 */
@media (max-width: 640px) {
  #tab-greater-china.active { padding-top: 20px; }
  .exec-title { font-size: 28px; margin-bottom: 10px; }
  .exec-eyebrow { margin-bottom: 8px; }
  .exec-hero-top { gap: 16px; margin-bottom: 24px; }
  .exec-meta { font-size: 11px; line-height: 1.65; }
  .exec-headline { row-gap: 20px; }
  .exec-hk:nth-child(3) { padding-top: 20px; }
}

/* ============================================================
   [P0] Mobile tab bar — horizontal scroll, never per-character wrap.
   Responsive CSS only; navigation JS and tab logic are untouched.
   ============================================================ */
@media (max-width: 768px) {
  .site-nav-inner {
    padding: 0;
    gap: 0;
  }

  .tabs {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
    padding: 0 14px;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    word-break: keep-all;
    padding: 14px 11px;
    font-size: 13px;
    line-height: 1.35;
  }
}

/* ---------- hero metadata: one restrained line, no box ---------- */
.exec-hero-aside {
  padding-top: 6px;
}

.exec-meta {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  line-height: 1.7;
  color: var(--ex-mute);
  white-space: nowrap;
}

.exec-meta i {
  font-style: normal;
  margin: 0 6px;
  color: var(--ex-flat);
}

@media (max-width: 640px) {
  .exec-hero-aside { padding-top: 0; }
  .exec-meta { white-space: normal; letter-spacing: 0.1em; }
}

/* ---------- funnel: editorial flow, not KPI cards ---------- */
.exec-stage {
  padding: 22px 0 0;
  border: 0;
  border-top: 2px solid var(--ex-rule);
}

.exec-stage-rev {
  border-top-color: var(--ex-accent);
}

.exec-funnel {
  align-items: start;
}

.exec-link {
  padding-top: 22px;
}

@media (max-width: 640px) {
  .exec-stage { padding: 18px 0 0; }
  .exec-link { padding: 16px 0; }
}

/* ============================================================================
   MASTER DESIGN SYSTEM
   Promotes the Revenue Attribution visual language to the whole dashboard.
   Presentation only — no data, chart config, filter or tab logic is touched.
   ============================================================================ */

/* ---- tokens: the exec palette becomes global; chart tokens re-themed to
        the same neutral gray hierarchy ---- */
:root {
  --ex-ink: #0d1117;
  --ex-body: #3d4451;
  --ex-mute: #767f8e;
  --ex-rule: #e2e5ea;
  --ex-hair: #eef0f3;
  --ex-accent: #1b4fd8;
  --ex-flat: #c9cfd8;

  --page: #f6f7f9;
  --surface: #ffffff;
  --nav-surface: #ffffff;
  --text-primary: #0d1117;
  --text-secondary: #3d4451;
  --text-muted: #767f8e;
  --gridline: #eef0f3;
  --baseline: #d6dae1;
  --border: #e2e5ea;
  --shadow: none;
  --series-1: #1b4fd8;
  --series-1-rgb: 27, 79, 216;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --ex-ink: #f2f4f8;
    --ex-body: #c2c8d2;
    --ex-mute: #8b93a1;
    --ex-rule: #2b3140;
    --ex-hair: #21262f;
    --ex-accent: #6b95ff;
    --ex-flat: #3a4151;

    --page: #0b0d12;
    --surface: #12151c;
    --nav-surface: #12151c;
    --text-primary: #f2f4f8;
    --text-secondary: #c2c8d2;
    --text-muted: #8b93a1;
    --gridline: #21262f;
    --baseline: #39404f;
    --border: #2b3140;
    --shadow: none;
    --series-1: #6b95ff;
    --series-1-rgb: 107, 149, 255;
  }
}

:root[data-theme="dark"] {
  --ex-ink: #f2f4f8;
  --ex-body: #c2c8d2;
  --ex-mute: #8b93a1;
  --ex-rule: #2b3140;
  --ex-hair: #21262f;
  --ex-accent: #6b95ff;
  --ex-flat: #3a4151;

  --page: #0b0d12;
  --surface: #12151c;
  --nav-surface: #12151c;
  --text-primary: #f2f4f8;
  --text-secondary: #c2c8d2;
  --text-muted: #8b93a1;
  --gridline: #21262f;
  --baseline: #39404f;
  --border: #2b3140;
  --shadow: none;
  --series-1: #6b95ff;
  --series-1-rgb: 107, 149, 255;
}

/* ---- shell ---- */
body {
  color: var(--ex-body);
}

.site-nav {
  box-shadow: none;
  border-bottom: 1px solid var(--ex-rule);
}

.tab-btn {
  padding: 15px 13px;
  font-size: 13.5px;
  letter-spacing: -0.004em;
  color: var(--ex-mute);
}

.tab-btn:hover {
  color: var(--ex-ink);
}

.tab-btn.active {
  color: var(--ex-ink);
  border-bottom-color: var(--ex-accent);
  font-weight: 650;
}

header.app-header {
  margin-bottom: 4px;
}

header.app-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ex-ink);
  margin-bottom: 6px;
}

header.app-header p {
  font-size: 12.5px;
  color: var(--ex-mute);
}

/* ---- synthetic-data disclosure: flattened chrome, unchanged prominence ---- */
.demo-banner {
  border-radius: 0;
  box-shadow: none;
  border: 1px solid var(--ex-rule);
  border-left: 3px solid var(--series-2);
  padding: 16px 18px;
  margin-bottom: 24px;
}

/* ---- filter toolbar: compact, subordinate to content ---- */
.filter-row {
  gap: 8px;
  margin: 18px 0 26px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ex-rule);
}

.filter-row label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ex-mute);
}

.filter-row select {
  font-size: 12.5px;
  padding: 5px 8px;
  border-radius: 2px;
  border: 1px solid var(--ex-rule);
  background: var(--surface);
  color: var(--ex-ink);
}

/* ---- KPI band: same family as the Revenue Attribution hero ---- */
.kpi-row {
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 30px;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--ex-rule);
  border-radius: 0;
  box-shadow: none;
  padding: 0 30px;
}

.stat-tile:first-child {
  border-left: 0;
  padding-left: 0;
}

.stat-tile .value {
  order: 1;
  font-size: 40px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ex-ink);
  font-variant-numeric: tabular-nums;
}

.stat-tile .label {
  order: 2;
  margin: 12px 0 0;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ex-mute);
}

/* ---- chart containers: hairline surfaces, no SaaS card ---- */
.tab-panel.active {
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--ex-hair);
  border-radius: 0;
  padding: 26px 28px;
  box-shadow: none;
}

.card h2 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.012em;
  color: var(--ex-ink);
  margin: 0 0 5px;
}

.card .subtitle {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ex-mute);
  margin: 0 0 22px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--ex-rule);
}

.card h2 + .subtitle {
  letter-spacing: 0.01em;
}

/* a card that is only a note: restrained info line, no heading rule */
.card > .subtitle:first-child:last-child {
  margin: 0;
  padding: 0;
  border-bottom: 0;
}

.card:has(> .subtitle:first-child:last-child) {
  background: transparent;
  border: 0;
  border-left: 2px solid var(--ex-rule);
  padding: 2px 0 2px 16px;
}

/* ---- chart chrome ---- */
.axis-label {
  fill: var(--ex-mute);
  font-size: 10px;
}

.value-label {
  fill: var(--ex-mute);
}

.legend {
  font-size: 11.5px;
  color: var(--ex-mute);
  gap: 14px;
}

.legend-swatch {
  border-radius: 0;
}

table.matrix {
  font-size: 12px;
}

table.matrix th,
table.matrix td {
  border-bottom: 1px solid var(--ex-hair);
  padding: 8px;
}

table.matrix th {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ex-mute);
}

.tooltip {
  border-radius: 2px;
  border: 1px solid var(--ex-rule);
  box-shadow: 0 2px 10px rgba(13, 17, 23, 0.1);
}

/* ---- responsive ---- */
@media (max-width: 860px) {
  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 26px;
  }
  .stat-tile:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }
  .stat-tile {
    padding: 0 18px;
  }
}

@media (max-width: 640px) {
  .card {
    padding: 22px 18px;
  }
  .stat-tile .value {
    font-size: 30px;
  }
  .filter-row {
    margin: 14px 0 20px;
  }
  header.app-header h1 {
    font-size: 19px;
  }
}

/* Grid items default to min-width:auto, so a wide matrix table stretches its
   column and pushes the page. Contain it: the table scrolls inside its own
   card instead of widening the layout. */
.tab-panel.active > * {
  min-width: 0;
}

.card {
  min-width: 0;
  overflow-x: auto;
}

@media (max-width: 640px) {
  table.matrix th,
  table.matrix td {
    padding: 6px 5px;
    font-size: 11px;
  }
}

/* The hero labels on the Revenue Attribution tab are English, where wide
   tracking reads as editorial. The other tabs label in Korean, where the same
   tracking just looks loose — tighten it there. */
.stat-tile .label {
  letter-spacing: 0.05em;
  font-size: 11px;
}

table.matrix th {
  letter-spacing: 0.04em;
}

/* The shared period/channel filter feeds only the booking and staff renders,
   and #kpiRow holds booking metrics. The five tabs below carry their own KPI
   band and ignore the filter, so showing either there is stale chrome —
   doubly visible now that both use the same editorial treatment.
   Presentation only: render functions and filter state are untouched. */
.app:has(#tab-influencer.active) > .filter-row,
.app:has(#tab-content.active) > .filter-row,
.app:has(#tab-megaroi.active) > .filter-row,
.app:has(#tab-experience.active) > .filter-row,
.app:has(#tab-viral.active) > .filter-row,
.app:has(#tab-influencer.active) > #kpiRow,
.app:has(#tab-content.active) > #kpiRow,
.app:has(#tab-megaroi.active) > #kpiRow,
.app:has(#tab-experience.active) > #kpiRow,
.app:has(#tab-viral.active) > #kpiRow {
  display: none;
}

/* Without the filter rule above them, these tabs need the header separation */
.app:has(#tab-influencer.active) > .tab-panel,
.app:has(#tab-content.active) > .tab-panel,
.app:has(#tab-megaroi.active) > .tab-panel,
.app:has(#tab-experience.active) > .tab-panel,
.app:has(#tab-viral.active) > .tab-panel {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--ex-rule);
}

/* Chart SVGs carry width:100% with a fixed height attribute, so on a narrow
   card the viewBox scales down but the element keeps its full height and
   leaves a large empty band. Let the box follow the drawing instead.
   Presentation only — the viewBox and chart config are untouched. */
@media (max-width: 860px) {
  .card svg {
    height: auto;
  }
}
