:root {
  --bg: #090711;
  --panel: #15101f;
  --panel-2: #1c1528;
  --line: #443852;
  --line-soft: #30263c;
  --text: #fbf7ff;
  --muted: #a89bc2;
  --soft: #ded4f0;
  --green: #19e6a4;
  --amber: #ffcc33;
  --red: #ff3f5f;
  --blue: #3f8cff;
  --profit: #ff3f5f;
  --loss: #3f8cff;
  --pnl-gain: #32d66a;
  --pnl-loss: #ff6068;
  --purple: #a78bfa;
  --value-blue: #d9e5ff;
  --value-cyan: #61d5ff;
  --value-mint: #72f5cf;
  --value-violet: #9f7cff;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  letter-spacing: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px clamp(14px, 2vw, 28px) 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand > div {
  min-width: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
}

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

h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
  font-weight: 780;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  font-size: 14px;
  color: var(--soft);
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.meta-line span {
  min-width: 0;
}

.meta-line span + span::before {
  content: "/";
  margin-right: 8px;
  color: #564b66;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--green);
  outline: none;
}

.icon-button span {
  font-size: 22px;
  line-height: 1;
}

.status-pill {
  min-width: 70px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: var(--panel);
  font-size: 13px;
  white-space: nowrap;
}

.status-pill[data-tone="ok"] {
  color: #bfffe9;
  border-color: rgba(25, 230, 164, 0.48);
  background: rgba(25, 230, 164, 0.09);
}

.status-pill[data-tone="error"] {
  color: #ffd6df;
  border-color: rgba(255, 93, 122, 0.5);
  background: rgba(255, 93, 122, 0.1);
}

.mode-toggle,
.manual-vr-shortcut {
  height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.mode-toggle:hover,
.mode-toggle:focus-visible,
.manual-vr-shortcut:hover,
.manual-vr-shortcut:focus-visible {
  border-color: var(--green);
  color: var(--green);
  outline: none;
}

.mode-toggle.is-active,
.manual-vr-shortcut.is-active {
  border-color: var(--green);
  color: var(--green);
  background: rgba(25, 230, 164, 0.08);
}

.banner-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.banner {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--soft);
  background: var(--panel);
  font-size: 14px;
}

.banner.warn {
  color: #ffdf79;
  border-color: rgba(255, 204, 51, 0.45);
  background: rgba(255, 204, 51, 0.1);
}

.banner.critical {
  color: #ffd6df;
  border-color: rgba(255, 93, 122, 0.5);
  background: rgba(255, 93, 122, 0.1);
}

.banner.info {
  color: #d8d0ff;
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(167, 139, 250, 0.1);
}

.strategy-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  margin: 0 0 18px;
  overflow-x: auto;
  scrollbar-width: thin;
}

[data-mode-nav][hidden] {
  display: none;
}

.tab-button {
  min-width: 0;
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--soft);
  background: var(--panel);
  font-size: 14px;
  font-weight: 780;
  cursor: pointer;
  white-space: nowrap;
}

.tab-button:hover,
.tab-button:focus-visible {
  border-color: var(--green);
  outline: none;
}

.tab-button.is-active {
  color: #bfffe9;
  border-color: rgba(25, 230, 164, 0.62);
  background: rgba(25, 230, 164, 0.1);
}

