/* 대시보드 커스텀 스타일 — CSP default-src 'self' 하 정적 파일만 허용 (인라인 금지, §4.6) */

.live-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
  margin-bottom: 1rem;
}
.live-header .spacer { flex: 1; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.8rem;
  background: var(--pico-secondary-background);
}
.badge-paper { background: #1c4b82; color: #fff; }
.badge-live { background: #a11; color: #fff; }

.badges { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.badges .ok { color: #2ecc71; }
.badges .dead { color: #e74c3c; }

.emergency {
  background: #a11;
  color: #fff;
  border: none;
  font-weight: 700;
}
.emergency:disabled { opacity: 0.5; }

.position-card {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}
.position-card ul { margin: 0.3rem 0 0; padding-left: 1rem; }

.stale { background: #4a2c00; border-left: 4px solid #e0a800; }
mark.halt { background: #e74c3c; color: #fff; }

#ws-status.ok { color: #2ecc71; }
#ws-status.dead { color: #888; }

#equity-chart { width: 100%; min-height: 240px; }

.event-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 20rem;
  overflow-y: auto;
  font-family: var(--pico-font-family-monospace, monospace);
  font-size: 0.8rem;
}
.event-feed li {
  padding: 0.2rem 0.4rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-feed .evt-risk { color: #e0a800; }
.event-feed .evt-trade { color: #2ecc71; }
.event-feed .replay { opacity: 0.6; }

.page-nav { display: flex; justify-content: space-between; align-items: center; }
.page-nav a.current { font-weight: 700; text-decoration: underline; }
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.filters input, .filters select { margin: 0; width: auto; }

.table-scroll { overflow-x: auto; }
.table-scroll table { font-size: 0.85rem; white-space: nowrap; }
td.pos { color: #2ecc71; }
td.neg { color: #e74c3c; }
td.warn { color: #e0a800; font-weight: 700; }

/* 한눈에 보기 — 초보자용 요약 카드 (라이브 페이지 상단) */
.glance { border: 2px solid var(--pico-primary-border, #1c4b82); }
.glance h3 { margin-bottom: 0.6rem; }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.summary-card {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.5rem;
  padding: 0.45rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.summary-card small { color: #888; font-size: 0.72rem; }
.summary-card strong { font-size: 0.95rem; }
.summary-card .pos, strong.pos { color: #2ecc71; }
.summary-card .neg, strong.neg { color: #e74c3c; }
.summary-card .warn { color: #e0a800; }
.hint { cursor: help; color: #888; font-weight: 400; }

/* /stats 히트맵 — CSP default-src 'self'는 인라인 style 속성도 차단 → 색은 클래스만 (§2.7) */
.heatmap { border-collapse: collapse; font-size: 0.72rem; }
.heatmap th, .heatmap td {
  border: 1px solid var(--pico-muted-border-color);
  padding: 0.15rem 0.3rem;
  text-align: center;
  min-width: 2.2rem;
}
.heatmap td.gray { color: #888; background: var(--pico-secondary-background); }
.heatmap td.win { background: #14532d; color: #d6f5d6; }
.heatmap td.lose { background: #5c1a1a; color: #f5d6d6; }
.heatmap td.flat { background: var(--pico-secondary-background); }
.stat-note { color: #888; font-size: 0.8rem; }

.report-frame { width: 100%; height: 70vh; border: 1px solid var(--pico-muted-border-color); }
.report-json {
  max-height: 60vh;
  overflow: auto;
  font-size: 0.8rem;
  white-space: pre;
}
