:root {
  --bg-1: #0a0e1a;
  --bg-2: #111827;
  --card: #1a1f2e;
  --border: rgba(55, 65, 81, 0.6);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --red: #ef4444;
  --pink: #f43f5e;
  --green: #22c55e;
  --yellow: #eab308;
  --blue: #3b82f6;
  --cyan: #06b6d4;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", "Pretendard", "Noto Sans KR", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, var(--bg-2), var(--bg-1) 55%);
}

.page { max-width: 1440px; margin: 0 auto; padding: 24px 16px 112px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  transition: border-color .25s ease, transform .25s ease;
}
.card:hover { border-color: rgba(107, 114, 128, .9); }

.header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.header h1 { margin: 0; font-size: 1.6rem; }
.dday { margin: 0; color: var(--red); font-size: 1.55rem; font-weight: 800; text-align: center; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
select, button { font: inherit; }
select {
  background: #101827;
  color: var(--text);
  border: 1px solid #4b5563;
  border-radius: 10px;
  padding: 8px 10px;
}

.kpi-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi {
  display: flex;
  flex-direction: column;
}
.kpi .btn {
  margin-top: auto;
}
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.label { margin: 0; color: var(--muted); font-size: .9rem; }
.value { margin: 8px 0 10px; font-size: clamp(2rem, 2.8vw, 3rem); font-weight: 900; letter-spacing: -.01em; }
.small { margin: 8px 0 0; font-size: .8rem; color: #d1d5db; line-height: 1.45; }
.small b { color: #67e8f9; margin-right: 6px; }

.badge {
  border: 1px solid #4b5563;
  border-radius: 999px;
  font-size: .74rem;
  padding: 4px 9px;
  color: #cbd5e1;
}
.badge.positive { color: #86efac; border-color: rgba(34, 197, 94, .4); background: rgba(34, 197, 94, .1); }
.badge.negative { color: #fda4af; border-color: rgba(244, 63, 94, .5); background: rgba(244, 63, 94, .1); }
.badge.neutral { color: #d1d5db; }
.badge.warn { color: #fde047; border-color: rgba(234, 179, 8, .45); background: rgba(234, 179, 8, .12); }
.badge.info { color: #67e8f9; border-color: rgba(6, 182, 212, .45); background: rgba(6, 182, 212, .12); }
.badge.live { border-color: rgba(34, 197, 94, .45); color: #86efac; background: rgba(34, 197, 94, .12); }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 6px;
  animation: pulse 1.4s infinite ease-in-out;
}
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(.8); opacity: .5; }
}

.btn {
  background: linear-gradient(90deg, var(--red), var(--pink));
  border: 0;
  color: white;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}
.btn:hover { transform: scale(1.02); box-shadow: 0 0 24px rgba(244, 63, 94, .35); }
.btn-outline { background: transparent; border: 1px solid #4b5563; color: #e5e7eb; }
.btn.rounded { border-radius: 999px; padding: 10px 16px; }
.btn.pink { background: linear-gradient(90deg, #ec4899, #f43f5e); }

.progress { height: 10px; background: #374151; border-radius: 999px; overflow: hidden; margin: 6px 0 8px; }
.fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 1s ease;
}
.fill.blue { background: var(--blue); }
.fill.orange { background: #f97316; }

.sparkline { width: 100%; height: 56px; }
.sparkline path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
}
.sparkline.red path { stroke: var(--pink); }

.main-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}
h2 { margin: 0 0 10px; font-size: 1.08rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.trend-badge { border-color: rgba(244, 63, 94, .5); color: #fda4af; background: rgba(244, 63, 94, .09); }

.chart-area { margin-top: 8px; border-radius: 12px; overflow: hidden; border: 1px solid #374151; background: #101827; }
.chart-area svg { width: 100%; height: 280px; display: block; }
.line { fill: none; stroke-width: 3; }
.blue-line { stroke: var(--blue); }
.red-line { stroke: var(--pink); }
.fill { stroke: none; }
.blue-fill { fill: rgba(59, 130, 246, .2); }
.red-fill { fill: rgba(244, 63, 94, .2); }
.x-axis {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 8px 12px 12px;
  color: #94a3b8;
  font-size: .75rem;
}
.trend a { color: #67e8f9; text-underline-offset: 4px; }
.report-box {
  margin-top: 12px;
  border: 1px solid rgba(75, 85, 99, .7);
  background: #141a2a;
  border-radius: 12px;
  padding: 12px;
}
.report-box h3 {
  margin: 0 0 8px;
  font-size: .98rem;
  color: #fda4af;
}
.report-box p {
  margin: 0 0 10px;
  color: #d1d5db;
  font-size: .88rem;
  line-height: 1.45;
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.report-item {
  border: 1px solid rgba(75, 85, 99, .6);
  background: #101827;
  border-radius: 10px;
  padding: 8px;
}
.report-item small {
  color: #93c5fd;
  font-size: .72rem;
}
.report-item p {
  margin: 4px 0 0;
  font-size: .82rem;
}
.report-box ul {
  margin: 0;
  padding-left: 18px;
  color: #cbd5e1;
  font-size: .84rem;
}
.report-box li { margin: 5px 0; }

.channels .channel-card {
  margin-top: 10px;
  border: 1px solid rgba(75, 85, 99, .7);
  background: #151b2b;
  border-radius: 12px;
  padding: 12px;
}
.channel-card p { margin: 6px 0; color: #cbd5e1; font-size: .9rem; }

.rank-row { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; font-size: .92rem; }
.rank-row p { margin: 0; color: #d1d5db; }
.rank-row b { color: #fda4af; }
.dual-progress {
  margin-top: 6px;
  height: 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, .25);
  overflow: hidden;
}
.dual-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #ef4444;
}
.tiny-btn {
  margin-top: 12px;
  border: 1px solid #6b7280;
  background: transparent;
  color: #d1d5db;
  font-size: .76rem;
  border-radius: 999px;
  padding: 4px 10px;
}
.warning-card {
  margin-top: 12px;
  background: linear-gradient(90deg, rgba(127, 29, 29, .45), rgba(31, 41, 55, .1));
  border: 1px solid rgba(244, 63, 94, .3);
  border-radius: 12px;
  padding: 12px;
}
.warning-card p { margin: 0 0 10px; }

.feed-wrap { max-height: 440px; overflow-y: auto; padding-right: 4px; }
.feed-item {
  border: 1px solid rgba(75, 85, 99, .65);
  background: #151b2b;
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
}
.feed-item small { color: #9ca3af; text-transform: uppercase; font-size: .68rem; }
.feed-item p { margin: 6px 0; font-size: .9rem; }
.feed-item b { display: block; margin-bottom: 4px; }
.feed-item .impact { color: #4ade80; }
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}
.slide-in { animation: slideInDown .35s ease-out; }

.sticky-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  border-top: 1px solid rgba(244, 63, 94, .35);
  background: rgba(15, 23, 42, .95);
  backdrop-filter: blur(4px);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -8px 26px rgba(244, 63, 94, .12);
}
.sticky-banner p { margin: 0; font-size: .95rem; }

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .header { grid-template-columns: 1fr; }
  .dday { text-align: left; }
  .header-actions { justify-content: flex-start; flex-wrap: wrap; }
  .kpi-grid { grid-template-columns: 1fr; }
  .sticky-banner { flex-direction: column; align-items: flex-start; }
  .report-grid { grid-template-columns: 1fr; }
}
