:root {
  color-scheme: dark only;
  --bg-main: #080a10;
  --bg-surface: #101420;
  --bg-surface-2: #151b2c;
  --bg-surface-hover: #1c243a;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --fest-gold: #f59e0b;
  --fest-gold-hi: #fbbf24;
  --fest-bg: rgba(245, 158, 11, 0.12);
  --fest-border: rgba(245, 158, 11, 0.35);

  --ev-cyan: #38bdf8;
  --ev-blue: #3b82f6;
  --ev-bg: rgba(56, 189, 248, 0.12);
  --ev-border: rgba(56, 189, 248, 0.35);

  --live-green: #10b981;
  --danger-red: #ef4444;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --font-sans: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.45;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 12% 6%, rgba(245, 158, 11, 0.1), transparent 36%),
    radial-gradient(circle at 88% 8%, rgba(56, 189, 248, 0.1), transparent 36%);
  background-attachment: fixed;
}

.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3.5rem;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  background: rgba(16, 20, 32, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--fest-border);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
  flex-shrink: 0;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.brand-titles h1 {
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.brand-sub {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.brand-sub strong {
  color: #e2e8f0;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.live-pill.loading {
  background: rgba(245, 158, 11, 0.16);
  color: var(--fest-gold-hi);
  border-color: var(--fest-border);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live-green);
  box-shadow: 0 0 8px var(--live-green);
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.85; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.85; }
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sync-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.sync-clock {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 0.84rem;
}

.next-countdown {
  font-size: 0.74rem;
  color: var(--text-muted);
  padding-left: 0.35rem;
  border-left: 1px solid var(--border-subtle);
}

.auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
}

.auto-toggle input {
  accent-color: var(--live-green);
  cursor: pointer;
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #090b10;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-refresh:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.refresh-icon.spinning {
  display: inline-block;
  animation: spin360 0.8s linear infinite;
}

@keyframes spin360 {
  to { transform: rotate(360deg); }
}

.error-banner {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.1rem;
  font-size: 0.86rem;
}

