:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --border: #e5e7eb;
  --ink: #111827;
  --muted: #6b7280;
  --positive: #dc2626;
  --negative: #2563eb;
  --accent-fixed: #111827; /* stays dark in both themes, for badges with white text */
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 16px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 12px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(17, 24, 39, .22);
  flex-shrink: 0;
}

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

.brand-title { font-weight: 800; font-size: 16px; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.refresh-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 16px;
  cursor: pointer;
}
.refresh-btn:active { transform: scale(0.92); }

.pill-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 5px;
  margin: 8px 0 20px;
}

.pill-tabs .tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  padding: 9px 1px;
  border-radius: 12px;
  cursor: pointer;
}

.pill-tabs .tab.active {
  background: var(--accent-fixed);
  color: #fff;
}

.panel { display: none; animation: fade-in .28s cubic-bezier(.22,.61,.36,1); }
.panel.active { display: block; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.pill-tabs .tab { transition: background .18s ease, color .18s ease, transform .1s ease; }
.pill-tabs .tab:active { transform: scale(.96); }

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 5px;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
  animation: live-pulse 2s ease-out infinite;
  vertical-align: middle;
}

@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
  70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.refresh-btn.spinning { animation: spin .5s cubic-bezier(.22,.61,.36,1); }
@keyframes spin { to { transform: rotate(360deg); } }

.section-title {
  font-size: 15px;
  font-weight: 800;
  margin: 24px 0 10px;
}

.muted { color: var(--muted); font-size: 13px; }

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  animation: card-in .4s cubic-bezier(.22,.61,.36,1) both;
}

