:root {
  color-scheme: dark;
  --bg: #0c1220;
  --panel: #141c2e;
  --line: #243049;
  --text: #e8eef8;
  --muted: #b4c0d4;
  --accent: #4c8dff;
  --good: #3dcf8e;
  --warn: #f0b429;
  --bad: #ef4b6a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Malgun Gothic", "Segoe UI", sans-serif;
  line-height: 1.45;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(76, 141, 255, 0.18), transparent 50%),
    var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 220px 1fr;
}
body.public-mode [data-view="settings"],
body.public-mode #view-settings,
body.public-mode #btn-krx-now,
body.public-mode #investor-collect,
body.public-mode #nps-sub-collect,
body.public-mode #nps-collect,
body.public-mode #btn-watch-add,
body.public-mode #us13f-refresh,
body.public-mode #strategy-refresh,
body.public-mode #btn-custom-strategy,
body.public-mode .btn-ai-mini,
body.public-mode .btn-seasonality-ai,
body.public-mode .btn-cal-ai,
body.public-mode [data-ai-trigger],
body.public-mode [data-backtest-stock],
body.public-mode [data-watch-stock],
body.public-mode [data-unwatch],
body.public-mode [data-del-report] {
  display: none !important;
}
.public-readonly-note {
  padding: 10px 12px;
  border: 1px solid rgba(76, 141, 255, 0.35);
  border-radius: 9px;
  background: rgba(76, 141, 255, 0.08);
}
body.public-mode #view-run button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
.nav {
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(10, 14, 24, 0.72);
}
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 28px; }
.mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #6aa4ff, #3558d4);
  font-weight: 800;
}
.brand span { display: block; color: var(--muted); font-size: 12px; }
.nav-group {
  margin: 16px 0 6px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #64748b;
  text-transform: uppercase;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  margin: 0 0 3px;
  background: transparent;
  color: #cbd5e1;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-btn:hover {
  background: rgba(30, 41, 59, 0.7);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}
