:root {
  --bg: #09101b;
  --panel: #111b2a;
  --panel2: #162335;
  --line: #27364b;
  --text: #eaf0f8;
  --muted: #98a7ba;
  --ok: #43c59e;
  --watch: #e3bd50;
  --danger: #f08a5d;
  --crash: #e95d75;
  --accent: #7ea6ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 10% 0, #162239 0, #09101b 38%);
  color: var(--text);
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.shell {
  width: min(1460px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 80px;
}

.page-header,
.panel-title,
.section-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
}

.page-header {
  margin-bottom: 24px;
}

h1, h2, h3, h4, p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 3.8vw, 44px);
  letter-spacing: -0.04em;
  line-height: 1.2;
}

h2 {
  font-size: clamp(18px, 2.2vw, 24px);
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.muted,
.section-title > p {
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.timestamp {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

/* 상단 히어로 그리드 요약 카드 */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.score-card,
.summary-card,
.panel,
.metric-card {
  background: linear-gradient(145deg, rgba(22, 35, 53, 0.96), rgba(13, 23, 36, 0.96));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.18);
}

.score-card,
.summary-card {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.score-card span,
.summary-card span,
.metric-card .label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.score-card strong {
  display: block;
  font-size: 46px;
  line-height: 1.05;
  margin: 12px 0 6px;
  letter-spacing: -0.03em;
}

.score-card b {
  font-size: 15px;
  font-weight: 700;
}

.meter {
  height: 8px;
  background: #273348;
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 8px;
}

.meter i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ok), var(--watch), var(--crash));
  transition: width 0.4s ease;
}

.rally .meter i {
  background: linear-gradient(90deg, #526178, #6ea8fe, #43c59e);
}

.fragility .meter i {
  background: linear-gradient(90deg, #43c59e, #e3bd50, #f08a5d, #e95d75);
}

.score-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 4px;
}

.summary-card p {
  font-size: 16px;
  line-height: 1.55;
  margin: 14px 0 12px;
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.chip {
  padding: 6px 12px;
  border: 1px solid #3b4b62;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(22, 35, 53, 0.85);
  white-space: nowrap;
  cursor: help;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: #6a96dc;
  background: rgba(44, 77, 131, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}

/* 패널 공통 */
.panel {
  padding: 22px 24px;
  margin: 20px 0;
}

.panel-title {
  margin-bottom: 18px;
}

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

.range-buttons button,
select {
  border: 1px solid #34445c;
  background: #111b2a;
  color: var(--text);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.range-buttons button:hover,
select:hover {
  border-color: #5577ad;
}

.range-buttons button.active {
  background: #2c4d83;
  border-color: #6a96dc;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(44, 77, 131, 0.4);
}

/* 차트 컨테이너 및 툴팁 스타일 */
.chart {
  position: relative;
  width: 100%;
  min-height: 240px;
  user-select: none;
  touch-action: pan-y;
}

.chart.large {
  min-height: 290px;
  height: auto;
  display: flex;
  flex-direction: column;
}

.chart svg {
  width: 100%;
  height: 250px;
  overflow: visible;
  display: block;
}

.empty {
  display: grid;
  place-items: center;
  height: 240px;
  color: var(--muted);
  font-size: 14px;
}

/* 차트 내부 시리즈 범례 (폭락 위험점수 / 급반등 점수 등) */
.chart-series-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 14px;
  padding: 8px 16px;
  background: rgba(14, 23, 38, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(59, 75, 98, 0.4);
}

.chart-series-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
}

.chart-series-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* 상태 구간 범례 (0~24 정상, 25~44 주의 등) */
.legend {
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
  padding: 4px 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd6e5;
  font-size: 12px;
}

.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 인터랙티브 차트 툴팁 */
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 30;
  background: rgba(11, 19, 31, 0.94);
  border: 1px solid #3b5271;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  font-size: 12px;
  color: #eaf0f8;
  min-width: 150px;
  max-width: 280px;
  transition: opacity 0.12s ease;
  transform: translate(-50%, -100%);
  margin-top: -12px;
  opacity: 0;
  visibility: hidden;
}

.chart-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

.chart-tooltip-date {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 6px;
  border-bottom: 1px solid #23354c;
  padding-bottom: 4px;
}

.chart-tooltip-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 3px 0;
}

.chart-tooltip-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #cbd6e5;
}