.hero-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.hero-value { font-size: 34px; font-weight: 900; margin-top: 4px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; transition: color .3s ease; }
.hero-sub { font-size: 14px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hero-sub.positive { color: var(--positive); }
.hero-sub.negative { color: var(--negative); }

.hero-daychange {
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.hero-daychange .arrow { font-weight: 900; margin-right: 3px; }
.hero-daychange.positive .arrow, .hero-daychange.positive .amt { color: var(--positive); }
.hero-daychange.negative .arrow, .hero-daychange.negative .amt { color: var(--negative); }

.tier-breakdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.tier-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
  animation: card-in .4s cubic-bezier(.22,.61,.36,1) both;
  border-top: 3px solid var(--muted);
}
.tier-card.tier-leverage_2x { border-top-color: #dc2626; }
.tier-card.tier-core_1x { border-top-color: #2563eb; }
.tier-card.tier-bond { border-top-color: #7c3aed; }
.tier-card.tier-cash { border-top-color: #6b7280; }
.tier-card .tier-label { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.tier-card .tier-value { font-size: 13.5px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }
.tier-card .tier-rate { font-size: 11px; font-weight: 700; margin-top: 2px; }
.tier-card .tier-rate.positive { color: var(--positive); }
.tier-card .tier-rate.negative { color: var(--negative); }

@media (max-width: 420px) {
  .tier-breakdown { grid-template-columns: repeat(2, 1fr); }
}

.holding-group-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 18px 0 8px;
}
.holding-group-label:first-child { margin-top: 0; }

.lev-cards { display: flex; flex-direction: column; gap: 10px; }

.lev-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: card-in .4s cubic-bezier(.22,.61,.36,1) both;
  transition: transform .18s ease, box-shadow .18s ease;
}

.lev-card:hover,
.holding-row:hover,
.risk-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(17, 24, 39, .08);
}

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--accent-fixed);
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 8px;
}
.tag-leverage_2x { background: #dc2626; }
.tag-core_1x { background: #2563eb; }
.tag-bond { background: #7c3aed; }
.tag-cash { background: #6b7280; }

.lev-card .name { font-weight: 800; font-size: 14px; }
.lev-card .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.lev-card .right { text-align: right; }
.lev-card .value { font-weight: 800; font-size: 15px; }
.lev-card .rate { font-size: 13px; font-weight: 700; margin-top: 2px; }
.lev-card .rate.positive { color: var(--positive); }
.lev-card .rate.negative { color: var(--negative); }

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 10px;
}

.period-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  flex-wrap: wrap;
}

.period-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 10.5px;
  padding: 5px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
  white-space: nowrap;
}

.period-btn.active {
  background: var(--accent-fixed);
  color: #fff;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.chart-wrap { position: relative; }

.chart-tooltip {
  position: absolute;
  top: 0;
  transform: translate(-50%, -100%);
  background: var(--accent-fixed);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
  z-index: 2;
  font-variant-numeric: tabular-nums;
}

.chart-tooltip .tt-date { color: #9ca3af; font-weight: 600; font-size: 10px; display: block; margin-bottom: 2px; }
.chart-tooltip.visible { opacity: 1; }

.chart-crosshair {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0;
  pointer-events: none;
}
.chart-crosshair.visible { opacity: .7; }

.chart-hover-dot {
  opacity: 0;
  pointer-events: none;
}
.chart-hover-dot.visible { opacity: 1; }

.chart-hitlayer { cursor: crosshair; }

.chart-legend {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.chart-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; vertical-align: middle; }
.chart-tooltip .tt-trade {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 1px 7px;
  margin-top: 3px;
  margin-right: 3px;
}

.trend-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.tstat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.tstat-card.negative { border-color: rgba(37,99,235,.35); }
.tstat-label { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.tstat-value { font-size: 15px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }
.tstat-date { font-size: 10px; color: var(--muted); margin-top: 2px; }

.holding-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  animation: card-in .4s cubic-bezier(.22,.61,.36,1) both;
  transition: transform .18s ease, box-shadow .18s ease;
}

.holding-row .name { font-weight: 700; font-size: 14px; }
.holding-row .qty { color: var(--muted); font-size: 12px; margin-top: 2px; }
.holding-row .right { text-align: right; }
.holding-row .value { font-weight: 800; font-size: 14px; }
.holding-row .rate { font-size: 12px; font-weight: 700; }
.holding-row .rate.positive { color: var(--positive); }
.holding-row .rate.negative { color: var(--negative); }

.risk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 14px;
  margin-bottom: 14px;
  animation: card-in .4s cubic-bezier(.22,.61,.36,1) both;
  transition: transform .18s ease, box-shadow .18s ease;
}

.risk-stat .value { transition: color .3s ease; }

.risk-card .title { font-weight: 800; font-size: 15px; margin-bottom: 10px; }
.risk-card .title-symbol {
  font-weight: 700;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 10px;
}

.risk-stat .label { color: var(--muted); font-size: 11px; }
.risk-stat .value { font-weight: 800; font-size: 15px; margin-top: 2px; }
.risk-stat .value.positive { color: var(--positive); }
.risk-stat .value.negative { color: var(--negative); }

.foot-note {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  margin-top: 36px;
}

.proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  animation: card-in .4s cubic-bezier(.22,.61,.36,1) both;
}

.proj-card .row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.proj-card .name { font-weight: 800; font-size: 14px; }
.proj-card .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.cagr-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--positive);
  background: rgba(220, 38, 38, .1);
  border-radius: 999px;
  padding: 3px 9px;
  line-height: 1.5;
  text-align: right;
}

.proxy-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 8px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.proj-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.proj-input-row label { font-size: 12px; color: var(--muted); font-weight: 700; }

.proj-input-row input {
  width: 130px;
  text-align: right;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.proj-input-row input:focus { outline: 2px solid var(--accent-fixed); outline-offset: 1px; }

.proj-save-btn {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent-fixed);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
.proj-save-btn:active { opacity: .85; }
.proj-save-status {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
  min-height: 16px;
  color: var(--positive);
}
.proj-save-status.error { color: var(--negative); }

.projection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.proj-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  animation: card-in .4s cubic-bezier(.22,.61,.36,1) both;
}