.tab-soon {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.tab-panel {
  min-width: 0;
}

.tab-panel[hidden] {
  display: none;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 26px;
}

.summary-overview {
  grid-template-columns: 1fr;
}

.account-overview {
  margin-bottom: 12px;
}

.sentiment-section {
  margin-top: 24px;
}

.vr-sentiment-section {
  margin: -2px 0 24px;
}

.gauge-panel,
.summary-panel,
.ticker-card,
.vr-card,
.history-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.gauge-panel,
.summary-panel {
  padding: 14px 16px;
}

.section-heading,
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading {
  min-height: 30px;
  color: var(--muted);
  font-size: 14px;
}

.section-heading strong {
  color: var(--text);
  font-size: 14px;
}

.gauge-chart {
  width: 100%;
  min-height: 292px;
  margin-top: 8px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.account-grid .metric-value {
  font-size: clamp(17px, 1.7vw, 24px);
  font-weight: 880;
}

.account-grid .metric.account-cash .metric-label,
.account-grid .metric.account-cash .metric-value {
  color: var(--value-mint);
}

.account-grid .metric.account-deposit .metric-label,
.account-grid .metric.account-deposit .metric-value {
  color: var(--value-cyan);
}

.account-grid .metric.account-total .metric-label,
.account-grid .metric.account-total .metric-value {
  color: var(--value-blue);
}

.metric {
  min-width: 0;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.metric-label,
.metric-side,
.metric-sub,
.stat span,
.muted-value {
  color: var(--muted);
  font-size: 12px;
}

.metric-label-row,
.metric-value-row,
.stat-label-row,
.stat-value-row {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.metric-value {
  min-width: 0;
  color: var(--text);
  font-size: clamp(16px, 1.6vw, 22px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.metric-side,
.stat-side {
  flex: 0 0 auto;
  font-weight: 840;
}

.metric-sub,
.stat-sub {
  display: block;
  min-width: 0;
  margin-top: -3px;
  font-size: 11px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.metric-sub.is-empty {
  visibility: hidden;
}

.stat-sub.is-empty {
  visibility: hidden;
}

#us-summary-grid .metric-sub,
#kr-summary-grid .metric-sub {
  white-space: nowrap;
}

.fx-note {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
  color: #b9d1ff;
  font-size: 11px;
  font-weight: 760;
}

.fx-note strong {
  color: #f2ecff;
}

.fx-note em {
  color: #746982;
  font-style: normal;
  font-size: 10px;
}

#us-summary-grid .metric.invested .metric-label,
#us-summary-grid .metric.invested .metric-value,
#us-summary-grid .metric.valuation .metric-label,
#us-summary-grid .metric.valuation .metric-value,
#kr-summary-grid .metric.invested .metric-label,
#kr-summary-grid .metric.invested .metric-value,
#kr-summary-grid .metric.valuation .metric-label,
#kr-summary-grid .metric.valuation .metric-value {
  color: var(--text);
}

#us-summary-grid .metric.pnl .metric-label,
#kr-summary-grid .metric.pnl .metric-label {
  color: var(--muted);
}

.metric.pnl .metric-value {
  font-size: clamp(18px, 1.9vw, 26px);
  font-weight: 880;
}

.metric.pnl.positive .metric-value,
.metric.pnl.positive .metric-side {
  color: var(--pnl-gain);
}

.metric.pnl.negative .metric-value,
.metric.pnl.negative .metric-side {
  color: var(--pnl-loss);
}

.metric.pnl.neutral .metric-value,
.metric.pnl.neutral .metric-side {
  color: var(--soft);
}

.vr-daily-summary-grid .metric.invested .metric-label,
.vr-daily-summary-grid .metric.invested .metric-value,
.vr-daily-summary-grid .metric.valuation .metric-label,
.vr-daily-summary-grid .metric.valuation .metric-value {
  color: var(--text);
}

.vr-daily-summary-grid .metric.pnl .metric-label {
  color: var(--muted);
}

.vr-overview-grid {
  grid-template-columns: minmax(420px, 0.95fr) minmax(360px, 1fr);
  align-items: start;
}

.vr-current-card {
  position: relative;
  min-width: 0;
  min-height: 194px;
  overflow: hidden;
  padding: 23px 22px 20px;
  border: 1px solid rgba(137, 124, 164, 0.62);
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 12%, rgba(25, 230, 164, 0.14), transparent 25%),
    linear-gradient(145deg, #171124 0%, #100b1a 66%, #0c0914 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.vr-card > .vr-current-card {
  margin-top: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.vr-current-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.18;
}

.vr-current-card.kr {
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 176, 0, 0.14), transparent 25%),
    linear-gradient(145deg, #171124 0%, #100b1a 66%, #0c0914 100%);
}

.vr-current-card > * {
  position: relative;
  z-index: 1;
}

.vr-current-top {
  display: block;
  padding-right: 112px;
}

.vr-current-heading {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.vr-current-eyebrow {
  color: #cfc5ff;
  font-size: 11px;
  font-weight: 860;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.vr-current-status {
  position: absolute;
  top: -2px;
  right: 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid rgba(25, 230, 164, 0.42);
  border-radius: 999px;
  color: #89ffd8;
  background: rgba(25, 230, 164, 0.11);
  font-size: 12px;
  font-weight: 860;
  white-space: nowrap;
}

.vr-current-status.below {
  color: #d9e5ff;
  border-color: rgba(63, 140, 255, 0.48);
  background: rgba(63, 140, 255, 0.1);
}

.vr-current-status.above {
  color: #ffd6df;
  border-color: rgba(255, 63, 95, 0.48);
  background: rgba(255, 63, 95, 0.1);
}

.vr-current-status.unknown {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.vr-current-value {
  margin-top: 6px;
  color: #fff7ef;
  font-size: clamp(29px, 3.6vw, 39px);
  line-height: 0.98;
  font-weight: 860;
  letter-spacing: -0.07em;
  text-shadow: 0 0 22px rgba(255, 176, 0, 0.12);
}

.vr-current-card.kr .vr-current-value {
  text-shadow: 0 0 22px rgba(25, 230, 164, 0.12);
}

.vr-current-band-text {
  margin-top: 6px;
  color: #a89bc2;
  font-size: 13px;
  font-weight: 720;
}

.vr-current-outlier-note {
  min-height: 20px;
  display: flex;
  align-items: center;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 860;
  letter-spacing: -0.01em;
}

.vr-current-outlier-note.above {
  justify-content: flex-end;
  color: #ffd6df;
  text-shadow: 0 0 14px rgba(255, 63, 95, 0.28);
}

.vr-current-outlier-note.below {
  justify-content: flex-start;
  color: #d9e5ff;
  text-shadow: 0 0 14px rgba(63, 140, 255, 0.28);
}

.vr-current-scale-labels {
  position: relative;
  display: flex;
  justify-content: space-between;
  min-height: 22px;
  margin-top: 22px;
  color: #d5ccff;
  font-size: 10px;
  font-weight: 840;
  letter-spacing: -0.02em;
}

.vr-current-outlier-note + .vr-current-scale-labels {
  margin-top: 10px;
}

.vr-current-scale-labels span {
  white-space: nowrap;
}

.vr-current-progress {
  position: relative;
  height: 8px;
  overflow: hidden;
  margin-top: 6px;
  border-radius: 999px;
  background: #2c253d;
}

.vr-current-progress.above::after,
.vr-current-progress.below::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
}

.vr-current-progress.above::after {
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 63, 95, 0.65));
  box-shadow: 0 0 22px rgba(255, 63, 95, 0.42);
}

.vr-current-progress.below::after {
  left: 0;
  background: linear-gradient(90deg, rgba(63, 140, 255, 0.65), transparent);
  box-shadow: 0 0 22px rgba(63, 140, 255, 0.42);
}

.vr-current-progress-fill {
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: linear-gradient(90deg, #5b98ff 0%, #55d7cf 48%, #ffcc33 100%);
  box-shadow: 0 0 22px rgba(85, 215, 207, 0.22);
}

.vr-current-card.kr .vr-current-progress-fill {
  background: linear-gradient(90deg, #ffb000 0%, #6ee7b7 52%, #20f4c0 100%);
}

.vr-cycle-card-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 0.82fr) minmax(0, 1.36fr);
  gap: 8px;
  margin-top: 12px;
}

.vr-cycle-card {
  min-width: 0;
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(137, 124, 164, 0.62);
  border-radius: 14px;
  background: #15101f;
}

.vr-cycle-card > span {
  min-width: 0;
  color: #cfc5ff;
  font-size: 12px;
  font-weight: 740;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.vr-cycle-card strong {
  min-width: 0;
  color: #a78bfa;
  font-size: 15px;
  font-weight: 920;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.vr-cycle-card strong.date {
  font-size: 13px;
}

.vr-cycle-card.start > span,
.vr-cycle-card.start strong {
  color: #fff;
}

.vr-cycle-card.pool {
  justify-items: center;
  text-align: center;
}

.vr-cycle-card .pool-usage {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  color: #fff;
}

.vr-cycle-card .pool-usage .used {
  color: var(--purple);
}

.vr-cycle-card .pool-usage .slash {
  color: #fff;
}

.vr-cycle-card .pool-usage .limit {
  color: #fff;
}

.vr-current-empty {
  min-height: 100px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.stat.quantity span,
.stat.quantity strong {
  color: #20f4c0;
}

.stat.price span,
.stat.price strong {
  color: #6ea8ff;
}

.stat.tvalue span,
.stat.tvalue strong {
  color: #b78cff;
}

.stat.cash span,
.stat.cash strong {
  color: #28d7ff;
}

.stat.portion span,
.stat.portion strong {
  color: #ff9f43;
}

.stat.allocation span,
.stat.allocation strong {
  color: var(--value-mint);
}

.stat.valuation span,
.stat.valuation strong {
  color: var(--text);
}

.ticker-section,
.vr-section,
.history-section {
  margin-top: 24px;
}

.section-title-row {
  margin-bottom: 12px;
}

.ticker-grid,
.vr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.manual-vr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.ticker-card {
  min-width: 0;
  padding: 20px;
}

.tvalue-hero {
  display: grid;
  gap: 16px;
  margin-top: 14px;
  margin-bottom: 18px;
}

.tvalue-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tvalue-label {
  color: #b9d1ff;
  font-size: 12px;
  font-weight: 860;
  letter-spacing: 0.08em;
}

.tvalue-phase {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(91, 152, 255, 0.58);
  border-radius: 999px;
  color: #b9d1ff;
  background: rgba(63, 140, 255, 0.18);
  font-size: 12px;
  font-weight: 840;
  white-space: nowrap;
}

.tvalue-value {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: #e1d9ff;
  line-height: 0.95;
}

.tvalue-value strong {
  color: #fff;
  font-size: clamp(42px, 5vw, 56px);
  font-weight: 880;
}

.tvalue-value span,
.tvalue-value b {
  color: #c7c0e8;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 820;
}

.tvalue-progress {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: #302940;
}

.tvalue-progress-fill {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #6aa7ff 0%, #ffcc33 100%);
}

.tvalue-progress-marker {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ffcc33;
  box-shadow: 0 0 0 2px rgba(106, 167, 255, 0.55);
  transform: translate(-50%, -50%);
}

.tvalue-scale {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  color: #b9d1ff;
  font-size: 11px;
  font-weight: 760;
}

.tvalue-scale span:nth-child(2) {
  text-align: center;
}

.tvalue-scale span:last-child {
  text-align: right;
}

.ticker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
}

.ticker-title,
.ticker-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.ticker-title strong {
  font-size: 24px;
  line-height: 1.1;
}

.market-badge,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: #100c18;
  font-size: 12px;
  font-weight: 700;
}

.market-badge.us {
  color: #d9e5ff;
  border-color: rgba(76, 143, 255, 0.52);
}

.market-badge.kr {
  color: #cffff0;
  border-color: rgba(25, 230, 164, 0.48);
}

.chip.reverse {
  color: #ffdf79;
  border-color: rgba(255, 204, 51, 0.5);
}

.chip.quiet {
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.stat {
  grid-column: span 2;
  min-width: 0;
  min-height: 84px;
  display: grid;
  grid-template-rows: auto auto 14px;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #100c18;
}

.stat.allocation,
.stat.pnl,
.stat.valuation {
  grid-column: span 2;
}

.stat strong {
  min-width: 0;
  font-size: 16px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.stat-value-row strong {
  min-width: 0;
}

.positive strong,
.positive,
.positive .stat-side {
  color: var(--profit);
}

.negative strong,
.negative,
.negative .stat-side {
  color: var(--loss);
}

.neutral strong,
.neutral {
  color: var(--soft);
}

.stat.pnl strong {
  font-size: 18px;
  font-weight: 860;
}

.stat.pnl.positive strong {
  color: var(--pnl-gain);
}

.stat.pnl.negative strong {
  color: var(--pnl-loss);
}

.stat.pnl.neutral strong {
  color: var(--soft);
}

.stat.pnl .stat-sub {
  color: var(--muted);
}

.ticker-card .stat:not(.pnl) .stat-label-row span,
.ticker-card .stat:not(.pnl) .stat-sub {
  color: var(--muted);
}

.ticker-card .stat:not(.pnl) strong,
.ticker-card .stat:not(.pnl) .stat-side {
  color: var(--text);
}

.ticker-card .stat.positive strong,
.ticker-card .stat.positive .stat-side {
  color: var(--green);
}

.ticker-card .stat.negative strong,
.ticker-card .stat.negative .stat-side {
  color: var(--red);
}

.ticker-card .stat.neutral strong,
.ticker-card .stat.neutral .stat-side {
  color: var(--soft);
}

.ticker-card .stat.quantity strong,
.ticker-card .stat.quantity .stat-side {
  color: #00e0ff;
}

.ticker-card .stat.price strong,
.ticker-card .stat.price .stat-side {
  color: #ffb000;
}

.ticker-card .stat.tvalue strong,
.ticker-card .stat.tvalue .stat-side {
  color: #c98bff;
}

.ticker-card .stat.cash strong,
.ticker-card .stat.cash .stat-side {
  color: #ff6fcb;
}

.ticker-card .stat.allocation strong,
.ticker-card .stat.allocation .stat-side,
.ticker-card .stat.allocation .stat-sub {
  color: var(--value-mint);
}

.ticker-card .stat.portion strong,
.ticker-card .stat.portion .stat-side,
.ticker-card .stat.portion .stat-sub {
  color: var(--value-violet);
}

.ticker-card .stat.valuation strong,
.ticker-card .stat.valuation .stat-side {
  color: var(--text);
}

.ticker-card .stat.accent strong,
.ticker-card .stat.accent .stat-side {
  color: #ffdf5a;
}

.vr-card {
  min-width: 0;
  position: relative;
  overflow: hidden;
  padding: 16px;
}

.vr-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #ffb000, #19e6a4, #28d7ff, #b78cff);
}

.vr-card.us::before {
  background: linear-gradient(90deg, #6aa7ff, #28d7ff, #b78cff, #ff6fcb);
}

.vr-card.kr::before {
  background: linear-gradient(90deg, #ffb000, #7cff72, #20f4c0, #28d7ff);
}

.vr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
}

.vr-title {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.vr-title strong {
  min-width: 0;
  font-size: 22px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.vr-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.chip.vr-status.active {
  color: #19e6a4;
  border-color: rgba(25, 230, 164, 0.48);
}

.chip.vr-status.pending,
.chip.vr-status.setup {
  color: #ffdf79;
  border-color: rgba(255, 204, 51, 0.5);
}

.chip.vr-status.locked,
.chip.vr-status.stopped {
  color: #ff8fa3;
  border-color: rgba(255, 63, 95, 0.48);
}

.vr-account-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px 18px 14px;
  border: 1px solid rgba(137, 124, 164, 0.62);
  border-radius: 16px;
  background: linear-gradient(145deg, #15101f 0%, #100c18 100%);
}

.vr-account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vr-account-head strong {
  color: #fff;
  font-size: 14px;
  font-weight: 860;
}

.vr-account-yield {
  color: var(--muted);
  font-size: 12px;
  font-weight: 860;
  white-space: nowrap;
}

.vr-account-yield.positive {
  color: #20f4c0;
}

.vr-account-yield.negative {
  color: #ff6f8c;
}

.vr-account-rows {
  display: grid;
  gap: 6px;
}

.vr-account-row {
  min-width: 0;
  min-height: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(35, 29, 48, 0.82);
}

.vr-account-row span {
  min-width: 0;
  display: grid;
  gap: 2px;
  color: #fff;
  font-size: 12px;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.vr-account-row small {
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.vr-account-row strong {
  min-width: 0;
  color: #f7f2ff;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.vr-account-row.pool strong {
  color: #b78cff;
}

.vr-account-row.average strong {
  color: #ff6f8c;
}

.vr-account-note {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  line-height: 1.35;
  text-align: right;
}

.vr-pool-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(137, 124, 164, 0.62);
  border-radius: 16px;
  background: linear-gradient(145deg, #15101f 0%, #100c18 100%);
}

.vr-pool-head,
.vr-pool-body,
.vr-pool-split {
  min-width: 0;
}

.vr-pool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vr-pool-head strong {
  color: #fff;
  font-size: 14px;
  font-weight: 860;
}

.vr-pool-mode {
  color: #fff;
  font-size: 12px;
  font-weight: 860;
  white-space: nowrap;
}

.vr-pool-mode.recurring {
  color: #fff;
}

.vr-pool-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: center;
  gap: 16px;
}

.vr-pool-rows {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.vr-pool-row {
  min-width: 0;
  min-height: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(35, 29, 48, 0.82);
}

.vr-pool-row span {
  min-width: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.vr-pool-row strong {
  min-width: 0;
  color: #f7f2ff;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.vr-pool-row.positive strong,
.vr-pool-row.next strong {
  color: #20f4c0;
}

.vr-pool-row.negative strong {
  color: #ff6f8c;
}

.vr-pool-row.pool strong {
  color: #b78cff;
}

.vr-pool-row.muted strong {
  color: #fff;
}

.vr-pool-donut {
  width: 104px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    #ffdf5a 0deg var(--holding-deg, 0deg),
    #a78bfa var(--holding-deg, 0deg) var(--pool-end-deg, 0deg),
    #100c18 var(--pool-end-deg, 0deg) 360deg
  );
  box-shadow: 0 0 22px rgba(167, 139, 250, 0.18);
}

.vr-pool-donut-center {
  width: 58%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border-radius: 50%;
  background: #100c18;
  text-align: center;
}

.vr-pool-donut-center span {
  color: #fff;
  font-size: 9px;
  font-weight: 760;
}

.vr-pool-donut-center strong {
  color: #fffaf1;
  font-size: 11px;
  font-weight: 920;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.vr-pool-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.vr-pool-chip {
  min-width: 0;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid rgba(167, 139, 250, 0.42);
  border-radius: 8px;
  color: #fff;
  background: rgba(35, 29, 48, 0.9);
  font-size: 11px;
  font-weight: 860;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.vr-pool-chip-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.vr-pool-chip-value {
  margin-left: auto;
  color: inherit;
  font-size: inherit;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.vr-pool-chip.holding {
  color: #ffdf5a;
  border-color: rgba(255, 223, 90, 0.46);
}

.vr-pool-chip.pool {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(35, 29, 48, 0.9);
}

.vr-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.vr-stat-grid .stat {
  grid-column: auto;
  min-height: 62px;
  grid-template-rows: auto auto;
  gap: 4px;
  padding: 9px 10px;
}

.vr-stat-grid .stat-sub {
  display: none;
}

.stat.vr-v span,
.stat.vr-v strong {
  color: #ffb000;
}

.stat.vr-pool span,
.stat.vr-pool strong {
  color: #19e6a4;
}

.stat.vr-total span,
.stat.vr-total strong {
  color: #28d7ff;
}

.stat.vr-qty span,
.stat.vr-qty strong {
  color: #ff6fcb;
}

.stat.vr-g span,
.stat.vr-g strong {
  color: #7cff72;
}

.stat.vr-band-width span,
.stat.vr-band-width strong {
  color: #b78cff;
}

.stat.vr-cycle span,
.stat.vr-cycle strong {
  color: #6ea8ff;
}

.stat.vr-init-buy span,
.stat.vr-init-buy strong {
  color: #ff9f43;
}

.stat.vr-buy-ratio span,
.stat.vr-buy-ratio strong {
  color: #19e6a4;
}

.stat.vr-sell-ratio span,
.stat.vr-sell-ratio strong {
  color: #ff6fcb;
}

.stat.vr-pool-guard span,
.stat.vr-pool-guard strong {
  color: #28d7ff;
}

.stat.vr-tracking span,
.stat.vr-tracking strong,
.stat.vr-restart span,
.stat.vr-restart strong {
  color: #20f4c0;
}

.stat.vr-off span,
.stat.vr-off strong {
  color: var(--muted);
}

.stat.vr-buy-rsi span,
.stat.vr-buy-rsi strong {
  color: #ffdf5a;
}

.stat.vr-sell-rsi span,
.stat.vr-sell-rsi strong {
  color: #ff8fa3;
}

.stat.vr-date span,
.stat.vr-date strong {
  color: #ffdf5a;
}

.vr-band-box {
  min-width: 0;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #100c18;
}

.vr-close-trend-box {
  margin-top: 14px;
}

.vr-band-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.vr-band-head strong {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.2;
}

.vr-band-status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* Directional glyph makes the band state legible at a glance. Scoped to the
   band tones only, so the 보유 yield badge (positive/negative) keeps no glyph. */
.vr-band-status.in_band::before { content: "\25CF"; font-size: 9px; line-height: 1; }
.vr-band-status.below::before { content: "\25BC"; font-size: 10px; line-height: 1; }
.vr-band-status.above::before { content: "\25B2"; font-size: 10px; line-height: 1; }

/* In-band = normal: clearly readable but calm. */
.vr-band-status.in_band {
  color: #d8fff1;
  border-color: rgba(25, 230, 164, 0.62);
  background: rgba(25, 230, 164, 0.16);
}

/* Out-of-band = attention: solid colored chip + soft glow so 하단 이탈 /
   상단 초과 stand out from the calm in-band state. */
.vr-band-status.below {
  color: #ffffff;
  border-color: rgba(63, 140, 255, 0.9);
  background: rgba(63, 140, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(63, 140, 255, 0.25), 0 2px 9px rgba(63, 140, 255, 0.4);
}

.vr-band-status.above {
  color: #ffffff;
  border-color: rgba(255, 63, 95, 0.9);
  background: rgba(255, 63, 95, 0.85);
  box-shadow: 0 0 0 1px rgba(255, 63, 95, 0.25), 0 2px 9px rgba(255, 63, 95, 0.42);
}

.vr-band-status.positive {
  color: #ffd6df;
  border-color: rgba(255, 63, 95, 0.48);
  background: rgba(255, 63, 95, 0.1);
}

/* 졸업("완료") 배지 — 차트 졸업 마커(#ffcc33)와 같은 금색 계열로 통일. */
.vr-band-status.graduation-mark {
  color: #ffe9a8;
  border-color: rgba(255, 204, 51, 0.6);
  background: rgba(255, 204, 51, 0.14);
}

.vr-band-status.negative {
  color: #d9e5ff;
  border-color: rgba(63, 140, 255, 0.48);
  background: rgba(63, 140, 255, 0.1);
}

.vr-yield-chart,
.vr-band-chart {
  width: 100%;
  height: 210px;
  border-radius: 8px;
  background: #110d19;
}

@media (hover: none), (pointer: coarse) {
  .mini-chart,
  .gauge-chart,
  .fng-trend-chart,
  .portfolio-chart,
  .vr-yield-chart,
  .vr-band-chart,
  .manual-vr-band-chart,
  .manual-vr-yield-chart {
    pointer-events: none;
  }
}

.vr-trade-box {
  min-width: 0;
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.vr-trade-title {
  color: var(--soft);
  font-size: 13px;
  font-weight: 780;
}

.vr-trade-list {
  display: grid;
  gap: 7px;
}

.vr-trade-item {
  min-height: 38px;
  display: grid;
  grid-template-columns: 58px 48px minmax(0, 1fr) 96px minmax(116px, auto);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #100c18;
  color: var(--soft);
  font-size: 12px;
}

.vr-trade-date,
.vr-trade-amount,
.order-time {
  color: var(--muted);
  white-space: nowrap;
}

.vr-trade-amount {
  justify-self: end;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.vr-trade-side {
  font-weight: 820;
}

.vr-trade-side.buy {
  color: var(--profit);
}

.vr-trade-side.sell {
  color: var(--loss);
}

.vr-trade-side.adjustment {
  color: var(--muted);
}

.vr-trade-side.graduation {
  color: var(--amber);
}

.vr-trade-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.realized-pnl {
  justify-self: end;
  text-align: right;
  font-size: 12px;
  font-weight: 840;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.realized-pnl.positive {
  color: var(--pnl-gain);
}

.realized-pnl.negative {
  color: var(--pnl-loss);
}

.realized-pnl.neutral {
  color: var(--soft);
}

.vr-trade-empty {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #100c18;
  color: var(--muted);
  font-size: 12px;
}

.vr-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

.chart-box {
  min-width: 0;
}

.chart-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.mini-chart {
  width: 100%;
  height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #110d19;
}

.close-trend-box {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #100c18;
}

.close-trend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.close-trend-head strong {
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.close-trend-controls {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.close-holding-yield {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  font-weight: 840;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.close-holding-yield.positive {
  color: var(--pnl-gain);
  border-color: rgba(50, 214, 106, 0.36);
  background: rgba(50, 214, 106, 0.08);
}

.close-holding-yield.negative {
  color: var(--pnl-loss);
  border-color: rgba(255, 96, 104, 0.4);
  background: rgba(255, 96, 104, 0.09);
}

.range-select {
  height: 32px;
  min-width: 78px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--soft);
  background: #20182d;
  font-size: 12px;
  font-weight: 760;
}

.range-select:focus {
  border-color: var(--purple);
  outline: none;
}

.range-return {
  min-width: 58px;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.range-return.holding-yield-return {
  min-width: 78px;
}

.range-return.holding-yield-return.positive {
  color: var(--pnl-gain);
}

.range-return.holding-yield-return.negative {
  color: var(--pnl-loss);
}

.range-return.holding-yield-return.neutral {
  color: var(--soft);
}

.close-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.close-stat {
  min-width: 0;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px;
  border-radius: 7px;
  background: var(--panel-2);
}

.close-stat span {
  color: #bca9e8;
  font-size: 11px;
  text-align: center;
}

.close-stat strong {
  min-width: 0;
  color: var(--value-blue);
  font-size: 14px;
  text-align: center;
  overflow-wrap: anywhere;
}

.close-stat.current strong {
  color: var(--purple);
}

/* 평가손익 cell: gain=red, loss=blue (KR convention), with 수익률 sub-line. */
.close-stat.positive strong {
  color: var(--pnl-gain);
}

.close-stat.negative strong {
  color: var(--pnl-loss);
}

.close-stat .close-stat-sub {
  font-size: 11px;
  font-weight: 760;
  text-align: center;
  margin-top: -1px;
}

.close-stat .close-stat-sub.positive {
  color: var(--pnl-gain);
}

.close-stat .close-stat-sub.negative {
  color: var(--pnl-loss);
}

.close-stat .close-stat-sub.neutral {
  color: var(--soft);
}

.close-trend-chart {
  height: 220px;
  border: 0;
  background: transparent;
}

.empty-chart,
.empty-panel {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.empty-panel {
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.order-block {
  margin-top: 16px;
}

.order-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.order-item,
.empty-row {
  min-height: 40px;
  display: grid;
  grid-template-columns: 52px 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #100c18;
  color: var(--soft);
  font-size: 13px;
}

.empty-row {
  display: flex;
  color: var(--muted);
}

.side {
  font-weight: 800;
}

.side.buy {
  color: var(--profit);
}

.side.sell {
  color: var(--loss);
}

.side.graduation {
  color: var(--amber);
}

.history-table-wrap {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 14px;
}

.history-table th,
.history-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.history-table th:first-child,
.history-table td:first-child {
  text-align: left;
}

.history-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-table tr:last-child td {
  border-bottom: 0;
}

.portfolio-chart-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.portfolio-chart-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.portfolio-chart {
  width: 100%;
  height: 280px;
  margin-top: 8px;
  border-radius: 8px;
  background: #100c18;
}

.portfolio-flow-section {
  margin-bottom: 16px;
}

.overview-chart-section {
  margin-bottom: 16px;
}

.overview-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.overview-chart-grid .close-trend-box,
.manual-overview-band-box {
  margin-top: 0;
  min-width: 0;
}

/* Attention border: 상단 초과=빨강, 하단 미만=파랑 — 사용자가 대응해야 하는 상태.
   두꺼운 테두리 + 강한 글로우 + 은은한 깜빡임 + 배경 틴트로 강하게 강조. */
.manual-overview-band-box.band-alert-above {
  border-width: 2px;
  border-color: rgba(255, 63, 95, 0.95);
  background: linear-gradient(180deg, rgba(255, 63, 95, 0.1), rgba(255, 63, 95, 0.03)), #100c18;
  animation: band-alert-pulse-above 1.6s ease-in-out infinite;
}

.manual-overview-band-box.band-alert-below {
  border-width: 2px;
  border-color: rgba(63, 140, 255, 0.98);
  background: linear-gradient(180deg, rgba(63, 140, 255, 0.1), rgba(63, 140, 255, 0.03)), #100c18;
  animation: band-alert-pulse-below 1.6s ease-in-out infinite;
}

@keyframes band-alert-pulse-above {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(255, 63, 95, 0.45), 0 0 18px rgba(255, 63, 95, 0.4);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(255, 63, 95, 0.85), 0 0 34px rgba(255, 63, 95, 0.8);
  }
}

@keyframes band-alert-pulse-below {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(63, 140, 255, 0.45), 0 0 18px rgba(63, 140, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(63, 140, 255, 0.85), 0 0 34px rgba(63, 140, 255, 0.8);
  }
}

/* 접근성: 모션 최소화 설정 시 깜빡임 없이 강한 정적 강조만 유지. */
@media (prefers-reduced-motion: reduce) {
  .manual-overview-band-box.band-alert-above,
  .manual-overview-band-box.band-alert-below {
    animation: none;
  }
  .manual-overview-band-box.band-alert-above {
    box-shadow: 0 0 0 3px rgba(255, 63, 95, 0.7), 0 0 26px rgba(255, 63, 95, 0.6);
  }
  .manual-overview-band-box.band-alert-below {
    box-shadow: 0 0 0 3px rgba(63, 140, 255, 0.7), 0 0 26px rgba(63, 140, 255, 0.6);
  }
}

.manual-overview-band-box .manual-vr-band-chart {
  height: 260px;
}

.manual-vr-overview-meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.manual-vr-yield-badge,
.manual-vr-pnl-badge {
  font-variant-numeric: tabular-nums;
}

.portfolio-flow-panel {
  padding: 16px;
}

.portfolio-flow-chart {
  height: 300px;
}

#portfolio-total-flow-current {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(25, 230, 164, 0.34);
  border-radius: 8px;
  background: rgba(25, 230, 164, 0.08);
  color: var(--soft);
  font-weight: 860;
  white-space: nowrap;
}

#portfolio-total-flow-current.positive {
  color: var(--pnl-gain);
  border-color: rgba(50, 214, 106, 0.42);
  background: rgba(50, 214, 106, 0.09);
}

#portfolio-total-flow-current.negative {
  color: var(--pnl-loss);
  border-color: rgba(255, 96, 104, 0.44);
  background: rgba(255, 96, 104, 0.1);
}
.portfolio-holding-graph-panel {
  min-width: 0;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.portfolio-chart-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.portfolio-chart-stat {
  display: grid;
  place-items: center;
  min-height: 58px;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  text-align: center;
}

.portfolio-chart-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.portfolio-chart-stat strong {
  max-width: 100%;
  color: #d8d0ff;
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.portfolio-chart-stat strong.positive {
  color: var(--pnl-gain);
}

.portfolio-chart-stat strong.negative {
  color: var(--pnl-loss);
}

.portfolio-holding-chart {
  height: 320px;
  margin-top: 0;
}

.portfolio-section {
  margin-top: 24px;
}

.portfolio-total-grid .metric {
  min-height: 86px;
}

.metric.portfolio-total .metric-label,
.metric.portfolio-total .metric-value {
  color: var(--value-mint);
}

.metric.portfolio-holdings .metric-label,
.metric.portfolio-holdings .metric-value {
  color: var(--value-blue);
}

.portfolio-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.portfolio-card {
  min-width: 0;
  min-height: 164px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.portfolio-card-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.portfolio-card-head strong {
  min-width: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.portfolio-card-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.portfolio-card-value {
  min-width: 0;
  color: var(--value-mint);
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.portfolio-card-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.portfolio-card-pnl {
  min-width: 0;
  font-size: 14px;
  font-weight: 860;
  overflow-wrap: anywhere;
}

.portfolio-card-pnl.positive {
  color: var(--pnl-gain);
}

.portfolio-card-pnl.negative {
  color: var(--pnl-loss);
}

.portfolio-card-pnl.neutral {
  color: var(--soft);
}

.portfolio-card.vr_auto .portfolio-card-value {
  color: var(--value-cyan);
}

.portfolio-card.manual_vr .portfolio-card-value {
  color: var(--value-violet);
}

.portfolio-card.owner .portfolio-card-value {
  color: var(--value-blue);
}

.portfolio-table {
  min-width: 1040px;
}

.portfolio-table td:nth-child(3) {
  min-width: 180px;
}

.portfolio-table td:nth-child(3) strong,
.portfolio-table td:nth-child(3) span {
  display: block;
}

.portfolio-table td:nth-child(3) strong {
  color: var(--text);
  font-size: 13px;
}

.portfolio-table td:nth-child(3) span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.portfolio-table th:nth-child(1),
.portfolio-table td:nth-child(1),
.portfolio-table th:nth-child(2),
.portfolio-table td:nth-child(2),
.portfolio-table th:nth-child(3),
.portfolio-table td:nth-child(3),
.portfolio-table th:nth-child(4),
.portfolio-table td:nth-child(4) {
  text-align: left;
}

.empty-table {
  color: var(--muted);
  text-align: center !important;
}

.fng-body {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 12px;
  padding-top: 4px;
}

.fng-score-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.fng-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.fng-score strong {
  color: var(--green);
  font-size: 40px;
  line-height: 0.95;
  font-weight: 820;
  letter-spacing: 0;
}

.fng-score span {
  color: var(--green);
  font-size: 18px;
  font-weight: 760;
}

.fng-score.fear strong,
.fng-score.fear span {
  color: var(--amber);
}

.fng-score.extreme-fear strong,
.fng-score.extreme-fear span {
  color: var(--red);
}

.fng-source {
  color: #8d7da6;
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
  white-space: nowrap;
}

.fng-scale {
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff4f62 0%, #ff8a22 25%, #ffcc33 50%, #6fc83f 68%, #19e6a4 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.fng-scale.risk,
.fng-scale.vkospi,
.fng-scale.vix {
  background: linear-gradient(90deg, #19e6a4 0%, #a8d83f 22%, #ffcc33 42%, #ff8a22 66%, #ff4f62 100%);
}

.fng-marker {
  position: absolute;
  top: 50%;
  width: 3px;
  height: 19px;
  border-radius: 999px;
  background: var(--text);
  box-shadow: 0 0 0 3px rgba(251, 247, 255, 0.14);
  transform: translate(-50%, -50%);
}

.fng-scale-labels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  color: #746982;
  font-size: 10px;
}

.fng-scale-labels span:nth-child(2),
.fng-scale-labels span:nth-child(3),
.fng-scale-labels span:nth-child(4),
.fng-scale-labels span:nth-child(5) {
  text-align: center;
}

.fng-scale-labels span:last-child {
  text-align: right;
}

.fng-trend-chart {
  min-height: 150px;
  border-radius: 8px;
  background: #110d19;
}

@media (max-width: 1080px) {
  .overview-grid,
  .ticker-grid,
  .vr-grid,
  .portfolio-chart-section,
  .portfolio-card-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding-inline: 12px;
  }

  .portfolio-flow-panel .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .portfolio-flow-chart {
    height: 280px;
  }
  .portfolio-chart-stats {
    grid-template-columns: 1fr;
  }

  .portfolio-holding-chart {
    height: 300px;
  }
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: flex-start;
    gap: 12px;
  }

  .brand {
    align-items: flex-start;
    width: 100%;
    gap: 12px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  h1 {
    font-size: 28px;
  }

  .meta-line {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
    row-gap: 3px;
    width: 100%;
    margin-top: 6px;
    font-size: 12px;
  }

  .meta-line span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .meta-line span + span::before {
    margin-right: 8px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 42px;
    width: 100%;
    gap: 8px;
    padding-left: 0;
  }

  .mode-toggle,
  .status-pill {
    height: 38px;
  }

  .mode-toggle {
    justify-content: center;
  }

  .icon-button {
    width: 42px;
    height: 38px;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .portfolio-total-grid {
    grid-template-columns: 1fr;
  }

  .account-grid .metric {
    min-height: 64px;
    padding: 10px 12px;
  }

  .account-grid .metric-value {
    font-size: 20px;
  }

  .vr-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .manual-vr-stats .metric-value,
  .manual-vr-stats .metric.pnl .metric-value {
    font-size: 13px;
  }

  .manual-vr-band-chart {
    height: 190px;
  }

  .manual-vr-yield-chart {
    height: 150px;
  }

  .stat-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
  }

  #us-summary-grid,
  #kr-summary-grid,
  .vr-daily-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #us-summary-grid .metric,
  #kr-summary-grid .metric,
  .vr-daily-summary-grid .metric {
    padding: 10px 7px;
  }

  #us-summary-grid .metric-sub,
  #kr-summary-grid .metric-sub,
  .vr-daily-summary-grid .metric-sub {
    font-size: 9px;
    white-space: normal;
  }

  .chart-row {
    grid-template-columns: 1fr;
  }

  .strategy-tabs {
    gap: 6px;
  }

  .tab-button {
    min-height: 42px;
    padding: 0 10px;
    font-size: 13px;
    line-height: 1.15;
    white-space: nowrap;
    text-align: center;
  }

  .tab-soon {
    font-size: 11px;
  }

  .ticker-head {
    flex-direction: column;
  }

  .vr-head {
    flex-direction: column;
  }

  .ticker-card,
  .vr-card {
    padding: 14px;
  }

  .vr-account-card {
    padding: 14px;
  }

  .vr-pool-card {
    padding: 14px;
  }

  .vr-pool-body {
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 12px;
  }

  .vr-pool-donut {
    width: 88px;
  }

  .vr-pool-row {
    gap: 8px;
    padding: 8px 10px;
  }

  .vr-pool-chip {
    min-height: 30px;
    padding: 0 8px;
    font-size: 10px;
  }

  .vr-account-row {
    gap: 8px;
    padding: 8px 10px;
  }

  .vr-account-note {
    text-align: left;
    overflow-wrap: anywhere;
  }

  .vr-current-card {
    min-height: 212px;
    padding: 26px 18px 24px;
    border-radius: 20px;
  }

  .vr-current-value {
    margin-top: 10px;
    font-size: clamp(25px, 9.8vw, 34px);
  }

  .vr-current-band-text {
    margin-top: 10px;
  }

  .vr-current-scale-labels {
    margin-top: 28px;
    font-size: 9px;
  }

  .vr-current-progress {
    height: 8px;
    margin-top: 8px;
    background: #2c253d;
    box-shadow: none;
  }

  .vr-current-progress-fill {
    min-width: 6px;
    filter: none;
    box-shadow: 0 0 22px rgba(85, 215, 207, 0.22);
  }

  .vr-current-card.kr .vr-current-progress-fill {
    background: linear-gradient(90deg, #ffb000 0%, #6ee7b7 52%, #20f4c0 100%);
  }

  .vr-cycle-card-grid {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 0.82fr) minmax(0, 1.36fr);
    gap: 7px;
  }

  .vr-cycle-card {
    min-height: 64px;
    padding: 10px 11px;
  }

  .vr-cycle-card > span {
    font-size: 11px;
  }

  .vr-cycle-card strong {
    font-size: 13px;
  }

  .vr-cycle-card strong.date {
    font-size: 11px;
  }

  .vr-cycle-card .pool-usage {
    gap: 4px;
  }

  .stat {
    min-height: 82px;
    padding: 10px;
  }

  .stat strong {
    font-size: 15px;
  }

  .vr-trade-item {
    grid-template-columns: 42px 36px minmax(92px, 1fr) minmax(72px, auto);
    gap: 6px;
    font-size: 11px;
  }

  .vr-trade-item strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .vr-trade-amount {
    grid-column: auto;
    justify-self: end;
    text-align: right;
    font-size: 11px;
  }

  .vr-trade-pnl {
    grid-column: 3 / -1;
    justify-self: end;
    text-align: right;
    font-size: 11px;
  }

  .order-item {
    grid-template-columns: 42px 48px minmax(0, 1fr);
  }

  .order-pnl {
    grid-column: 3;
  }
}

@media (max-width: 720px) {
  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-grid .metric.account-deposit {
    display: none;
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding-inline: 8px;
  }

  .ticker-card {
    padding: 10px;
  }

  .stat-grid {
    gap: 6px;
  }

  .vr-stat-grid {
    gap: 6px;
  }

  .stat {
    min-height: 80px;
    gap: 5px;
    padding: 8px 7px;
  }

  .stat.allocation,
  .stat.pnl,
  .stat.valuation {
    grid-column: span 3;
  }

  .stat span {
    font-size: 11px;
  }

  .stat-sub {
    font-size: 9px;
  }

  .stat strong {
    font-size: 13px;
  }

  .stat.pnl strong {
    font-size: 15px;
  }

  .tvalue-hero {
    gap: 13px;
  }

  .tvalue-value strong {
    font-size: 40px;
  }

  .tvalue-value span,
  .tvalue-value b {
    font-size: 24px;
  }
}

/* ===== 수동 VR (manual_vr) tab ===== */
.vr-card.manual.kr::before {
  background: linear-gradient(90deg, #b78cff, #28d7ff, #19e6a4, #ffb000);
}

.vr-card.manual.us::before {
  background: linear-gradient(90deg, #ff6fcb, #b78cff, #28d7ff, #6aa7ff);
}

.manual-vr-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.manual-vr-stats .metric {
  min-height: 72px;
  padding: 11px;
}

.manual-vr-stats .metric-value-row {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.manual-vr-stats .metric-value {
  font-size: clamp(14px, 1.35vw, 19px);
  line-height: 1.08;
  overflow-wrap: normal;
  word-break: keep-all;
}

.manual-vr-stats .metric-side {
  white-space: nowrap;
}

.manual-vr-stats .metric.pnl .metric-value {
  font-size: clamp(14px, 1.35vw, 19px);
}

.manual-close-trend-box {
  margin-top: 14px;
}

.manual-vr-chart-panel {
  min-width: 0;
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #100c18;
}

.manual-vr-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  /* As a grid item inside .manual-vr-chart-panel, default min-width:auto would
     let a long title widen the header (and the chart below) and push the chips
     out of the card. min-width:0 keeps the header at the card width so only the
     title shrinks/fades while the chips stay anchored right. */
  min-width: 0;
}

.manual-vr-chart-head.compact {
  margin-top: 2px;
}

.manual-vr-chart-head strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* Overview band card: status dot + title on one line (left), badges (right).
   긴 종목명은 오른쪽 칩 자리를 침범하지 않고, 칩에 닿기 전에 자연스럽게
   페이드되며 칩 밑으로 사라진다 (칩은 원래 위치 고정). */
.manual-vr-overview-title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent);
}

.manual-vr-overview-title strong {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  overflow-wrap: normal;
}

.manual-vr-band-dot {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
}

.manual-vr-band-dot.in_band {
  background: #19e6a4;
  box-shadow: 0 0 0 3px rgba(25, 230, 164, 0.18);
}

.manual-vr-band-dot.below {
  background: #3f8cff;
  box-shadow: 0 0 0 3px rgba(63, 140, 255, 0.18);
}

.manual-vr-band-dot.above {
  background: #ff3f5f;
  box-shadow: 0 0 0 3px rgba(255, 63, 95, 0.18);
}

.manual-vr-band-chart,
.manual-vr-yield-chart {
  width: 100%;
  height: 210px;
  border-radius: 8px;
  background: transparent;
}

.manual-vr-yield-chart {
  height: 170px;
}

.manual-vr-group {
  margin-top: 24px;
}

.manual-vr-group .section-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.manual-vr-group h3 {
  margin: 0;
  font-size: 18px;
}

.metric.input-pending .metric-value {
  color: var(--muted);
  opacity: 0.6;
}

.metric.warn .metric-side {
  color: #ffb000;
}

@media (max-width: 760px) {
  .overview-chart-grid {
    grid-template-columns: 1fr;
  }
}