.chart-tooltip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-tooltip-value {
  font-weight: 700;
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.chart-tooltip-event {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px dashed #283c55;
  font-size: 11px;
  font-weight: 600;
}

/* 차트 내부 인터랙션 가이드 요소 */
.chart-crosshair {
  stroke: rgba(148, 163, 184, 0.45);
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
  pointer-events: none;
}

.chart-dot-marker {
  stroke: #09101b;
  stroke-width: 2;
  pointer-events: none;
  transition: r 0.15s ease;
}

/* 지표 그리드 및 지표 카드 */
.section-title {
  margin: 34px 0 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  position: relative;
  padding: 16px 18px;
  min-width: 0;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: #4f6e96;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.label-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.label-group .label {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.25;
}

.easy-tag {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
  white-space: nowrap;
}

.severity-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid;
  flex-shrink: 0;
  white-space: nowrap;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 4px;
}

.metric-value {
  font-size: 25px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.metric-change {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.metric-why {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
  min-height: 48px;
  overflow: visible;
  display: block;
  word-break: keep-all;
  transition: color 0.15s ease;
}

.metric-card:hover .metric-why {
  color: #f1f5f9;
}

.spark {
  height: 60px;
  margin: 4px 0 8px;
  position: relative;
  border-radius: 6px;
  background: rgba(10, 16, 26, 0.35);
}

.schedule {
  display: grid;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  margin-top: auto;
}

.schedule span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.schedule b {
  color: #c9d5e6;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* 테이블 레이아웃 */
.table-wrap {
  overflow: auto;
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  background: rgba(14, 22, 35, 0.6);
}

a {
  color: #91b4ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.axis-text {
  fill: #7f90a5;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.grid-line {
  stroke: #26364a;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.event-dot {
  stroke: #09101b;
  stroke-width: 2;
}

/* 데이터 품질 카드 및 경고 */
.quality-card {
  padding: 20px 22px;
  background: linear-gradient(145deg, rgba(22, 35, 53, 0.96), rgba(13, 23, 36, 0.96));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quality-card > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.quality-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 12px 0 8px;
}

.quality-heading strong {
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.quality-heading b {
  font-size: 15px;
  font-weight: 700;
}

.provider-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 6px 11px;
  border: 1px solid #3b4b62;
  border-radius: 999px;
  color: #cbd6e5;
  font-size: 12px;
  margin-bottom: 8px;
  background: rgba(18, 28, 44, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quality-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.quality-warning {
  margin: -4px 0 18px;
  padding: 12px 16px;
  border: 1px solid rgba(227, 189, 80, 0.55);
  border-radius: 12px;
  background: rgba(227, 189, 80, 0.1);
  color: #f2d982;
  font-size: 13px;
  line-height: 1.5;
}

.quality-warning[hidden] {
  display: none;
}

/* 데이터 출처 고지 */
.data-disclaimer {
  margin-top: 28px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 27, 42, 0.7);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.data-disclaimer strong {
  display: block;
  color: #cbd6e5;
  margin-bottom: 4px;
  font-size: 13px;
}

.data-disclaimer p {
  margin: 0;
}

/* 헤더 액션 및 버튼 */
.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.header-actions form {
  margin: 0;
}

.primary-button,
.secondary-button,
.small-button {
  border: 1px solid #3b5271;
  border-radius: 10px;
  padding: 8px 14px;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.primary-button {
  background: #3567ad;
  border-color: #507fc1;
}

.primary-button:hover {
  background: #4179c7;
}

.secondary-button {
  background: #17263a;
}

.secondary-button:hover {
  background: #23364f;
  border-color: #4e6a8e;
}

.small-button {
  padding: 5px 9px;
  font-size: 12px;
}

.primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.identity-badge {
  display: inline-flex;
  align-items: center;
  max-width: 240px;
  padding: 6px 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #cbd5e1;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 엔 캐리 조기경보 패널 스타일 */
.yen-carry-panel {
  border-color: #395175;
  background: linear-gradient(145deg, rgba(20, 32, 50, 0.98), rgba(11, 20, 33, 0.98));
  position: relative;
  overflow: hidden;
}

.yen-carry-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #43c59e, #e3bd50, #f08a5d, #e95d75);
}

.yen-carry-badge-wrap {
  display: flex;
  align-items: center;
}

.yen-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.yen-badge.green {
  background: rgba(67, 197, 158, 0.16);
  color: #43c59e;
  border: 1px solid rgba(67, 197, 158, 0.45);
}

.yen-badge.yellow {
  background: rgba(227, 189, 80, 0.18);
  color: #f2d982;
  border: 1px solid rgba(227, 189, 80, 0.55);
  box-shadow: 0 0 16px rgba(227, 189, 80, 0.2);
}

.yen-badge.orange {
  background: rgba(240, 138, 93, 0.2);
  color: #ff9e79;
  border: 1px solid rgba(240, 138, 93, 0.6);
  box-shadow: 0 0 20px rgba(240, 138, 93, 0.25);
}

.yen-badge.red {
  background: rgba(233, 93, 117, 0.24);
  color: #ff9caf;
  border: 1px solid rgba(233, 93, 117, 0.75);
  box-shadow: 0 0 24px rgba(233, 93, 117, 0.35);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.yen-carry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.yen-card {
  padding: 18px 20px;
  background: rgba(14, 23, 37, 0.7);
  border: 1px solid #24354c;
  border-radius: 14px;
  transition: border-color 0.15s ease;
}

.yen-card:hover {
  border-color: #486386;
}

.yen-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.yen-card-top .title {
  font-size: 13px;
  color: #cbd6e5;
  font-weight: 700;
}

.yen-card-top .threshold {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.yen-card-val {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.yen-card-val strong {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.yen-card-val .unit {
  font-size: 15px;
  color: var(--muted);
}

.yen-change {
  font-size: 13px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.yen-change.danger {
  background: rgba(233, 93, 117, 0.2);
  color: #ff9caf;
}

.yen-change.caution {
  background: rgba(227, 189, 80, 0.18);
  color: #f2d982;
}

.yen-bp {
  font-size: 15px;
  color: #91b4ff;
  font-weight: 700;
}

.yen-card-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.yen-guide-box {
  padding: 16px 20px;
  background: rgba(12, 20, 33, 0.85);
  border: 1px solid #283a52;
  border-radius: 12px;
  margin-top: 6px;
}

.guide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.guide-header strong {
  font-size: 13px;
  color: #cbd6e5;
}

.reasons-pill {
  font-size: 12px;
  color: #e3bd50;
  font-weight: 600;
}

.guide-text {
  font-size: 14px;
  color: #eaf0f8;
  line-height: 1.55;
  font-weight: 600;
}

/* 시장 요약 배너 스타일 */
.beginner-pulse-panel {
  background: linear-gradient(135deg, rgba(16, 27, 45, 0.95), rgba(9, 15, 26, 0.95));
  border: 1px solid #2e4463;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.pulse-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.pulse-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.pulse-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.weather-badge {
  font-size: 13.5px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 30px;
  border: 1.5px solid transparent;
  white-space: nowrap;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.weather-badge.normal {
  background: rgba(67, 197, 158, 0.18);
  color: #43c59e;
  border-color: rgba(67, 197, 158, 0.45);
}

.weather-badge.caution {
  background: rgba(227, 189, 80, 0.22);
  color: #facc15;
  border-color: rgba(227, 189, 80, 0.55);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.weather-badge.storm_eve {
  background: rgba(240, 138, 93, 0.22);
  color: #f08a5d;
  border-color: rgba(240, 138, 93, 0.55);
}

.weather-badge.danger {
  background: rgba(233, 93, 117, 0.22);
  color: #e95d75;
  border-color: rgba(233, 93, 117, 0.55);
}

.weather-badge.rebound {
  background: rgba(180, 141, 240, 0.22);
  color: #b48df0;
  border-color: rgba(180, 141, 240, 0.55);
}

.pulse-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 14px;
}

.pulse-item {
  background: rgba(12, 20, 33, 0.7);
  border: 1px solid #1f3147;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pulse-item.highlight {
  background: rgba(30, 58, 95, 0.35);
  border-color: #3b82f688;
  box-shadow: inset 0 0 12px rgba(59, 130, 246, 0.1);
}

.pulse-item .item-label {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.pulse-item.highlight .item-label {
  color: #93c5fd;
}

.pulse-item .item-desc {
  margin: 0;
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.55;
  font-weight: 500;
}

/* 가이드 페이지 및 탭 네비게이션 스타일 */
.nav-tabs {
  display: inline-flex;
  background: rgba(14, 23, 38, 0.9);
  border: 1px solid #283a52;
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
}

.tab-link {
  padding: 6px 14px;
  border-radius: 7px;
  color: #8fa0b5;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

.tab-link.active {
  color: #fff;
  background: #223754;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.guide-section {
  margin-bottom: 24px;
}

.guide-lead {
  font-size: 15px;
  color: #cbd6e5;
  line-height: 1.6;
  margin-bottom: 16px;
}

.guide-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.guide-box {
  background: rgba(12, 20, 33, 0.85);
  border: 1px solid #283a52;
  border-radius: 12px;
  padding: 18px;
}

.guide-box h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 700;
  color: #eaf0f8;
}

.guide-bullets {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: #cbd6e5;
  line-height: 1.6;
}

.guide-bullets li {
  margin-bottom: 8px;
}

.formula-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #1d2c40;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #7cb3ff;
  font-size: 13px;
  margin-bottom: 14px;
}

.regime-matrix-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.matrix-card {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #283a52;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.matrix-card .badge {
  font-weight: 700;
  font-size: 13px;
}

.matrix-card p {
  margin: 0;
  font-size: 12px;
  color: #cbd6e5;
  font-weight: 600;
}

.matrix-card small {
  font-size: 11px;
  color: var(--muted);
}

.matrix-card.orange {
  background: rgba(227, 189, 80, 0.1);
  border-color: rgba(227, 189, 80, 0.3);
}

.matrix-card.orange .badge { color: #f2d982; }

.matrix-card.red {
  background: rgba(233, 93, 117, 0.1);
  border-color: rgba(233, 93, 117, 0.3);
}

.matrix-card.red .badge { color: #ff9caf; }

.matrix-card.green {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.3);
}

.matrix-card.green .badge { color: #86efac; }

.matrix-card.yellow {
  background: rgba(250, 204, 21, 0.1);
  border-color: rgba(250, 204, 21, 0.3);
}

.matrix-card.yellow .badge { color: #fde047; }

.row-green { background: rgba(74, 222, 128, 0.04); }
.row-yellow { background: rgba(250, 204, 21, 0.04); }
.row-orange { background: rgba(227, 189, 80, 0.06); }
.row-red { background: rgba(233, 93, 117, 0.08); }

/* FAQ 카드 */
.beginner-faq-panel {
  border-color: #3b82f644;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 30, 55, 0.95));
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.faq-card {
  background: rgba(12, 20, 33, 0.8);
  border: 1px solid #23354d;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.faq-card h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #93c5fd;
}

.faq-card p {
  margin: 0;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.55;
}

/* 관리자 계정 관리 및 모달 스타일 */
.admin-user-form {
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-modal {
  border: 1px solid var(--border, #283a52);
  border-radius: 14px;
  background: #0c1421;
  color: #eaf0f8;
  padding: 0;
  max-width: 440px;
  width: 90%;
  margin: auto;
}

.admin-modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-card h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #cbd6e5;
}

.modal-card input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #283a52;
  background: #080e18;
  color: #fff;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  padding: 30px;
  background: linear-gradient(145deg, rgba(22, 35, 53, 0.98), rgba(13, 23, 36, 0.98));
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.login-card h1 {
  font-size: 32px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.login-form label,
.filter-row label,
.inline-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.login-form input,
.filter-row input,
.filter-row select,
.inline-form input {
  width: 100%;
  border: 1px solid #34445c;
  background: #0d1724;
  color: var(--text);
  border-radius: 9px;
  padding: 11px 12px;
}

.form-error,
.admin-message {
  padding: 11px 13px;
  border: 1px solid rgba(233, 93, 117, 0.6);
  background: rgba(233, 93, 117, 0.12);
  border-radius: 10px;
  color: #ffbdc8;
  margin-top: 16px;
}

.admin-message {
  position: sticky;
  top: 12px;
  z-index: 10;
  margin: 0 0 14px;
  border-color: rgba(67, 197, 158, 0.55);
  background: rgba(67, 197, 158, 0.12);
  color: #9de1ca;
}

.admin-message.error {
  border-color: rgba(233, 93, 117, 0.6);
  background: rgba(233, 93, 117, 0.12);
  color: #ffbdc8;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.admin-stat {
  padding: 19px;
  background: linear-gradient(145deg, rgba(22, 35, 53, 0.96), rgba(13, 23, 36, 0.96));
  border: 1px solid var(--line);
  border-radius: 16px;
}

.admin-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.admin-stat strong {
  display: block;
  font-size: 26px;
  margin: 10px 0;
}

.admin-stat small {
  color: var(--muted);
}

.action-grid {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.inline-form {
  display: flex;
  gap: 9px;
  align-items: end;
  flex-wrap: wrap;
}

.inline-form input {
  width: 120px;
}

.admin-note {
  font-size: 12px;
  margin-top: 14px;
}

.filter-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 130px 100px auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}

.wrap-cell {
  white-space: normal;
  min-width: 220px;
  max-width: 460px;
}

.status-pill {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 999px;
  background: #26354b;
}

.status-pill.healthy { color: #8ee0c3; }
.status-pill.degraded { color: #f2d982; }
.status-pill.circuit_open { color: #ff9caf; }
.status-pill.quarantined {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.35);
}

.admin-shell table button {
  white-space: nowrap;
}

.access-identity {
  font-size: 0.82rem;
  color: #94a3b8;
  overflow-wrap: anywhere;
}

.small-button.danger {
  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;
}

.small-button.danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

/* 반응형 미디어 쿼리 */
@media (max-width: 1280px) {
  .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }
  .summary-card {
    grid-column: 1 / -1;
  }
  .quality-card {
    grid-column: auto;
  }
}

@media (max-width: 960px) {
  .pulse-grid {
    grid-template-columns: 1fr;
  }
  .yen-carry-grid {
    grid-template-columns: 1fr;
  }
  .guide-grid-2 {
    grid-template-columns: 1fr;
  }
  .regime-matrix-visual {
    grid-template-columns: 1fr;
  }
  .faq-grid {
    grid-template-columns: 1fr;
  }
  .admin-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .filter-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1460px);
    padding-top: 20px;
    padding-bottom: 50px;
  }
  .page-header,
  .panel-title,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .hero-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }
  .chart.large {
    height: 270px;
  }
  .legend {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .action-grid,
  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }
  .inline-form input {
    width: 100%;
  }
}

/* ==========================================================================
   v3.2 전용 대시보드 컴포넌트 스타일
   ========================================================================== */
.hero-grid-v32 {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 1024px) {
  .hero-grid-v32 {
    grid-template-columns: 1fr;
  }
}

.card-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(126, 166, 255, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  width: fit-content;
}

.card-main-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.phase-pill {
  font-size: 15px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.percentile-pill {
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.evidence-text {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
  margin-top: 6px;
  display: block;
}

/* 두 게이지가 각각 어떤 질문에 답하는지 카드 안에서 바로 보이게 한다 */
.gauge-question {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin: 4px 0 0;
  line-height: 1.4;
}

/* 점수 방향 안내 — "숫자가 높으면 좋다"는 오해를 막는 핵심 표기 */
.gauge-direction {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  margin: 8px 0 0;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(233, 93, 117, 0.1);
  color: #f0a3b1;
  border-left: 3px solid rgba(233, 93, 117, 0.55);
}

.gauge-direction b {
  font-size: inherit;
  font-weight: 800;
  color: #ff8fa3;
}

/* 가이드 FAQ — "점수가 높으면 좋은 것" 오해를 바로잡는 카드 강조 */
.faq-card-highlight {
  border: 1px solid rgba(233, 93, 117, 0.45);
  background: rgba(233, 93, 117, 0.07);
}

.gauge-direction-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.gauge-direction-note span {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.gauge-direction-note span:first-child {
  color: #43c59e;
  background: rgba(67, 197, 158, 0.12);
}

.gauge-direction-note span:last-child {
  color: #f0a3b1;
  background: rgba(233, 93, 117, 0.12);
}

.summary-panel-v32 {
  padding: 20px 24px;
  background: linear-gradient(145deg, rgba(20, 32, 50, 0.96), rgba(11, 20, 33, 0.96));
}

.summary-breakdown-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .summary-breakdown-grid {
    grid-template-columns: 1fr;
  }
}

.breakdown-box {
  background: rgba(12, 20, 33, 0.7);
  border: 1px solid #24354c;
  border-radius: 12px;
  padding: 16px 18px;
}

.breakdown-box h3 {
  font-size: 14px;
  font-weight: 700;
  color: #cbd6e5;
  margin-bottom: 12px;
}

.contributors-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contributor-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(233, 93, 117, 0.08);
  border: 1px solid rgba(233, 93, 117, 0.2);
  border-radius: 8px;
  font-size: 13px;
}

.contributor-item .c-name {
  color: #f1f5f9;
  font-weight: 600;
}

.contributor-item .c-pts {
  color: #ff9caf;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.e-components-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
}

.e-components-mini-grid .e-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: rgba(15, 25, 40, 0.6);
  border: 1px solid #23354c;
  border-radius: 8px;
  text-align: center;
}

.e-components-mini-grid .e-item span {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.e-components-mini-grid .e-item strong {
  font-size: 15px;
  font-weight: 800;
  color: #7ea6ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  transition: color 0.2s ease;
}

/* 구성요소 밴드 라벨 — 숫자만으로는 높낮이가 안 읽혀서 색 + 문구를 함께 준다 */
.e-components-mini-grid .e-item {
  transition: background 0.2s ease, border-color 0.2s ease;
  cursor: help;
}

.e-components-mini-grid .e-item .e-band {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  min-height: 13px;
}

.e-band-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(35, 53, 76, 0.8);
  font-size: 11px;
  color: #8fa1b8;
}

.e-band-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.e-band-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}

.metric-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.m-weight {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

.m-sev-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.m-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
  margin-bottom: 6px;
}

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

.m-val {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.m-chg {
  font-size: 13px;
  font-weight: 700;
}

.m-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 8px;
}

.m-sparkline {
  height: 48px;
  width: 100%;
  margin: 4px 0 10px;
  position: relative;
  border-radius: 6px;
  background: rgba(10, 16, 26, 0.45);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.m-sparkline svg {
  display: block;
  width: 100%;
  height: 100%;
}

.m-sparkline-area {
  opacity: 0.22;
}

.m-sparkline-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.m-sparkline-dot {
  stroke-width: 2;
  stroke: #ffffff;
}

.m-sparkline-label {
  position: absolute;
  top: 3px;
  right: 6px;
  font-size: 9.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #64748b;
  pointer-events: none;
}

.m-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #64748b;
  border-top: 1px solid #1e293b;
  padding-top: 8px;
  margin-top: auto;
}

/* ==========================================================================
   공통 및 관리자 콘솔 버튼 가독성 스타일
   ========================================================================== */
button,
input[type="button"],
input[type="submit"],
.button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #f1f5f9;
  padding: 8px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
  line-height: 1.4;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
.button:hover {
  background: #28374d;
  border-color: #475569;
  color: #ffffff;
}

.primary-button {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  border: 1px solid #3b82f6 !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.primary-button:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  border-color: #60a5fa !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

.secondary-button {
  background: rgba(30, 41, 59, 0.85) !important;
  color: #cbd5e1 !important;
  border: 1px solid #334155 !important;
}

.secondary-button:hover {
  background: rgba(51, 65, 85, 0.95) !important;
  border-color: #64748b !important;
  color: #ffffff !important;
}

.small-button {
  font-size: 11.5px !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  background: #1a2738 !important;
  color: #94a3b8 !important;
  border: 1px solid #2d3f55 !important;
  cursor: pointer;
}

.small-button:hover {
  background: #24354c !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

.small-button.danger {
  background: rgba(233, 93, 117, 0.12) !important;
  color: #ff8095 !important;
  border: 1px solid rgba(233, 93, 117, 0.35) !important;
}

.small-button.danger:hover {
  background: rgba(233, 93, 117, 0.25) !important;
  border-color: #ff8095 !important;
  color: #ffffff !important;
}

#schedulerToggle {
  margin-top: 6px;
  background: #22354c !important;
  color: #7ea6ff !important;
  border: 1px solid #3b506e !important;
  font-weight: 700;
}

#schedulerToggle:hover {
  background: #2e4463 !important;
  color: #ffffff !important;
  border-color: #7ea6ff !important;
}

.admin-stat .small-button {
  align-self: flex-start;
}

.panel-header-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.modal-chart-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
  flex: 1;
}

.modal-chart-header-left h3 {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.chart-hover-hud {
  font-size: 12.5px;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(30, 58, 95, 0.4);
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  min-height: 28px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.chart-hover-hud.active {
  background: rgba(30, 58, 95, 0.85);
  border-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.chart-hover-hud strong {
  color: #60a5fa;
  font-weight: 800;
}

.chart-range-select {
  border: 1px solid #334155;
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 8px;
  padding: 6px 30px 6px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease-in-out;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 11px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.chart-range-select:hover {
  background-color: #28374d;
  border-color: #60a5fa;
  color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.chart-range-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.chart-range-select option {
  background: #0f172a;
  color: #f1f5f9;
  font-weight: 600;
  padding: 6px 10px;
}

.chart {
  position: relative !important;
  overflow: visible !important;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(10, 18, 32, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.6);
  border-radius: 8px;
  padding: 9px 13px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65), 0 0 16px rgba(59, 130, 246, 0.2);
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.4;
  z-index: 50;
  opacity: 1 !important;
  visibility: visible !important;
  transition: opacity 0.08s ease;
  transform: translate(-50%, -100%);
  margin-top: -14px;
  white-space: nowrap;
}

.chart-tooltip::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: rgba(59, 130, 246, 0.8) transparent transparent transparent;
  display: block;
  width: 0;
}

.chart-tooltip-date {
  font-size: 11.5px;
  color: #94a3b8;
  margin-bottom: 4px;
  font-weight: 600;
}

.chart-tooltip-val {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-tooltip-phase {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}

.chart-crosshair {
  stroke: #64748b;
  stroke-width: 1.2;
  stroke-dasharray: 3,3;
  pointer-events: none;
}

.chart-dot-pulse {
  fill: #60a5fa;
  stroke: #ffffff;
  stroke-width: 2.5;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.8));
}

/* ==========================================================================
   지표 상세 분석 모달 다이얼로그 스타일
   ========================================================================== */
.metric-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(59, 130, 246, 0.15);
  border-color: #3b82f688;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.modal-overlay[hidden] {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.modal-dialog {
  background: #0d1526;
  border: 1px solid #1e2e4a;
  border-radius: 16px;
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(30, 58, 95, 0.3);
  overflow: hidden;
  animation: modalScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(13, 21, 38, 0.95);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-category-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.modal-header h2 {
  font-size: 19px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
}

.modal-raw-name {
  font-size: 12px;
  color: #64748b;
  font-family: ui-monospace, monospace;
}

.modal-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-close-button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-close-button:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.modal-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.modal-summary-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.m-sum-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.m-sum-val {
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.m-sum-sub {
  font-size: 12px;
  color: #94a3b8;
}

.modal-chart-section {
  background: rgba(10, 16, 28, 0.6);
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 16px 18px;
}

.modal-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: nowrap;
}

.modal-chart-canvas {
  height: 240px;
  width: 100%;
}

.modal-guide-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.modal-guide-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-guide-card.highlight {
  background: rgba(30, 58, 95, 0.25);
  border-color: rgba(59, 130, 246, 0.35);
}

.modal-guide-card h4 {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  margin: 0;
}

.modal-guide-card.highlight h4 {
  color: #60a5fa;
}

.modal-guide-card p {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.55;
  margin: 0;
}

.modal-table-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  margin: 0 0 8px;
}

.modal-table-wrap {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #1e293b;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .modal-summary-grid,
  .modal-guide-section {
    grid-template-columns: 1fr;
  }
}