.proj-result .label { color: var(--muted); font-size: 12px; font-weight: 700; }
.proj-result .value {
  font-weight: 900;
  font-size: 17px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.proj-result .principal {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

@media (max-width: 380px) {
  .projection-grid { grid-template-columns: 1fr; }
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 24px;
  font-size: 13px;
}

.phil-quote {
  background: var(--accent-fixed);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.5;
  animation: card-in .4s cubic-bezier(.22,.61,.36,1) both;
}
.phil-quote .src { display: block; margin-top: 10px; font-size: 12px; font-weight: 600; color: #9ca3af; }

.phil-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 12px;
  animation: card-in .4s cubic-bezier(.22,.61,.36,1) both;
}

.phil-section .h { font-weight: 800; font-size: 14.5px; margin-bottom: 6px; }
.phil-section .p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.phil-section .p strong { color: var(--ink); font-weight: 700; }
.phil-section .p .stat-inline { color: var(--negative); font-weight: 800; font-variant-numeric: tabular-nums; }

.phil-checklist {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phil-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
}

.phil-checklist .num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.phil-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.phil-compare .card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.phil-compare .card .t { font-weight: 800; font-size: 13px; }
.phil-compare .card .d { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

.news-card {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--ink);
  animation: card-in .4s cubic-bezier(.22,.61,.36,1) both;
  transition: transform .18s ease, box-shadow .18s ease;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(17, 24, 39, .08);
}

.news-card .thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-soft);
}

.news-card .body { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.news-card .title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card .meta { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.news-card .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --surface: #151821;
    --surface-soft: #1b1f2a;
    --border: #262b38;
    --ink: #f3f4f6;
    --muted: #8b93a7;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0d12;
  --surface: #151821;
  --surface-soft: #1b1f2a;
  --border: #262b38;
  --ink: #f3f4f6;
  --muted: #8b93a7;
}

:root[data-theme="light"] {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --border: #e5e7eb;
  --ink: #111827;
  --muted: #6b7280;
}

/* ---------- 계좌 탭 ---------- */
.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 12px;
  animation: card-in .4s cubic-bezier(.22,.61,.36,1) both;
}
.account-card .acc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.account-card .acc-name { font-weight: 800; font-size: 15px; }
.account-card .acc-type {
  font-size: 10.5px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
}
.account-card .acc-total { text-align: right; }
.account-card .acc-total .value { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.account-card .acc-total .rate { font-size: 12px; font-weight: 700; margin-top: 2px; }
.account-card .acc-total .rate.positive { color: var(--positive); }
.account-card .acc-total .rate.negative { color: var(--negative); }
.account-card .acc-holding-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}
.account-card .acc-holding-row .name { font-weight: 700; }
.account-card .acc-holding-row .sub { color: var(--muted); font-size: 11px; margin-top: 1px; }
.account-card .acc-holding-row .right { text-align: right; }
.account-card .acc-holding-row .rate.positive { color: var(--positive); }
.account-card .acc-holding-row .rate.negative { color: var(--negative); }

/* ---------- 캘린더 탭 ---------- */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 10px;
}
.cal-month-label { font-weight: 800; font-size: 15px; }
.cal-nav-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 16px;
  cursor: pointer;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
}
.cal-dow {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0 8px;
}
.cal-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  padding: 4px;
  font-size: 10.5px;
  color: var(--muted);
  position: relative;
  cursor: default;
}
.cal-cell.empty { visibility: hidden; }
.cal-cell.has-buy { background: rgba(220, 38, 38, .1); }
.cal-cell.has-sell { background: rgba(37, 99, 235, .1); }
.cal-cell.has-both { background: linear-gradient(135deg, rgba(220,38,38,.12), rgba(37,99,235,.12)); }
.cal-cell .daynum { font-weight: 700; color: var(--ink); }
.cal-cell .dot-row { display: flex; gap: 2px; margin-top: 2px; flex-wrap: wrap; }
.cal-cell .dot { width: 5px; height: 5px; border-radius: 50%; }
.cal-cell .dot.buy { background: var(--positive); }
.cal-cell .dot.sell { background: var(--negative); }
.cal-cell.clickable { cursor: pointer; }
.cal-cell.selected { outline: 2px solid var(--accent-fixed); outline-offset: -2px; }

.cal-day-card {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  animation: card-in .3s cubic-bezier(.22,.61,.36,1) both;
}
.cal-day-card .cal-day-title { font-weight: 800; font-size: 13px; margin-bottom: 8px; }
.cal-day-card .cal-trade-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}
.cal-day-card .cal-trade-row:first-of-type { border-top: 0; }
.cal-day-card .side-tag {
  font-size: 10.5px;
  font-weight: 800;
  border-radius: 6px;
  padding: 1px 6px;
  margin-right: 6px;
}
.cal-day-card .side-tag.buy { background: rgba(220,38,38,.12); color: var(--positive); }
.cal-day-card .side-tag.sell { background: rgba(37,99,235,.12); color: var(--negative); }