.nav-btn.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.22) 0%, rgba(30, 41, 59, 0.5) 100%);
  border-color: rgba(59, 130, 246, 0.45);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #3b82f6, 0 2px 8px rgba(0, 0, 0, 0.2);
}
.nav-icon {
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex-shrink: 0;
}
.nav-foot { margin-top: 30px; color: #475569; font-size: 11px; line-height: 1.5; padding: 0 8px; }
main { padding: 22px 28px 40px; overflow: auto; position: relative; }

/* Global Animated Progress Bar */
.global-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa, #34d399, #3b82f6);
  background-size: 200% 100%;
  animation: progressPulse 1.5s linear infinite;
  z-index: 9999;
}
@keyframes progressPulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.backtest-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.72);
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.backtest-overlay.hidden { display: none !important; }
.backtest-overlay-card {
  background: #121b2e;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 16px 50px rgba(0,0,0,.5);
}
.backtest-overlay-card b { display: block; margin: 12px 0 6px; font-size: 16px; color: #e2e8f0; }

.chip.activity-running {
  background: rgba(59, 130, 246, 0.18);
  border-color: #3b82f6;
  color: #60a5fa;
  font-weight: 700;
  cursor: pointer;
  animation: badgeGlow 1.5s ease-in-out infinite alternate;
}
@keyframes badgeGlow {
  from { box-shadow: 0 0 4px rgba(59, 130, 246, 0.3); }
  to { box-shadow: 0 0 12px rgba(59, 130, 246, 0.7); }
}
.chip.activity-idle {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.top-actions button { padding: 8px 14px; }
.top-actions button.primary { background: #2d62d6; border-color: #4c8dff; }
h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.top-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.top-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: -0.01em;
}
.top-mode-badge.quant-active {
  background: rgba(61, 207, 142, 0.16);
  color: #3dcf8e;
  border: 1px solid rgba(61, 207, 142, 0.4);
  box-shadow: 0 0 12px rgba(61, 207, 142, 0.2);
}
.top-mode-badge.research-active {
  background: rgba(76, 141, 255, 0.14);
  color: #70aaff;
  border: 1px solid rgba(76, 141, 255, 0.3);
}
.top-mode-badge.system-active {
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
h2 { margin: 0; font-size: 17px; font-weight: 700; }
#page-sub, .hint { color: var(--muted); }
.hint { font-size: 13px; line-height: 1.5; max-width: 74em; }
.data-asof {
  margin: 6px 0 0;
  font-size: 12px;
  color: #9aabc4;
  letter-spacing: -0.01em;
}
#page-asof { max-width: 52em; cursor: help; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 10px; font-size: 12px; color: var(--muted);
}
.chip.stale { color: var(--warn); border-color: rgba(240, 180, 41, 0.55); }
.chip.fresh { color: var(--good); border-color: rgba(61, 207, 142, 0.4); }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 18px 0 16px; }
.kpi, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.kpi {
  background: linear-gradient(145deg, #111a2e 0%, #0c1424 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.kpi:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.35);
}
.kpi::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  opacity: 0.8;
}
.kpi.clickable-kpi { cursor: pointer; }
.kpi span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.kpi b {
  display: block;
  font-size: 22px;
  font-weight: 800;
  margin-top: 6px;
  color: #fff;
  letter-spacing: -0.02em;
}
.kpi-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

/* Dashboard Champions Showcase */
.dash-champions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 16px;
}
.champ-card {
  background: linear-gradient(145deg, #131d33 0%, #0d1527 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.champ-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}
.champ-card.rank-1 {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.12);
}
.champ-card.rank-1::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
}
.champ-card.rank-2 {
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 4px 20px rgba(148, 163, 184, 0.1);
}
.champ-card.rank-2::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #94a3b8, #cbd5e1, #94a3b8);
}
.champ-card.rank-3 {
  border-color: rgba(180, 83, 9, 0.4);
  box-shadow: 0 4px 20px rgba(180, 83, 9, 0.1);
}
.champ-card.rank-3::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #b45309, #d97706, #b45309);
}
.champ-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.champ-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.champ-card.rank-1 .champ-badge { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.champ-card.rank-2 .champ-badge { background: rgba(148, 163, 184, 0.2); color: #e2e8f0; border: 1px solid rgba(148, 163, 184, 0.3); }
.champ-card.rank-3 .champ-badge { background: rgba(180, 83, 9, 0.2); color: #f59e0b; border: 1px solid rgba(180, 83, 9, 0.3); }
.champ-score {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}
.champ-score small { font-size: 12px; color: #94a3b8; font-weight: 500; }
.champ-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 2px;
}
.champ-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 12px;
}
.champ-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
  text-align: center;
}
.champ-stat-lbl { font-size: 10px; color: #64748b; font-weight: 600; text-transform: uppercase; }
.champ-stat-val { font-size: 13px; font-weight: 700; color: #e2e8f0; margin-top: 2px; }
.champ-factors {
  display: flex;
  gap: 4px;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(30, 41, 59, 0.6);
}
.champ-factor-bar { height: 100%; }
.champ-factor-bar.v { background: #3b82f6; }
.champ-factor-bar.q { background: #8b5cf6; }
.champ-factor-bar.g { background: #10b981; }
.champ-factor-bar.m { background: #f59e0b; }
.champ-factor-bar.f { background: #06b6d4; }

/* Dashboard Factor & Sector DNA */
.dash-dna-box {
  padding: 8px 0;
}
.dna-bar-item {
  margin-bottom: 10px;
}
.dna-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}
.dna-bar-head span { color: #94a3b8; }
.dna-bar-head b { color: #fff; }
.dna-bar-track {
  height: 8px;
  border-radius: 99px;
  background: #1e293b;
  overflow: hidden;
}
.dna-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}
.dna-bar-fill.val { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.dna-bar-fill.qua { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.dna-bar-fill.gro { background: linear-gradient(90deg, #10b981, #34d399); }
.dna-bar-fill.mom { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.dna-bar-fill.fin { background: linear-gradient(90deg, #06b6d4, #22d3ee); }

.card { padding: 16px 18px 18px; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; }
.table-wrap { overflow: auto; max-height: 640px; }
.table-wrap.tall { max-height: 72vh; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #c5d0e2; font-weight: 600; position: sticky; top: 0; background: var(--panel); z-index: 2; }
tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.018); }
tr.clickable { cursor: pointer; }
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.tag.has-tip, th.has-tip, .num.has-tip, span.has-tip { cursor: help; }
.tag.has-tip:hover, th.has-tip:hover { border-color: var(--accent); color: var(--text); }
.nav-btn[data-tip] { cursor: pointer; }
.float-tip {
  position: fixed;
  z-index: 999999 !important;
  max-width: 380px;
  min-width: 240px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(76, 141, 255, 0.4);
  background: rgba(13, 21, 38, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 1px rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  font-size: 12.5px;
  line-height: 1.55;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.float-tip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.float-tip-title {
  font-weight: 700;
  font-size: 13.5px;
  color: #60a5fa;
  margin: 0;
}
.float-tip-body {
  color: #cbd5e1;
  margin: 0 0 6px;
}
.float-tip-impact {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.float-tip-impact .up-impact { color: #f87171; line-height: 1.4; }
.float-tip-impact .down-impact { color: #60a5fa; line-height: 1.4; }
.float-tip-impact .hint-impact { color: #fbbf24; line-height: 1.4; }
.macro-card.has-tip { cursor: help; transition: transform 0.15s ease, border-color 0.15s ease; }
.macro-card.has-tip:hover { transform: translateY(-2px); border-color: #3b82f6; box-shadow: 0 6px 18px rgba(59, 130, 246, 0.18); }
.tag.hot { color: var(--warn); border-color: rgba(240, 180, 41, 0.5); }
.tag.up { color: #ef4b6a; border-color: rgba(239, 75, 106, 0.45); }
.tag.down { color: #4c8dff; border-color: rgba(76, 141, 255, 0.45); }
.chk { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.chk input { width: auto; }
tr.clickable:hover { background: #1b2640; }
.num { font-variant-numeric: tabular-nums; }
.quality p { margin: 8px 0; color: var(--muted); }
.quality h3 { margin: 14px 0 6px; font-size: 13px; }
.quality ul { margin: 0 0 8px; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.quality li { margin: 3px 0; }
.params-ko { display: block; margin-top: 3px; font-size: 12px; color: #94a3b8; }
.strat-note { min-width: 14em; max-width: 28em; white-space: normal; line-height: 1.45; color: #c5d0e2; font-size: 12px; }

/* Strategy Lab Visual Upgrades */
.strat-guide-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 12px 0 16px;
}
.strat-guide-card {
  background: linear-gradient(145deg, #131e36 0%, #0d1527 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.strat-guide-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #3b82f6, #10b981);
}
.strat-guide-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.strat-guide-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

.strat-summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.strat-summary-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 14px;
}
.strat-summary-item span { font-size: 11px; color: #64748b; font-weight: 600; text-transform: uppercase; }
.strat-summary-item b { display: block; font-size: 18px; font-weight: 700; color: #fff; margin-top: 2px; }

.strat-badge-high {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.strat-badge-med {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.strat-badge-low {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.strat-pill-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.strat-glossary-box {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 16px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6;
}
.strat-glossary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.strat-glossary-col b { color: #e2e8f0; display: block; margin-bottom: 2px; }

.row-note {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: #c5d0e2;
  font-weight: 400;
  max-width: 42em;
}
.sector-bars { list-style: none; margin: 8px 0 0; padding: 0; }
.sector-bars li { display: grid; grid-template-columns: 7.5em 1fr 3em; gap: 8px; align-items: center; margin: 5px 0; font-size: 12px; color: var(--muted); }
.sector-bars i { display: block; height: 7px; border-radius: 99px; background: #243049; overflow: hidden; }
.sector-bars i em { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4c8dff, #3dcf8e); }
.ext-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; align-items: center; }
a.ext {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: #cfe0ff; text-decoration: none; font-size: 12px;
  background: #1a2744;
  white-space: nowrap;
  flex: 0 0 auto;
  writing-mode: horizontal-tb;
  line-height: 1.2;
}
a.ext:hover { border-color: var(--accent); }
a.ext.inline { padding: 2px 7px; margin-left: 6px; }
.grok-connect {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #10182a;
}
.grok-connect h3 { margin: 0; }
.grok-auth-box {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #0c1424;
}
.grok-auth-box p { margin: 6px 0; color: var(--muted); font-size: 13px; }
.grok-code {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 28px;
  letter-spacing: 0.12em;
  color: var(--text);
  margin: 8px 0 0;
}
.hidden { display: none; }
button, input, select {
  font: inherit; color: var(--text);
}
button {
  background: #223154; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; cursor: pointer;
}
button.primary { background: #2d62d6; border-color: #4c8dff; }
button.danger { background: #6b2234; border-color: #ef4b6a; }
button.ghost { background: transparent; }
label { display: block; margin: 10px 0; color: var(--muted); font-size: 13px; }
select,
input {
  width: 100%; margin-top: 6px; padding: 9px 10px;
  color: var(--text);
  background: #0f1626;
  border: 1px solid var(--line);
  border-radius: 10px;
  color-scheme: dark;
}
select option,
select optgroup {
  color: #e8eef8;
  background-color: #0f1626;
}
select option:checked,
select option:hover {
  color: #ffffff;
  background-color: #2d62d6;
}
select:focus,
input:focus {
  outline: 1px solid var(--accent);
  color: var(--text);
}
.sel-wrap { position: relative; margin-top: 6px; }
select.sr-only-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.sel-btn {
  width: 100%;
  text-align: left;
  color: #e8eef8 !important;
  background: #0f1626;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
}
.sel-menu {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #121a2d;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 260px;
  overflow: auto;
  padding: 4px;
  box-shadow: var(--shadow);
}
.sel-item {
  display: block;
  width: 100%;
  text-align: left;
  color: #e8eef8 !important;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
}
.sel-item:hover,
.sel-item.on {
  background: #2d62d6;
  color: #ffffff !important;
}
.llm-connections {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10182a;
}
.llm-connections p { margin: 0 0 8px; color: var(--muted); }
.llm-connections b { color: var(--text); }
.llm-connections ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.llm-connections li { margin: 4px 0; }
.llm-connections .on { color: var(--text); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.log {
  height: 320px; overflow: auto; background: #0b101c;
  border-radius: 10px; padding: 12px; color: #b7c4dd; font-size: 12px;
}
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.meta { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); float: none; }
.ok { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.drawer-back {
  position: fixed; inset: 0;
  background: rgba(6, 10, 18, 0.72);
  z-index: 18;
}
.drawer {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1180px, 96vw);
  height: min(92vh, 980px);
  background: #121a2d;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 19;
  display: flex;
  flex-direction: column;
}
.drawer.hidden,
.drawer-back.hidden {
  display: none;
}
.drawer .card-h { padding: 14px 18px 10px; border-bottom: 1px solid var(--line); margin: 0; }
#drawer-body { flex: 1; overflow: auto; padding: 14px 22px 28px; }

/* Drawer Skeleton & Loading Spinner */
.drawer-loading-skeleton {
  padding: 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.skeleton-spinner-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 14px;
  padding: 18px 22px;
}
.skeleton-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.skeleton-loading-text b {
  display: block;
  font-size: 15px;
  color: #fff;
  margin-bottom: 4px;
}
.skeleton-loading-text p {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
}
.skeleton-shimmer-card {
  height: 90px;
  border-radius: 12px;
  background: linear-gradient(90deg, #111a2e 25%, #1e293b 50%, #111a2e 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.stock-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  align-items: start;
}
.tf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.tf-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #0e1626;
}
.tf-card span { display: block; color: var(--muted); font-size: 12px; }
.tf-card b { display: block; margin: 4px 0; font-size: 16px; }
.tf-card.UP b { color: var(--bad); }
.tf-card.DOWN b { color: #4c8dff; }
.conf-meter { height: 8px; background: #223049; border-radius: 99px; overflow: hidden; margin: 6px 0 10px; }
.conf-meter i { display: block; height: 100%; background: linear-gradient(90deg, #f0b429, #3dcf8e); }
#drawer-close { padding: 10px 16px; font-size: 14px; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text); }
th.sortable.asc, th.sortable.desc { color: var(--accent); }
th.sortable::after { content: " ↕"; font-size: 10px; color: var(--muted); }
th.sortable.asc::after { content: " ▲"; color: var(--accent); }
th.sortable.desc::after { content: " ▼"; color: var(--accent); }
@media (max-width: 900px) {
  .stock-grid, .tf-grid { grid-template-columns: 1fr; }
}
.bars { display: grid; gap: 8px; margin-top: 12px; }
.bar { height: 8px; background: #223049; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #4c8dff, #3dcf8e); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; font-size: 13px; margin-top: 12px; }
.kv span { color: var(--muted); }
.intro {
  margin: 0 0 12px;
  padding: 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10182a;
}
.intro h3 { margin: 0 0 8px; font-size: 15px; }
.intro p { margin: 6px 0; color: #d5deee; font-size: 13px; line-height: 1.5; }
.news-list { margin: 6px 0 0; padding-left: 18px; }
.news-list li { margin: 8px 0; color: #d5deee; font-size: 13px; line-height: 1.4; }
.hq-map { width: 100%; max-width: 560px; border-radius: 10px; border: 1px solid var(--line); }
#research-box, #report-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.report { font-size: 13px; line-height: 1.55; color: var(--text); }
.report h3 { margin: 16px 0 8px; font-size: 16px; }
.report h4 { margin: 12px 0 6px; font-size: 14px; }
.report p { margin: 6px 0; color: #d5deee; }
.report li { margin: 3px 0 3px 16px; color: #d5deee; }
.report table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 12px; }
.report th, .report td { border-bottom: 1px solid var(--line); padding: 5px 4px; text-align: left; vertical-align: top; }
.report th { color: var(--muted); }
body.modal-open { overflow: hidden; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(6, 10, 18, 0.72);
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal.hidden { display: none; }
.modal-panel {
  width: min(1100px, 96vw);
  height: min(92vh, 980px);
  background: #121a2d;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-panel .card-h { padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.modal-body {
  flex: 1;
  overflow: auto;
  padding: 8px 28px 32px;
}
.modal-body .report { max-width: 860px; margin: 0 auto; font-size: 15px; line-height: 1.65; }
.modal-body .report h3 { font-size: 20px; }
.modal-body .report h4 { font-size: 16px; }
.modal-body .report table { font-size: 13px; }
.fg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 16px; }
.fg-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px 16px;
  background: #10182a;
}
.fg-card h3 { margin: 0 0 4px; font-size: 15px; }
.fg-score { font-size: 42px; font-weight: 800; letter-spacing: -0.03em; }
.fg-label { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.fg-meter { width: 100%; max-width: 280px; margin: 0 auto; display: block; }
.fg-bars { margin: 8px 0 0; padding: 0; list-style: none; }
.fg-bars li { display: grid; grid-template-columns: 1.2fr 3fr auto; gap: 8px; align-items: center; margin: 5px 0; font-size: 12px; color: var(--muted); }
.fg-bars i { display: block; height: 7px; border-radius: 99px; background: #243049; overflow: hidden; }
.fg-bars i em { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ef4b6a, #f0b429, #3dcf8e); }
.fg-spark { display: flex; gap: 2px; align-items: flex-end; height: 42px; margin-top: 10px; }
.h-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}
.h-tabs button {
  border: 1px solid var(--line);
  background: #10182a;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
}
.h-tabs button.on, .h-tabs button:hover {
  border-color: #4c8dff;
  color: var(--text);
  background: #1a2540;
}
.more-line { margin: 10px 0 0; }
.five-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 10px 0 14px;
}
.five-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #10182a;
}
.five-card span { display: block; color: var(--muted); font-size: 12px; }
.five-card b { display: block; margin: 4px 0 2px; font-size: 18px; }
.five-card p { margin: 0; font-size: 12px; color: #c5d0e4; }
.five-card.pass b { color: var(--good); }
.five-card.fail b { color: var(--warn); }
.five-card.posture-engage b { color: #34d399; }
.five-card.posture-wait b { color: #fbbf24; }
.five-card.posture-observe b { color: #38bdf8; }
.five-card.posture-retreat b { color: #fb7185; }
.five-card.posture-avoid b { color: #f87171; }
.posture-chip {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}
.posture-chip.posture-engage { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.posture-chip.posture-wait { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
.posture-chip.posture-observe { background: rgba(56, 189, 248, 0.18); color: #38bdf8; }
.posture-chip.posture-retreat { background: rgba(244, 63, 94, 0.18); color: #fb7185; }
.posture-chip.posture-avoid { background: rgba(239, 68, 68, 0.22); color: #fca5a5; }
.sunzi-concept {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 14px;
}
.sunzi-concept > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #10182a;
}
.sunzi-concept p { margin: 6px 0 0; color: #c5d0e4; font-size: 13px; line-height: 1.45; }
.sunzi-concept-k {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #fbbf24;
}
.sunzi-concept-k.yang { color: #67e8f9; }
.sunzi-aspect-grid { margin-top: 0; }
.sunzi-aspect .sunzi-q {
  color: #94a3b8;
  font-size: 11.5px;
  margin: 4px 0 6px;
  line-height: 1.4;
}
.yang-voice {
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
}
.yang-brief {
  border: 1px solid rgba(103, 232, 249, 0.28);
  background: linear-gradient(180deg, rgba(8, 47, 73, 0.45), #10182a);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 14px;
}
.yang-brief h3 { margin: 0 0 8px; font-size: 15px; }
.yang-brief .sunzi-q { margin: 0 0 8px; }
.sunzi-posture-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 0 0 14px;
}
.yang-line {
  font-size: 12.5px;
  color: #cbd5e1;
  max-width: 420px;
  line-height: 1.5;
}
.yang-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 420px at 8% -10%, rgba(234, 179, 8, 0.10), transparent 55%),
    radial-gradient(900px 380px at 100% 0%, rgba(56, 189, 248, 0.14), transparent 50%),
    #0b1220;
}
.yang-lede {
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.55;
}
.yang-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
}
.yang-search { flex: 1; min-width: 240px; }
.yang-search input {
  width: 100%;
  background: #0f172a;
  color: #fff;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 10px;
  padding: 8px 12px;
}
.yang-toolbar select {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
}
.yang-seg { display: flex; gap: 4px; }
.yang-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.yang-portrait {
  border-radius: 18px;
  padding: 18px 16px;
  text-align: center;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.2), rgba(8, 47, 73, 0.55));
  border: 1px solid rgba(103, 232, 249, 0.28);
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.yang-avatar {
  width: 84px;
  height: 84px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 40px;
  background: radial-gradient(circle at 30% 20%, #67e8f9, #164e63 70%);
  box-shadow: 0 0 24px rgba(103, 232, 249, 0.35);
}
.yang-portrait b { display: block; color: #fff; font-size: 16px; }
.yang-portrait span { display: block; margin-top: 6px; color: #94a3b8; font-size: 12px; line-height: 1.4; }
.yang-staff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.yang-staff-card {
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.65), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.yang-staff-card:hover {
  transform: translateY(-2px);
  border-color: rgba(103, 232, 249, 0.55);
  box-shadow: 0 10px 28px rgba(56, 189, 248, 0.12);
}
.yang-staff-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.yang-mini-bars { display: flex; gap: 5px; margin: 10px 0 8px; }
.yang-mini-col { flex: 1; text-align: center; }
.yang-mini-col i {
  display: block;
  height: 36px;
  border-radius: 6px 6px 2px 2px;
  background: #1e293b;
  position: relative;
  overflow: hidden;
}
.yang-mini-col i em {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #67e8f9, #38bdf8);
}
.yang-mini-col span { font-size: 10px; color: #64748b; }
.sunzi-aspect {
  min-height: 168px;
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.08), rgba(15, 23, 42, 0.9));
  border-color: rgba(234, 179, 8, 0.22);
}
@media (max-width: 1100px) {
  .yang-hero, .yang-staff-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .five-grid { grid-template-columns: 1fr 1fr; }
  .sunzi-concept, .sunzi-posture-row { grid-template-columns: 1fr; }
}
.rank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rank-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px 12px;
  background: #10182a;
}
.rank-card h3 { margin: 0 0 8px; font-size: 14px; }
.rank-table { font-size: 13px; }
.rank-table td b { display: block; }
.rank-table .meta { float: none; color: var(--muted); font-size: 11px; }
.up { color: var(--bad); }
.down { color: var(--accent); }
.fg-spark b { flex: 1; border-radius: 2px 2px 0 0; min-height: 2px; background: #3558d4; }
.fg-spark b.up { background: var(--bad); }
.fg-spark b.down { background: var(--accent); }
.fresh-banner {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
}
.fresh-banner.stale {
  color: var(--warn);
  border-color: rgba(240, 180, 41, 0.5);
  background: rgba(240, 180, 41, 0.08);
}
.fresh-banner { display: none; }
.fresh-banner.ok { display: none; }
.score { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.factors {
  display: grid;
  gap: 4px;
  min-width: 12.8em;
}
.factors span { display: block; }
.factors i {
  position: relative;
  display: block;
  height: 18px;
  background: #223049;
  border-radius: 6px;
  overflow: hidden;
}
.factors b {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: #4c8dff;
}
.factors em {
  position: absolute;
  inset: 0 8px;
  display: flex;
  align-items: center;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: #f4f7fb;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  z-index: 1;
  pointer-events: none;
}
.factors span:nth-child(2) b { background: #5b8def; }
.factors span:nth-child(3) b { background: #3dcf8e; }
.factors span:nth-child(4) b { background: #f0b429; }
.factors span:nth-child(5) b { background: #8b9cb8; }
.quality .kpis { margin: 4px 0 12px; }
.quality .kpi { padding: 10px 12px; box-shadow: none; }
.quality .kpi b { font-size: 20px; }
.chip.ok { color: var(--good); border-color: rgba(61, 207, 142, 0.45); }
.name-cell b { display: block; }
.macro-row {
  display: grid;
  grid-template-columns: 8em 1fr auto;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
  font-size: 13px;
}
.macro-row i { display: block; height: 8px; background: #223049; border-radius: 99px; overflow: hidden; }
.macro-row em { display: block; height: 100%; border-radius: 99px; }
.macro-row em.up { background: #ef4b6a; }
.macro-row em.down { background: #4c8dff; }
.brief-head {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 8px 0 16px;
}
.tone-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #10182a;
}
.tone-card span { display: block; font-size: 12px; color: var(--muted); }
.tone-card b { display: block; margin: 4px 0 6px; font-size: 20px; }
.tone-card p { margin: 0; color: #c5d0e2; font-size: 12px; line-height: 1.45; }
.tone-card.우호 b, .tag.tone-우호 { color: var(--good); }
.tone-card.부담 b, .tag.tone-부담 { color: var(--bad); }
.tone-card.혼합 b, .tag.tone-혼합 { color: var(--warn); }
.tone-card.중립 b, .tag.tone-중립 { color: var(--muted); }
.tone-card.우호 { border-color: rgba(61, 207, 142, 0.4); }
.tone-card.부담 { border-color: rgba(239, 75, 106, 0.4); }
.tone-card.혼합 { border-color: rgba(240, 180, 41, 0.4); }
.macro-bi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}
.macro-item-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 8px;
}
.macro-item-card {
  background: #10182a;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}
.macro-item-card:hover {
  border-color: rgba(76, 141, 255, 0.4);
  background: #141e34;
}
.macro-item-card.tone-우호 {
  border-left: 4px solid var(--good);
}
.macro-item-card.tone-부담 {
  border-left: 4px solid var(--bad);
}
.macro-item-card.tone-중립, .macro-item-card.tone-미연결 {
  border-left: 4px solid var(--muted);
}
.macro-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.macro-item-label {
  font-weight: 700;
  font-size: 14px;
  color: #e8eef8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.macro-item-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.macro-item-val {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.macro-item-val small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}
.macro-item-delta {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.macro-item-delta.up { color: #ef4b6a; background: rgba(239, 75, 106, 0.12); }
.macro-item-delta.down { color: #4c8dff; background: rgba(76, 141, 255, 0.12); }
.macro-item-desc {
  font-size: 12px;
  line-height: 1.45;
  color: #b0c0d8;
  margin: 0;
}
.yield-compare-card {
  background: linear-gradient(145deg, #131c30, #0c1220);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 14px 0;
}
.yield-compare-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 10px;
}
.yield-compare-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 10px 12px;
}
.yield-compare-box span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.yield-compare-box b {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.news-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.news-group h3 { margin: 0 0 6px; font-size: 13px; }
.news-list { margin: 0; padding-left: 18px; }
.news-list li { margin: 6px 0; }
.clickable-chip, .clickable-kpi { cursor: pointer; }
.chip.clickable-chip { border-color: rgba(240, 180, 41, 0.55); }
@media (max-width: 1100px) {
  .brief-head, .macro-bi-grid, .yield-compare-grid, .news-groups { grid-template-columns: 1fr; }
}
.kpi span.has-tip { cursor: help; }
.screen-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.screen-list { display: flex; flex-direction: column; gap: 4px; }
.screen-list button {
  width: 100%;
  text-align: left;
  background: #10182a;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
}
.screen-list button.on { border-color: #4c8dff; background: #1a2540; }
.screen-list .pop {
  margin-left: 6px;
  font-size: 11px;
  color: var(--accent);
}
.sector-score { font-size: 18px; font-weight: 700; }

/* --- Modern High-Visibility Visual Polish --- */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.rank-badge.top-1 {
  background: linear-gradient(135deg, #ffd700, #ff9800);
  color: #1a1000;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}
.rank-badge.top-2 {
  background: linear-gradient(135deg, #e0e0e0, #9e9e9e);
  color: #111;
  box-shadow: 0 0 8px rgba(224, 224, 224, 0.3);
}
.rank-badge.top-3 {
  background: linear-gradient(135deg, #cd7f32, #8d5524);
  color: #fff;
  box-shadow: 0 0 8px rgba(205, 127, 50, 0.3);
}

.score-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  background: rgba(76, 141, 255, 0.14);
  color: #70aaff;
  border: 1px solid rgba(76, 141, 255, 0.28);
}
.score-pill.high {
  background: rgba(61, 207, 142, 0.14);
  color: #3dcf8e;
  border-color: rgba(61, 207, 142, 0.3);
}

.factor-mini-bars {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
  align-items: center;
}
.factor-bar-item {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
}
.factor-bar-v { background: #0284c7; } /* 가치 Cyan/Blue */
.factor-bar-q { background: #059669; } /* 품질 Emerald */
.factor-bar-g { background: #7c3aed; } /* 성장 Violet */
.factor-bar-m { background: #d97706; } /* 모멘텀 Amber */
.factor-bar-s { background: #2563eb; } /* 안정 Royal */

.sentiment-box {
  background: linear-gradient(145deg, #131c30, #0d1424);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin: 12px 0;
}
.sentiment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.sentiment-score-badge {
  font-size: 28px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 10px;
}
.sentiment-score-badge.EXTREME_GREED { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid #10b981; }
.sentiment-score-badge.GREED { background: rgba(52, 211, 153, 0.15); color: #34d399; border: 1px solid #34d399; }
.sentiment-score-badge.NEUTRAL { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid #fbbf24; }
.sentiment-score-badge.FEAR { background: rgba(248, 113, 113, 0.15); color: #f87171; border: 1px solid #f87171; }
.sentiment-score-badge.EXTREME_FEAR { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid #ef4444; }

.sentiment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.sentiment-item {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px;
}
.sentiment-item span { font-size: 11px; color: var(--muted); display: block; }
.sentiment-item b { font-size: 16px; margin-top: 4px; display: block; }

.sector-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #111a2d;
  margin-bottom: 10px;
}
.sector-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.sector-badge.LEADING { background: rgba(16, 185, 129, 0.18); color: #10b981; border: 1px solid #10b981; }
.sector-badge.IMPROVING { background: rgba(56, 189, 248, 0.18); color: #38bdf8; border: 1px solid #38bdf8; }
.sector-badge.NEUTRAL { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid #94a3b8; }
.sector-badge.WEAKENING { background: rgba(251, 146, 60, 0.18); color: #fb923c; border: 1px solid #fb923c; }
.sector-badge.LAGGING { background: rgba(244, 63, 94, 0.18); color: #f43f5e; border: 1px solid #f43f5e; }

.win-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.win-badge.high { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.win-badge.mid { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.win-badge.low { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* --- TradingEconomics Style Macro Asset & Chart Cards --- */
.macro-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin: 12px 0 20px;
}
.macro-card {
  background: #111a2d;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.macro-card:hover {
  transform: translateY(-2px);
  border-color: #3b5cb8;
}
.macro-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.macro-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.macro-card-sym {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.macro-card-price {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.macro-card-chg {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
  display: inline-block;
  text-align: right;
}
.macro-card-chg.up { background: rgba(239, 75, 106, 0.18); color: #ef4b6a; }
.macro-card-chg.down { background: rgba(76, 141, 255, 0.18); color: #4c8dff; }
.macro-card-svg {
  width: 100%;
  height: 48px;
  margin: 8px 0;
  overflow: visible;
}
.macro-card-comment {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 6px;
}

/* --- Yen Carry Trade Risk Monitor Card --- */
.yencarry-card {
  background: linear-gradient(145deg, #18233c, #10172a);
  border: 1px solid #3558d4;
  border-radius: 14px;
  padding: 16px 20px;
  margin: 14px 0 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.yencarry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.yencarry-badge {
  font-size: 14px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 8px;
}
.yencarry-badge.UNWIND_RISK { background: rgba(239, 68, 68, 0.25); color: #f87171; border: 1px solid #ef4444; }
.yencarry-badge.WATCH { background: rgba(251, 191, 36, 0.2); color: #fbbf24; border: 1px solid #fbbf24; }
.yencarry-badge.STABLE { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #10b981; }
.yencarry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 10px 0;
}
.yencarry-metric {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px;
}
.yencarry-metric span { font-size: 11px; color: var(--muted); display: block; }
.yencarry-metric b { font-size: 16px; margin-top: 4px; display: block; }

/* --- Seeking Alpha Style Factor Scorecard --- */
.sa-scorecard {
  background: #111a2d;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin: 14px 0;
}
.sa-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.sa-decision {
  font-size: 14px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 8px;
}
.sa-decision.STRONG_BUY { background: rgba(16, 185, 129, 0.25); color: #10b981; border: 1px solid #10b981; }
.sa-decision.BUY { background: rgba(52, 211, 153, 0.2); color: #34d399; border: 1px solid #34d399; }
.sa-decision.HOLD { background: rgba(251, 191, 36, 0.2); color: #fbbf24; border: 1px solid #fbbf24; }
.sa-decision.SELL { background: rgba(251, 146, 60, 0.2); color: #fb923c; border: 1px solid #fb923c; }
.sa-decision.STRONG_SELL { background: rgba(239, 68, 68, 0.25); color: #ef4444; border: 1px solid #ef4444; }

.sa-factor-row {
  display: grid;
  grid-template-columns: 140px 48px 1fr 140px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.sa-factor-name { font-size: 13px; font-weight: 600; color: var(--text); }
.sa-grade-pill {
  width: 36px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  border-radius: 6px;
}
.sa-grade-pill.A_PLUS, .sa-grade-pill.A, .sa-grade-pill.A_MINUS { background: #065f46; color: #34d399; border: 1px solid #10b981; }
.sa-grade-pill.B_PLUS, .sa-grade-pill.B, .sa-grade-pill.B_MINUS { background: #164e63; color: #38bdf8; border: 1px solid #0284c7; }
.sa-grade-pill.C_PLUS, .sa-grade-pill.C, .sa-grade-pill.C_MINUS { background: #713f12; color: #fde047; border: 1px solid #eab308; }
.sa-grade-pill.D { background: #7c2d12; color: #fdba74; border: 1px solid #f97316; }
.sa-grade-pill.F { background: #881337; color: #fda4af; border: 1px solid #f43f5e; }

.sa-meter {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
}
.sa-meter em {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #38bdf8, #10b981);
}
.sa-submetrics {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

@media (max-width: 1100px) {
  .screen-layout { grid-template-columns: 1fr; }
  body { grid-template-columns: 1fr; }
  .nav { display: flex; gap: 8px; overflow: auto; align-items: center; }
  .nav-foot, .brand span { display: none; }
  .kpis, .grid-2, .settings-grid, .row, .fg-grid, .rank-grid, .macro-card-grid { grid-template-columns: 1fr; }
  .sa-factor-row { grid-template-columns: 100px 40px 1fr; }
  .sa-submetrics { display: none; }
}

/* Toast Notification System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast-msg {
  pointer-events: auto;
  min-width: 280px;
  max-width: 440px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease forwards;
  transition: all 0.3s ease;
}
.toast-msg.toast-info {
  background: rgba(16, 28, 54, 0.95);
  border: 1px solid rgba(76, 141, 255, 0.4);
  color: #c8dcff;
}
.toast-msg.toast-success {
  background: rgba(12, 38, 28, 0.95);
  border: 1px solid rgba(61, 207, 142, 0.5);
  color: #a7f3d0;
}
.toast-msg.toast-warn {
  background: rgba(45, 34, 12, 0.95);
  border: 1px solid rgba(240, 180, 41, 0.5);
  color: #fde68a;
}
.toast-msg.toast-error {
  background: rgba(45, 14, 20, 0.95);
  border: 1px solid rgba(239, 75, 106, 0.5);
  color: #fecdd3;
}
.toast-msg.fade-out {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* === Subtabs Navigation === */
.subtabs-bar {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.subtab-btn {
  background: rgba(16, 28, 54, 0.6);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.subtab-btn:hover {
  background: #1b2945;
  color: #fff;
  border-color: #3b5074;
}
.subtab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(76, 141, 255, 0.3);
}

/* === Seasonality Visual Heatmap === */
.seasonality-wrapper {
  background: transparent;
  padding: 2px 0 0;
  margin: 0;
}
.season-diag-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(16, 28, 54, 0.6);
  border: 1px solid rgba(76, 141, 255, 0.25);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.season-diag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.season-diag-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.season-diag-badge.good { background: rgba(61, 207, 142, 0.18); color: #3dcf8e; border: 1px solid rgba(61, 207, 142, 0.4); }
.season-diag-badge.bad { background: rgba(239, 75, 106, 0.18); color: #ef4b6a; border: 1px solid rgba(239, 75, 106, 0.4); }
.season-diag-badge.neutral { background: rgba(240, 180, 41, 0.18); color: #f0b429; border: 1px solid rgba(240, 180, 41, 0.4); }
.season-diag-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
  padding: 12px 14px;
}
.season-election-box {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-left: 4px solid #eab308;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: #fef08a;
}
.season-election-title {
  font-weight: 700;
  color: #fde047;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.season-diag-cycle { font-size: 12px; color: var(--muted); text-align: right; }

.seasonality-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
}
@media (max-width: 1100px) {
  .seasonality-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 600px) {
  .seasonality-grid { grid-template-columns: repeat(3, 1fr); }
}
.season-card {
  background: rgba(13, 21, 38, 0.85);
  border: 1px solid rgba(40, 60, 95, 0.6);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
}
.season-card:hover {
  transform: translateY(-2px);
  border-color: #4c8dff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.season-card.current-month {
  border: 2px solid #4c8dff;
  background: linear-gradient(180deg, rgba(76, 141, 255, 0.15) 0%, rgba(13, 21, 38, 0.95) 100%);
  box-shadow: 0 0 16px rgba(76, 141, 255, 0.35);
}
.season-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}
.season-cur-tag {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 4px;
  background: #4c8dff;
  color: #fff;
}
.season-ret {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.season-ret.up { color: #ef4b6a; }
.season-ret.down { color: #4c8dff; }
.season-win-bar {
  height: 4px;
  background: #1b263b;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 4px;
}
.season-win-fill {
  height: 100%;
  border-radius: 99px;
  background: #3dcf8e;
}
.season-win-fill.low { background: #ef4b6a; }
.season-win-fill.mid { background: #f0b429; }
.season-win-txt {
  font-size: 10px;
  color: var(--muted);
}

/* === Sector Analysis Visual Leaderboard === */
.sector-leader-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 12px 0 18px;
}
@media (max-width: 900px) {
  .sector-leader-grid { grid-template-columns: 1fr; }
}
.sector-leader-card {
  background: #101a2e;
  border: 1px solid #233454;
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.2s ease;
}
.sector-leader-card:hover {
  border-color: #3b5a8e;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.sector-leader-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.sector-leader-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.sector-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #223555;
  color: #c8dcff;
  font-size: 11px;
  font-weight: 800;
}
.sector-rank-badge.top { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.sector-bar-track {
  height: 8px;
  background: #1b263b;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}
.sector-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #4c8dff, #3dcf8e);
}
.sector-bar-fill.leading { background: linear-gradient(90deg, #10b981, #34d399); }
.sector-bar-fill.improving { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.sector-bar-fill.neutral { background: linear-gradient(90deg, #64748b, #94a3b8); }
.sector-bar-fill.lagging { background: linear-gradient(90deg, #ef4444, #f87171); }

.sector-gauges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(13, 21, 38, 0.7);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.sector-gauge-item {
  font-size: 11px;
}
.sector-gauge-item span { color: var(--muted); display: block; }
.sector-gauge-item b { font-size: 12px; color: #e2e8f0; }
.sector-stock-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.sector-stock-pill {
  font-size: 11px;
  background: #1b2945;
  border: 1px solid #2d4168;
  color: #c0d4f5;
  padding: 2px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sector-stock-pill:hover {
  background: #253b66;
  border-color: #4c8dff;
  color: #fff;
}

/* Sector 4-Quadrant Phase Matrix */
.sector-phase-matrix {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 12px 0 20px;
}
@media (max-width: 900px) {
  .sector-phase-matrix { grid-template-columns: repeat(2, 1fr); }
}
.sector-phase-box {
  background: #0f172a;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  min-height: 110px;
}
.sector-phase-box.leading { border-top: 3px solid #10b981; background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, #0f172a 100%); }
.sector-phase-box.improving { border-top: 3px solid #3b82f6; background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, #0f172a 100%); }
.sector-phase-box.weakening { border-top: 3px solid #f59e0b; background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, #0f172a 100%); }
.sector-phase-box.lagging { border-top: 3px solid #ef4444; background: linear-gradient(180deg, rgba(239, 68, 68, 0.08) 0%, #0f172a 100%); }

.sector-phase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
}
.sector-phase-box.leading .sector-phase-header { color: #34d399; }
.sector-phase-box.improving .sector-phase-header { color: #60a5fa; }
.sector-phase-box.weakening .sector-phase-header { color: #fbbf24; }
.sector-phase-box.lagging .sector-phase-header { color: #f87171; }

.sector-phase-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sector-phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sector-phase-chip:hover {
  background: #1e293b;
  border-color: #3b82f6;
  transform: translateY(-1px);
}
.season-diag-cycle {
  font-size: 12px;
}

/* Seasonality Playbook Styles */
.season-playbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 4px 0;
}
@media (max-width: 900px) {
  .season-playbook-grid { grid-template-columns: 1fr; }
}
.season-playbook-box {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px 12px;
}
.season-playbook-title {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  display: block;
}
.season-sector-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.season-chip {
  font-size: 11px;
  border-radius: 6px;
  padding: 3px 8px;
  font-weight: 600;
}
.season-chip.lead {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.season-chip.lag {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Full Sector RS Comparison Bar Chart */
.sector-rs-chart-wrap {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 20px;
}
.sector-rs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
}
@media (max-width: 800px) {
  .sector-rs-grid { grid-template-columns: 1fr; }
}
.sector-rs-row {
  display: grid;
  grid-template-columns: 110px 1fr 42px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.sector-rs-name {
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.sector-rs-bar-bg {
  height: 8px;
  background: #1e293b;
  border-radius: 99px;
  overflow: hidden;
}
.sector-rs-bar-fill {
  height: 100%;
  border-radius: 99px;
}
.sector-rs-val {
  font-weight: 700;
  text-align: right;
  font-size: 12px;
}

/* === US 13F Superinvestor Visual Cards === */
.us13f-filer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 14px 0 20px;
}
@media (max-width: 900px) {
  .us13f-filer-grid { grid-template-columns: 1fr; }
}
.us13f-filer-card {
  background: linear-gradient(180deg, #10192e 0%, #0c1424 100%);
  border: 1px solid #233454;
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.2s ease;
}
.us13f-filer-card:hover {
  border-color: #3b5074;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.us13f-filer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.us13f-filer-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.us13f-filer-meta { font-size: 11px; color: var(--muted); }
.us13f-stack-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: #1b263b;
  margin: 8px 0 12px;
}
.us13f-stack-slice {
  height: 100%;
  transition: opacity 0.2s;
}
.us13f-stack-slice:hover { opacity: 0.85; }
.us13f-top-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.us13f-top-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #162238;
  border: 1px solid #283a5c;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
}
.us13f-top-chip b { color: #fff; }
.us13f-top-chip span { color: #60a5fa; font-weight: 600; }

.us13f-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 16px;
}
@media (max-width: 900px) {
  .us13f-action-grid { grid-template-columns: 1fr; }
}
.us13f-action-card {
  background: #10182a;
  border: 1px solid #22324e;
  border-radius: 10px;
  padding: 12px 14px;
  transition: all 0.2s ease;
}
.us13f-action-card.new { border-left: 4px solid #3dcf8e; }
.us13f-action-card.exit { border-left: 4px solid #ef4b6a; }
.us13f-action-card.increase { border-left: 4px solid #4c8dff; }
.us13f-action-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.us13f-action-title { font-size: 13px; font-weight: 700; color: #fff; }
.us13f-action-meta { font-size: 11px; color: var(--muted); }

/* Consensus Cards */
.us13f-consensus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 12px 0 18px;
}
@media (max-width: 900px) {
  .us13f-consensus-grid { grid-template-columns: 1fr; }
}
.us13f-consensus-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 14px;
  border-top: 3px solid #f59e0b;
  transition: all 0.2s ease;
}
.us13f-consensus-card:hover {
  border-color: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.15);
}
.us13f-consensus-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.us13f-consensus-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.us13f-consensus-funds {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.us13f-fund-chip {
  font-size: 11px;
  background: #1e293b;
  color: #cbd5e1;
  padding: 2px 6px;
  border-radius: 4px;
}

/* API Key Show/Hide Password Fields */
.key-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.key-field-wrap input {
  width: 100%;
  padding-right: 42px !important;
  font-family: inherit;
}
.btn-toggle-pw {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 7px;
  font-size: 13px;
  border-radius: 6px;
  transition: all 0.15s ease;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.btn-toggle-pw:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}
.btn-toggle-pw.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}



/* News Sentiment Badges */
.news-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 1.4;
}
.news-badge-bull {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}
.news-badge-bear {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.news-badge-neutral {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}


/* Stock Drawer Visual Hexagon Radar & Gauges */
.stock-radar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 12px 10px;
  background: linear-gradient(145deg, #0e172a, #0b1322);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  margin-bottom: 12px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.stock-radar-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.stock-radar-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stock-radar-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
}
.stock-radar-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #94a3b8;
}
.stock-radar-legend .dot-firm {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}
.stock-radar-legend .dot-market {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.radar-svg-wrap {
  width: 100%;
  max-width: 320px;
  height: 250px;
  margin: 4px 0;
}
.radar-svg-wrap text {
  font-family: inherit;
  user-select: none;
}

/* Range & Bollinger Band Visual Meter */
.visual-meter-box {
  background: #0e1626;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.visual-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
}
.range-bar-track {
  height: 10px;
  border-radius: 99px;
  background: #1e293b;
  position: relative;
  margin: 12px 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.range-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #3b82f6, #38bdf8);
}
.range-bar-pin {
  position: absolute;
  top: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #38bdf8;
  border: 3px solid #0f172a;
  box-shadow: 0 0 10px #38bdf8;
  transform: translateX(-50%);
  cursor: help;
  transition: left 0.3s ease;
}
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Bollinger Band Multi-zone Gauge */
.bb-gauge-track {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  margin: 10px 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.bb-zone {
  height: 100%;
  flex: 1;
}
.bb-zone.oversold { background: #3b82f6; opacity: 0.7; }
.bb-zone.neutral { background: #334155; opacity: 0.8; flex: 2; }
.bb-zone.overbought { background: #ef4444; opacity: 0.7; }
.bb-pin {
  position: absolute;
  top: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #facc15;
  border: 3px solid #0f172a;
  box-shadow: 0 0 10px #facc15;
  transform: translateX(-50%);
  cursor: help;
}

/* Stochastic & Technical Dial Pills */
.stoch-pill-deck {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.stoch-pill {
  background: #111a2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
}
.stoch-pill span { display: block; font-size: 11px; color: #94a3b8; }
.stoch-pill b { display: block; font-size: 13.5px; margin-top: 2px; color: #f1f5f9; }


/* Margin Debt Barometer (신용융자 잔고 & 레버리지 진단) */
.margin-barometer-card {
  background: linear-gradient(145deg, #0e172a, #0b1424);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 16px 0;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
.margin-barometer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.margin-barometer-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.margin-barometer-title h3 {
  margin: 0;
  font-size: 15px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.margin-status-badge {
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
}
.margin-status-badge.down {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
  animation: pulseRisk 2s infinite ease-in-out;
}
.margin-status-badge.warn {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.5);
}
.margin-status-badge.up {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}
.margin-status-badge.neutral {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.3);
}

@keyframes pulseRisk {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.margin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 900px) {
  .margin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .margin-kpi-grid { grid-template-columns: 1fr; }
}

.margin-kpi-box {
  background: #0d1527;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: help;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.margin-kpi-box:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
}
.margin-kpi-box span {
  display: block;
  font-size: 11.5px;
  color: #94a3b8;
  margin-bottom: 4px;
}
.margin-kpi-box b {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 4px;
}
.margin-kpi-box .sub {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.margin-warning-banner {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid #38bdf8;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #cbd5e1;
}
.margin-warning-banner.down { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.margin-warning-banner.warn { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.margin-warning-banner.up { border-left-color: #22c55e; background: rgba(34, 197, 94, 0.08); }


/* Enhanced Stance Cards in Global Macro */
.brief-head {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 12px 0 16px;
}
@media (max-width: 860px) {
  .brief-head { grid-template-columns: 1fr; }
}

.stance-card {
  background: linear-gradient(145deg, #0e172a, #0b1322);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  transition: transform 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}
.stance-card:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
}
.stance-card.우호 { border-left: 4px solid #22c55e; }
.stance-card.부담 { border-left: 4px solid #ef4444; }
.stance-card.혼합, .stance-card.중립 { border-left: 4px solid #f59e0b; }
.stance-card.미연결 { border-left: 4px solid #64748b; }

.stance-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.stance-title {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}
.stance-badge {
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
}
.stance-badge.우호 { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.4); }
.stance-badge.부담 { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.stance-badge.혼합, .stance-badge.중립 { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.stance-badge.미연결 { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

.stance-verdict {
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 6px;
}
.stance-comment {
  font-size: 12.5px;
  line-height: 1.5;
  color: #cbd5e1;
  margin-bottom: 10px;
}
.stance-counts-bar {
  display: flex;
  height: 6px;
  border-radius: 99px;
  overflow: hidden;
  background: #1e293b;
  margin-top: 6px;
}
.stance-counts-bar .seg-good { background: #22c55e; }
.stance-counts-bar .seg-mid { background: #f59e0b; }
.stance-counts-bar .seg-bad { background: #ef4444; }

/* Market Internal Health & Breadth Matrix in Market Sentiment View */
.market-regime-card {
  background: #0e1626;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.market-regime-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.market-regime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.regime-metric-box {
  background: #111a2e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: help;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.regime-metric-box:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
}
.regime-metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.regime-metric-top span {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}
.regime-metric-score {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}
.regime-bar-track {
  height: 6px;
  border-radius: 99px;
  background: #1e293b;
  overflow: hidden;
  margin: 6px 0 4px;
}
.regime-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}
.regime-bar-fill.우호 { background: linear-gradient(90deg, #10b981, #34d399); }
.regime-bar-fill.중립 { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.regime-bar-fill.부담 { background: linear-gradient(90deg, #ef4444, #f87171); }

.regime-tone-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.regime-tone-badge.우호 { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.regime-tone-badge.중립 { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.regime-tone-badge.부담 { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* ECOS Visual Grid */
.ecos-visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.ecos-metric-box {
  background: #111a2e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
}
.ecos-metric-box span { display: block; font-size: 11.5px; color: #94a3b8; margin-bottom: 3px; }
.ecos-metric-box b { display: block; font-size: 16px; color: #f8fafc; font-weight: 700; margin-bottom: 2px; }
.ecos-metric-box .meta { font-size: 11px; color: #64748b; }


/* Custom Stock Strategy Backtest UI */
.custom-backtest-bar {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
}
.custom-backtest-bar input {
  flex: 1;
  background: #0d1527;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
}
.custom-backtest-bar input:focus {
  border-color: #38bdf8;
  outline: none;
}
.custom-backtest-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.tag-btn {
  background: #111a2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tag-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

.custom-backtest-hero {
  background: linear-gradient(145deg, #0e172a, #0b1322);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.custom-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.custom-hero-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.custom-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 10px 0;
}
@media (max-width: 800px) {
  .custom-hero-grid { grid-template-columns: repeat(2, 1fr); }
}


/* Visual Portfolio & Watchlist Studio */
.watch-add-bar {
  display: flex;
  gap: 8px;
  margin: 10px 0 16px;
}
.watch-add-bar input {
  flex: 1;
  background: #0d1527;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
}
.watch-add-bar input:focus {
  border-color: #38bdf8;
  outline: none;
}

.portfolio-overview-hero {
  background: linear-gradient(145deg, #0e172a, #0b1322);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.portfolio-overview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.portfolio-kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 800px) {
  .portfolio-kpis-grid { grid-template-columns: repeat(2, 1fr); }
}

.portfolio-kpi-item {
  background: #111a2e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
}
.portfolio-kpi-item span { display: block; font-size: 11.5px; color: #94a3b8; margin-bottom: 4px; }
.portfolio-kpi-item b { display: block; font-size: 18px; font-weight: 700; color: #f8fafc; }

.portfolio-sector-stack {
  margin-top: 10px;
}
.sector-stack-bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  margin: 6px 0 8px;
  background: #1e293b;
}
.sector-stack-seg { height: 100%; transition: width 0.3s ease; }
.sector-legend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
}
.sector-chip-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #111a2e;
  padding: 3px 8px;
  border-radius: 6px;
  color: #cbd5e1;
}
.sector-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.watch-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.portfolio-stock-card {
  background: #0e1626;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.portfolio-stock-card:hover {
  transform: translateY(-3px);
  border-color: #38bdf8;
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.15);
}
.stock-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.stock-card-company {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.stock-card-company:hover {
  color: #38bdf8;
}
.stock-card-meta {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}
.stock-score-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  min-width: 50px;
}
.card-factor-mini-bars {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  background: #111a2e;
  padding: 8px 10px;
  border-radius: 8px;
}
.card-factor-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #94a3b8;
}
.card-factor-bar {
  width: 90px;
  height: 5px;
  background: #1e293b;
  border-radius: 99px;
  overflow: hidden;
}
.card-factor-bar em {
  display: block;
  height: 100%;
  border-radius: 99px;
}

.stock-card-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.stock-card-price {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}
.stock-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.stock-card-actions button {
  flex: 1;
  padding: 6px 0;
  font-size: 11.5px;
}


/* Quick AI Report Trigger Button */
.btn-ai-mini {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
  margin-left: 4px;
}
.btn-ai-mini:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.45), rgba(168, 85, 247, 0.45));
  border-color: #c084fc;
  color: #fff;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
  transform: translateY(-1px);
}


/* Stock Search Autocomplete Floating Dropdown */
.autocomplete-wrap {
  position: relative;
  flex: 1;
  display: flex;
}
.autocomplete-wrap input {
  width: 100%;
}
.stock-autocomplete-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: #0d1527;
  border: 1px solid #38bdf8;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75);
  z-index: 99999;
  list-style: none;
  margin: 0;
  padding: 6px;
}
.stock-autocomplete-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: #e2e8f0;
  font-size: 13px;
  transition: all 0.1s ease;
}
.stock-autocomplete-item:hover, .stock-autocomplete-item.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}
.stock-autocomplete-item b {
  color: #fff;
  font-weight: 600;
}
.stock-autocomplete-item .meta-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #94a3b8;
}
.stock-autocomplete-item mark {
  background: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  border-radius: 2px;
  padding: 0 2px;
}


/* Clean Search Bar inside Card Headers */
.card-h .actions .autocomplete-wrap {
  position: relative;
  min-width: 220px;
  max-width: 280px;
  height: 36px;
  display: flex;
  align-items: center;
}
.card-h .actions .autocomplete-wrap input {
  width: 100%;
  height: 36px;
  background: #0d1527;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px 0 32px;
  color: #fff;
  font-size: 13px;
  box-sizing: border-box;
}
.card-h .actions .autocomplete-wrap input:focus {
  border-color: #38bdf8;
  outline: none;
}
.card-h .actions .autocomplete-wrap::before {
  content: "🔍";
  position: absolute;
  left: 10px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0.6;
}

/* On-Demand Flow Diagnosis Card */
.flow-diag-card {
  background: linear-gradient(145deg, #0e172a, #0b1322);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.flow-diag-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.flow-diag-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 12px 0;
}
@media (max-width: 800px) {
  .flow-diag-grid { grid-template-columns: repeat(2, 1fr); }
}


/* Strategy Playbook Plain Explanation Card */
.strategy-playbook-card {
  background: linear-gradient(145deg, #0f172a, #0d1527);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 14px;
}
.playbook-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.playbook-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 768px) {
  .playbook-grid { grid-template-columns: 1fr; }
}
.playbook-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
}
.playbook-item h4 {
  margin: 0 0 4px 0;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.playbook-item p {
  margin: 0;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
}


/* Floating Background AI Report Activity Banner */
.ai-report-floating-banner {
  position: fixed;
  top: 14px;
  right: 24px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 16px rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 99998;
  animation: bannerSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  color: #fff;
  font-size: 13px;
}
@keyframes bannerSlideIn {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.ai-report-floating-banner .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: bannerSpin 0.8s linear infinite;
}
@keyframes bannerSpin {
  to { transform: rotate(360deg); }
}


/* Report Modal Dual View Tabs & Toolbar */
.report-modal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.report-view-subtabs {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}
.report-view-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.report-view-btn.active {
  background: #38bdf8;
  color: #0f172a;
}
.report-iframe-wrap {
  width: 100%;
  height: 720px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  background: #090d16;
}
.report-iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}


/* Seasonality & Calendar Anomaly Screener */
.month-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.month-tab-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--line);
  color: #94a3b8;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.month-tab-btn:hover {
  border-color: #38bdf8;
  color: #fff;
}
.month-tab-btn.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border-color: #38bdf8;
  color: #0f172a;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}
.event-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.preset-chip-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.preset-chip-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}
.preset-chip-btn.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}
.month-heatmap-bar {
  display: flex;
  gap: 2px;
  align-items: center;
}
.month-mini-cell {
  width: 14px;
  height: 18px;
  border-radius: 2px;
  font-size: 8.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.month-mini-cell:hover {
  transform: scale(1.35);
  z-index: 10;
  box-shadow: 0 0 6px rgba(0,0,0,0.8);
}
.month-mini-cell.ret-super-up { background: #10b981; }
.month-mini-cell.ret-up { background: rgba(16, 185, 129, 0.65); }
.month-mini-cell.ret-flat { background: #334155; color: #94a3b8; }
.month-mini-cell.ret-down { background: rgba(244, 63, 94, 0.65); }
.month-mini-cell.ret-super-down { background: #f43f5e; }
.month-mini-cell.current-target-month {
  border: 1.5px solid #fff;
  box-shadow: 0 0 4px #fff;
}


/* Dashboard Seasonality Champion Widget */
.dash-seasonality-widget {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.75));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.seasonality-widget-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.seasonality-widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
}
.seasonality-champs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.seasonality-champ-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  cursor: pointer;
}
.seasonality-champ-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}
.seasonality-event-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.glance-top3-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.glance-pick-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.glance-pick-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}
.glance-pick-card.rank-1 { border-color: rgba(234, 179, 8, 0.45); }
.glance-pick-card.rank-2 { border-color: rgba(148, 163, 184, 0.45); }
.glance-pick-card.rank-3 { border-color: rgba(180, 83, 9, 0.45); }
.glance-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.glance-pick-name {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.glance-pick-meta {
  font-size: 11.5px;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.glance-pick-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0 4px;
}
.glance-pick-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: #cbd5e1;
}
@media (max-width: 900px) {
  .glance-top3-grid {
    grid-template-columns: 1fr;
  }
}


/* Institutional Seasonality v2.0 Styles */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.grade-badge.grade-s-plus {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #0f172a;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}
.grade-badge.grade-s {
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
  color: #fff;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}
.grade-badge.grade-a-plus {
  background: linear-gradient(135deg, #059669, #34d399);
  color: #0f172a;
}
.grade-badge.grade-a {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.grade-badge.grade-b {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}
.grade-badge.grade-c {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

.conf-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}
.conf-pill.conf-strong { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.35); }
.conf-pill.conf-confirmed { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.conf-pill.conf-neutral { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.conf-pill.conf-contradicted { background: rgba(244, 63, 94, 0.25); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.4); font-weight: 800; }

.pillar-bars-wrap {
  display: flex;
  gap: 4px;
  align-items: center;
}
.pillar-bar-segment {
  height: 6px;
  border-radius: 3px;
}
.pillar-bar-hist { background: #38bdf8; }
.pillar-bar-curr { background: #10b981; }
.pillar-bar-event { background: #f59e0b; }

.inst-subtabs-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
  margin-bottom: 16px;
}
.inst-subtab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.inst-subtab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.inst-subtab-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.event-timeline-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}
.event-timeline-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}


/* v1.1 Discovery & AI Explanation Styles */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
}
.status-pill.status-active { background: rgba(16, 185, 129, 0.25); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }
.status-pill.status-watch { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.35); }
.status-pill.status-discovery { background: rgba(139, 92, 246, 0.2); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.35); }
.status-pill.status-weakening { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-pill.status-broken { background: rgba(244, 63, 94, 0.25); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.4); }
.status-pill.status-unknown { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

.year-track-bar {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: 4px;
}
.year-track-cell {
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}
.year-track-win { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.year-track-loss { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }

.discovery-modal-card {
  background: #1e293b;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 20px;
  color: #fff;
}


/* Beneficiary Sectors & Stock Chips in 10-Event Calendar */
.event-sectors-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.sector-badge {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.event-stocks-wrap {
  margin-top: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 14px;
}
.event-stocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.event-stock-chip {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.event-stock-chip:hover {
  border-color: #38bdf8;
  background: rgba(30, 41, 59, 1);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.2);
}


/* Timing Stage Badges */
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
}
.stage-today { background: rgba(16, 185, 129, 0.25); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }
.stage-pre-entry { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.35); }
.stage-accumulate { background: rgba(139, 92, 246, 0.2); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.35); }
.stage-peak-exit { background: rgba(245, 158, 11, 0.25); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.stage-watch { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

/* Discovery Candidate Detail Modal */
.discovery-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.discovery-modal-overlay.hidden { display: none !important; }
.discovery-modal-container {
  background: #0f172a;
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 18px;
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  color: #fff;
}
.pb-confirm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pb-confirm-cell {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
}
.pb-confirm-cell span { display: block; font-size: 11px; color: #94a3b8; }
.pb-confirm-cell b { display: block; margin-top: 4px; color: #34d399; font-size: 14px; }
.pb-month-heat {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
}
.pb-month-cell {
  text-align: center;
  border-radius: 10px;
  padding: 8px 4px;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 11px;
}
.pb-month-cell.on { border-color: #38bdf8; box-shadow: 0 0 0 1px #38bdf8; }
.pb-month-cell b { display: block; font-size: 13px; }
.pb-month-cell small { display: block; color: #94a3b8; }
.pb-month-cell.heat-up3 { background: rgba(16, 185, 129, 0.88); color: #fff; }
.pb-month-cell.heat-up3 small { color: rgba(255,255,255,0.8); }
.pb-month-cell.heat-up2 { background: rgba(52, 211, 153, 0.55); }
.pb-month-cell.heat-up1 { background: rgba(56, 189, 248, 0.32); }
.pb-month-cell.heat-flat { background: #111827; }
.pb-month-cell.heat-dn1 { background: rgba(248, 113, 113, 0.42); }
.pb-month-cell.heat-dn2 { background: rgba(239, 68, 68, 0.82); color: #fff; }
.pb-month-cell.heat-dn2 small { color: rgba(255,255,255,0.8); }
.pb-year-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.7);
  margin-top: 6px;
  font-size: 12.5px;
}
.pb-year-row.loss { background: rgba(127, 29, 29, 0.25); }
.pb-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pb-stat-cell {
  background: #0b1220;
  border-radius: 10px;
  padding: 10px;
}
.pb-stat-cell span { display: block; font-size: 11px; color: #94a3b8; }
.pb-stat-cell b { display: block; margin-top: 4px; font-size: 16px; }
.pb-lollipop {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  padding: 8px 4px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
}
.pb-lollipop i {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.pb-lollipop em {
  width: 4px;
  border-radius: 4px;
  background: #22d3ee;
  min-height: 4px;
}
.pb-lollipop em.loss { background: #f87171; }
.pb-lollipop small { margin-top: 4px; color: #64748b; font-size: 10px; }
.pb-stress {
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
}
.pb-bar-dual {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  background: #1e293b;
  margin-top: 6px;
}
@media (max-width: 700px) {
  .pb-month-heat, .pb-stat-grid, .pb-confirm-grid { grid-template-columns: repeat(2, 1fr); }
}
.discovery-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
}
.playbook-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 14px;
}
.expected-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px;
}
.expected-kpi-item {
  text-align: center;
}
.expected-kpi-item span {
  font-size: 11px;
  color: #94a3b8;
  display: block;
}
.expected-kpi-item b {
  font-size: 14px;
  color: #fff;
  margin-top: 2px;
  display: block;
}


/* Pre-Entry Top 10 Hero Cards & Theme Donut Widget */
.pre-entry-card {
  background: #0f172a;
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 18px;
  padding: 20px;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.pre-entry-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 8px 30px rgba(56, 189, 248, 0.15);
}
.pre-entry-card.rank-1 {
  border: 1.5px solid #eab308;
  background: linear-gradient(180deg, rgba(234, 179, 8, 0.05) 0%, rgba(15, 23, 42, 1) 100%);
}
.pre-entry-kpi-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.pre-entry-kpi-item {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pre-entry-kpi-item b {
  color: #fff;
  font-weight: 800;
}
.pre-entry-timing-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.catalyst-box {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.5;
  margin-top: 12px;
}
.theme-donut-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .theme-donut-container {
    grid-template-columns: 1fr;
  }
}
.donut-chart-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.donut-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.theme-ranking-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}
.theme-rank-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.theme-rank-card:hover, .theme-rank-card.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
}


/* Status Guide Modal */
.status-guide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.status-guide-overlay.hidden { display: none !important; }
.status-guide-container {
  background: #0f172a;
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 18px;
  max-width: 620px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  color: #fff;
}
.status-explanation-card {
  background: rgba(30, 41, 59, 0.5);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}


/* Status Hover Popover */
.status-hover-popover {
  position: fixed;
  z-index: 10002;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 12px 14px;
  max-width: 340px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(56, 189, 248, 0.2);
  pointer-events: none;
  font-size: 12px;
  line-height: 1.5;
  color: #fff;
  transition: opacity 0.12s ease;
}
.status-hover-popover.hidden {
  display: none !important;
}
.status-pill {
  cursor: help;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.status-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}


/* --- 🍵 은하퀀트전설 (Legend of Galactic Quant) - 제13함대 히페리온 작전 회의실 Theme --- */
.yang-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 500px at 0% -10%, rgba(234, 179, 8, 0.12), transparent 60%),
    radial-gradient(1000px 400px at 100% 0%, rgba(6, 182, 212, 0.16), transparent 55%),
    radial-gradient(800px 400px at 50% 100%, rgba(30, 58, 138, 0.25), transparent 60%),
    #090e1a !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
}

.yang-war-room-header {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.yang-portrait-card {
  border-radius: 18px;
  padding: 20px 16px;
  text-align: center;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.7), rgba(8, 47, 73, 0.85));
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(56, 189, 248, 0.1);
  position: relative;
}

.yang-avatar-hud {
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 42px;
  background: radial-gradient(circle at 35% 25%, #38bdf8, #0e7490 60%, #082f49 100%);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.yang-tea-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.4);
  margin-top: 8px;
}

.yang-briefing-hud {
  border: 1.5px solid rgba(56, 189, 248, 0.3);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.75), rgba(11, 18, 32, 0.95));
  border-radius: 18px;
  padding: 18px 22px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
}

.yang-strategy-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: rgba(234, 179, 8, 0.18);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.4);
}

.yang-posture-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin-bottom: 12px;
}

.yang-posture-btn {
  flex: 1;
  min-width: 140px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.yang-posture-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.yang-posture-btn.active {
  background: rgba(8, 47, 73, 0.85);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.yang-tactical-card {
  border-radius: 16px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(22, 32, 54, 0.8), rgba(11, 18, 32, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.yang-tactical-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 14px 35px rgba(56, 189, 248, 0.16);
}

.yang-tier-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
}

.yang-tier-box.briefing {
  background: rgba(15, 23, 42, 0.6);
  border-left: 3px solid #38bdf8;
  color: #e2e8f0;
}

.yang-tier-box.maneuver {
  background: rgba(234, 179, 8, 0.08);
  border-left: 3px solid #fbbf24;
  color: #fde047;
}

.yang-tier-box.escape {
  background: rgba(244, 63, 94, 0.08);
  border-left: 3px solid #f43f5e;
  color: #fda4af;
}

/* Modal for 1:1 Yang Briefing */
.yang-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.yang-modal-overlay.hidden {
  display: none !important;
}

.yang-modal-dialog {
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #0f172a, #090e1a);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 20px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.2);
  padding: 24px 28px;
}

/* ==========================================================================
   Trading Lab (트레이딩 랩) - Dedicated Modern UI / UX
   ========================================================================== */
.trade-toolbar-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.trade-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.trade-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trade-search-wrap .autocomplete-wrap {
  position: relative;
  min-width: 220px;
  max-width: 280px;
  height: 38px;
  display: flex;
  align-items: center;
}

.trade-search-wrap .autocomplete-wrap input {
  width: 100%;
  height: 38px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0 12px 0 34px;
  color: #fff;
  font-size: 13px;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.trade-search-wrap .autocomplete-wrap input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
  outline: none;
}

.trade-search-wrap .autocomplete-wrap::before {
  content: "🔍";
  position: absolute;
  left: 10px;
  font-size: 13px;
  pointer-events: none;
  opacity: 0.6;
}

.trade-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.trade-filter-label {
  display: inline-flex;
  align-items: center;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 2px 4px 2px 10px;
  height: 38px;
  box-sizing: border-box;
  gap: 8px;
  font-size: 12.5px;
  color: #94a3b8;
  white-space: nowrap;
}

.trade-filter-label .filter-tag {
  font-weight: 700;
  color: #cbd5e1;
  font-size: 12px;
}

.trade-select {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  height: 30px;
}

.trade-select:focus {
  border-color: #38bdf8;
}

.trade-chk-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0 12px;
  height: 38px;
  font-size: 12.5px;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.trade-chk-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: #38bdf8;
  width: 15px;
  height: 15px;
}

.trade-refresh-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.trade-refresh-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
}

/* Enhanced H-Tabs for Investor Flow */
.h-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.h-tabs button {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.h-tabs button:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #fff;
  border-color: rgba(56, 189, 248, 0.4);
}
.h-tabs button.on {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

th.has-tip, .filter-tag.has-tip, .chip.has-tip, .kpi.has-tip, span.has-tip, label.has-tip {
  cursor: help !important;
}
th.has-tip:hover, .filter-tag.has-tip:hover {
  color: #38bdf8 !important;
}

/* Prevent badge icon and text clipping when screen narrows */
.chip, .tag, .sector-stock-pill {
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0;
}
td.num, th.num, td .meta, th {
  white-space: nowrap;
}