/* Section Layout */
.section-block {
  margin-bottom: 1.4rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.section-step.live {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.section-head h2 {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.section-head h2 small {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 0.4rem;
}

.section-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.combined-live-pill {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #d1fae5;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.83rem;
}

.combined-live-pill strong {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  color: #34d399;
  margin: 0 2px;
}

.dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/* Live Cards */
.live-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.3rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

.live-card.festival {
  border-top: 3px solid var(--fest-gold);
}

.live-card.event {
  border-top: 3px solid var(--ev-cyan);
}

.live-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.site-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 0.35rem;
}

.site-badge.festival {
  background: var(--fest-bg);
  color: var(--fest-gold-hi);
  border: 1px solid var(--fest-border);
}

.site-badge.event {
  background: var(--ev-bg);
  color: var(--ev-cyan);
  border: 1px solid var(--ev-border);
}

.site-domain-link {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.site-domain-link:hover {
  color: #fff;
  text-decoration: underline;
}

.live-number-box {
  text-align: right;
}

.live-caption {
  display: block;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.live-big-num {
  font-family: var(--font-mono);
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
}

.live-card.festival .live-big-num span {
  color: var(--fest-gold-hi);
}

.live-card.event .live-big-num span {
  color: var(--ev-cyan);
}

.live-big-num small {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-left: 3px;
}

.live-sub-num {
  display: block;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.live-sub-num strong {
  color: #e2e8f0;
  font-family: var(--font-mono);
}

.spark-wrap {
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem 0.45rem;
  margin-bottom: 0.75rem;
}

.spark-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.69rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.minute-bars {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  align-items: end;
  gap: 3px;
  height: 44px;
}

.m-bar {
  border-radius: 2px 2px 0 0;
  min-height: 3px;
  transition: height 0.25s ease;
  position: relative;
}

.minute-bars.festival .m-bar {
  background: linear-gradient(180deg, #fbbf24, rgba(245, 158, 11, 0.35));
}

.minute-bars.event .m-bar {
  background: linear-gradient(180deg, #38bdf8, rgba(56, 189, 248, 0.35));
}

.m-bar.zero {
  background: rgba(255, 255, 255, 0.07) !important;
}

.live-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.device-bar-wrap {
  min-width: 160px;
  flex: 0 1 200px;
}

.device-labels {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.device-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.device-fill.mobile {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 999px;
}

.rt-events-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
  flex: 1;
}

.rt-pill {
  font-size: 0.73rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #e2e8f0;
}

.rt-pill strong {
  font-family: var(--font-mono);
  color: #fff;
  margin-left: 3px;
}

.rt-pill.muted {
  color: var(--text-muted);
}

/* Period Selector Bar */
.period-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 0.85rem 1.15rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.period-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.period-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #e2e8f0;
}

.period-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.period-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.period-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.period-btn.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--fest-gold);
  color: var(--fest-gold-hi);
  font-weight: 800;
}

.custom-date-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.custom-date-box input[type="date"] {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 5px 8px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.btn-apply-date {
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-apply-date:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Cross-Site Flow Banner */
.cross-flow-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 0.8rem 1.15rem;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08), rgba(56, 189, 248, 0.08));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1.4rem;
}

.cross-flow-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.cross-tag {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.cross-flow-left p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.cross-flow-left code {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 5px;
  border-radius: 4px;
}

.cross-flow-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.flow-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 6px 12px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
}

.flow-chip.to-fest strong {
  font-family: var(--font-mono);
  color: var(--fest-gold-hi);
  font-size: 0.92rem;
}

.flow-chip.to-ev strong {
  font-family: var(--font-mono);
  color: var(--ev-cyan);
  font-size: 0.92rem;
}

/* Panel Cards (Channel Rankings) */
.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.3rem;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

.panel-card.festival {
  border-top: 3px solid var(--fest-gold);
}

.panel-card.event {
  border-top: 3px solid var(--ev-cyan);
}

.panel-header {
  margin-bottom: 0.9rem;
}

.panel-tag {
  display: inline-block;
  font-size: 0.73rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 5px;
  margin-bottom: 4px;
}

.panel-tag.festival {
  background: var(--fest-bg);
  color: var(--fest-gold-hi);
}

.panel-tag.event {
  background: var(--ev-bg);
  color: var(--ev-cyan);
}

.panel-header h3 {
  font-size: 1.06rem;
  font-weight: 800;
}

.panel-header h3 span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 6px;
}

/* KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.kpi-item {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.kpi-item.highlight-gold {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.07);
}

.kpi-item.highlight-cyan {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.07);
}

.kpi-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.kpi-item.highlight-gold .kpi-val {
  color: var(--fest-gold-hi);
}

.kpi-item.highlight-cyan .kpi-val {
  color: var(--ev-cyan);
}

/* Channel Rows */
.channel-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.channel-row {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 11px;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.channel-row:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateX(2px);
}

.channel-row.selected {
  border-color: var(--fest-gold);
  background: rgba(245, 158, 11, 0.11);
}

.channel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 6px;
}

.channel-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.channel-row:nth-child(1) .rank-num {
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
}

.channel-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.channel-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-desc {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.channel-stats {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-shrink: 0;
}

.ch-sessions {
  font-family: var(--font-mono);
  font-size: 0.94rem;
  font-weight: 800;
  color: #fff;
}

.ch-pct {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 44px;
  text-align: right;
}

.channel-bar-track {
  height: 7px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.channel-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.panel-card.festival .channel-bar-fill {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.panel-card.event .channel-bar-fill {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.channel-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.73rem;
  color: var(--text-muted);
}

.conv-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mini-conv {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 0.7rem;
}

.mini-conv strong {
  font-family: var(--font-mono);
  color: #fff;
}

/* Daily Chart */
.chart-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

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

.dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.dot.festival { background: var(--fest-gold); }
.dot.event { background: var(--ev-cyan); }

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  position: relative;
}

.daily-chart-area {
  height: 220px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding-top: 18px;
  padding-bottom: 24px;
  overflow-x: auto;
}

.day-col {
  flex: 1;
  min-width: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  cursor: pointer;
}

.day-col:hover {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

.day-bars {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 0 2px;
}

.d-bar {
  flex: 1;
  max-width: 12px;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  transition: height 0.25s ease;
}

.d-bar.festival {
  background: linear-gradient(180deg, #fbbf24, #d97706);
}

.d-bar.event {
  background: linear-gradient(180deg, #38bdf8, #0284c7);
}

.day-label {
  position: absolute;
  bottom: -20px;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.chart-tooltip {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  background: rgba(8, 10, 16, 0.96);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font-size: 0.78rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  min-width: 175px;
}

.chart-tooltip .tt-date {
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 3px;
}

.chart-tooltip .tt-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.chart-tooltip .tt-row strong {
  font-family: var(--font-mono);
}

/* Detail Table */
.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.site-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.site-tab {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
}

.site-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.site-tab.active[data-site="festival"] {
  background: var(--fest-bg);
  border-color: var(--fest-gold);
  color: var(--fest-gold-hi);
}

.site-tab.active[data-site="event"] {
  background: var(--ev-bg);
  border-color: var(--ev-cyan);
  color: var(--ev-cyan);
}

.site-tab.active[data-site="both"] {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #34d399;
}

.filter-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.active-channel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid var(--fest-border);
  color: var(--fest-gold-hi);
  font-size: 0.78rem;
  font-weight: 700;
}

.active-channel-chip button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-weight: 800;
}

.search-input {
  min-width: 260px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--fest-gold);
}

.btn-download {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-download:hover {
  background: rgba(255, 255, 255, 0.12);
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 0.9rem;
  background: #0d111b;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.76rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table th.num,
.data-table td.num {
  text-align: right;
  font-family: var(--font-mono);
}

.data-table td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.ch-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.raw-sm {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #cbd5e1;
}

.camp-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-highlight {
  color: var(--fest-gold-hi);
  font-weight: 700;
}

.conv-highlight-cyan {
  color: var(--ev-cyan);
  font-weight: 700;
}

.empty-cell,
.skeleton-loader {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.page-footer {
  text-align: center;
  margin-top: 2.2rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.page-footer code {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
  .dual-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .page-shell {
    padding: 0.9rem 0.85rem 2.5rem;
  }
  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .channel-desc {
    display: none;
  }
  .search-input {
    min-width: 100%;
  }
}