/* ---------- 자산맵(트리맵) ---------- */
.treemap {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.treemap-node {
  position: relative;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  min-height: 70px;
  overflow: hidden;
}
.treemap-node .tn-name { font-size: 12px; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.treemap-node .tn-value { font-size: 10.5px; opacity: .92; margin-top: 2px; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.treemap-node .tn-rate { font-size: 10.5px; font-weight: 800; margin-top: 2px; text-shadow: 0 1px 3px rgba(0,0,0,.35); }

.heat-treemap-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-soft);
}
.heat-rect {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid var(--bg);
  padding: 4px 6px;
  overflow: hidden;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  cursor: default;
}
.heat-rect .tn-symbol {
  font-size: 11px;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0,0,0,.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.heat-rect .tn-chg { font-weight: 700; opacity: .92; font-size: 10px; line-height: 1.3; }
.heat-rect .tn-name {
  font-size: 9.5px;
  font-weight: 600;
  opacity: .85;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.heat-rect .tn-value { font-size: 9px; margin-top: 1px; opacity: .9; }
.treemap-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--muted);
}
.treemap-legend .bar {
  flex: 1;
  height: 6px;
  margin: 0 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #6b7280, #dc2626);
}

/* ---------- 눌림목(주봉 매수신호) ---------- */
.pb-head-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4px;
}
.pb-price { font-size: 26px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.pb-change { font-size: 13px; font-weight: 700; margin-left: 8px; }
.pb-updated { font-size: 11px; color: var(--muted); }

.pb-signal-banner {
  margin-top: 14px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--muted);
  background: var(--surface-soft);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pb-signal-banner .pb-signal-text { font-weight: 800; font-size: 15px; }
.pb-signal-banner .pb-signal-detail { font-size: 12px; color: var(--muted); }
.pb-signal-banner.level-strong { border-left-color: #16a34a; background: #ecfdf5; }
.pb-signal-banner.level-strong .pb-signal-text { color: #15803d; }
.pb-signal-banner.level-medium { border-left-color: #22c55e; background: #f0fdf4; }
.pb-signal-banner.level-medium .pb-signal-text { color: #16a34a; }
.pb-signal-banner.level-weak { border-left-color: #d97706; background: #fffbeb; }
.pb-signal-banner.level-weak .pb-signal-text { color: #b45309; }
.pb-signal-banner.level-none .pb-signal-text { color: var(--ink); }

.pb-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.pb-metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
}
.pb-metric .label { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.pb-metric .value { font-size: 16px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }
.pb-metric .value.hit { color: #16a34a; }
.pb-metric .value.warn { color: #d97706; }
.pb-metric .value.cold { color: var(--negative); }

.pb-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 12px;
}
.pb-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--muted);
}
.pb-chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.pb-chart-legend .dot { width: 8px; height: 3px; border-radius: 2px; display: inline-block; }

.pb-rule-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  line-height: 1.5;
}

/* ---------- TQQQ 김째매매법 ---------- */
.tqqq-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.tqqq-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  animation: card-in .4s cubic-bezier(.22,.61,.36,1) both;
  border-left: 4px solid var(--muted);
}
.tqqq-card.strategy-basic { border-left-color: #2563eb; }
.tqqq-card.strategy-plus { border-left-color: #7c3aed; }
.tqqq-card .tqqq-head { display: flex; justify-content: space-between; align-items: baseline; }
.tqqq-card .tqqq-label { font-weight: 800; font-size: 14px; }
.tqqq-card .tqqq-date { font-size: 11px; color: var(--muted); }
.tqqq-card .tqqq-position { font-size: 17px; font-weight: 800; margin-top: 6px; }
.tqqq-card .tqqq-summary { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.tqqq-card .tqqq-error { font-size: 12px; color: var(--negative); margin-top: 6px; }

.tqqq-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}
.tqqq-chart-legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.tqqq-chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.tqqq-chart-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---------- 보유 ETF 구성종목 맵(룩스루) ---------- */
.lookthrough-note {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  line-height: 1.5;
  margin-top: 10px;
}
