:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --line: #d9e0e7;
  --text: #19212a;
  --muted: #66717f;
  --accent: #0f766e;
  --accent-2: #2563eb;
  --danger: #b42318;
  --warn: #b7791f;
  --ok: #16794c;
}

* {
  box-sizing: border-box;
  overflow-anchor: none;
}

/* display:flex/grid 등 작성자 규칙이 UA의 [hidden]을 덮는 것을 방지 — hidden은 항상 숨김 */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  height: 100vh;
  min-height: 100vh;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

.login-view {
  flex: 1 1 auto;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(360px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.login-panel h1 {
  font-size: 22px;
  text-align: center;
}

.login-fields {
  display: grid;
  gap: 8px;
}

.login-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-panel #loginBtn {
  min-height: 64px;
  justify-content: center;
}

.topbar {
  min-height: 46px; /* 기존 76px의 3/5 */
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 5px 20px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 2;
}

/* 헤더와 컨텐츠 사이 계좌 요약 바 — 좌측부터 표시하고 폭이 부족하면 가로 스크롤 */
.stats-bar {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 6px 20px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  white-space: nowrap;
  overflow-x: auto;
}

.trade-proposal-bar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 6px 20px;
  border-bottom: 1px solid #ead28a;
  background: #fff9df;
  color: #3d2d00;
}

.trade-proposal-main {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}

.trade-proposal-main strong,
.trade-proposal-main span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-proposal-main strong {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
}

.trade-proposal-main span {
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
}

.trade-proposal-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trade-proposal-actions button {
  min-height: 28px;
  padding: 0 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 900;
}

.trade-proposal-approve {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.trade-proposal-reject {
  border-color: #d9b85f;
  background: #ffffff;
  color: #5d4300;
}

.topbar-main {
  flex: 1 1 auto;
  width: auto;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  min-width: 0;
}

.brand-block {
  flex: 0 0 auto;
}

/* KOSPI·KOSDAQ·해외 지수 — 상단 우측 정렬 */
.kospi-index {
  flex: 0 0 auto;
  position: relative;
  margin-left: auto;
  transform: none;
  z-index: 3;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
  pointer-events: none;
}

@media (min-width: 1101px) {
  .topbar {
    flex-wrap: nowrap;
  }
}

.index-entry {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.index-entry + .index-entry {
  margin-left: 14px;
}

.kospi-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.index-entry.session-premarket .kospi-label {
  color: #16833a;
}

.index-entry.session-regular .kospi-label {
  color: var(--text);
}

.index-entry.session-after .kospi-label {
  color: #1d4ed8;
}

.index-entry.session-closed .kospi-label {
  color: #8b95a1;
}

.kospi-value {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.kospi-change {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.kospi-value.up,
.kospi-change.up {
  color: var(--danger);
}

.kospi-value.down,
.kospi-change.down {
  color: var(--accent-2);
}

.runtime-line {
  display: none;
}

.top-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.top-inline-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
  background: #ffffff;
  white-space: nowrap;
}

.tab-button {
  min-height: 32px;
  padding: 0 12px;
  white-space: nowrap;
}

.tab-button.active {
  background: var(--text);
  border-color: var(--text);
  color: #ffffff;
}

.logout-tab-button {
  color: var(--danger);
}

.exchange-rate-ticker {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.exchange-rate-ticker.is-stale {
  color: #7a8694;
  background: #f3f4f6;
}

.exchange-rate-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.exchange-rate-ticker strong {
  font-size: 13px;
  font-weight: 900;
}

.top-inline-actions .exchange-rate-ticker,
.top-inline-actions .logout-tab-button {
  flex: 0 0 auto;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.2;
}

h2 {
  font-size: 15px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.actions {
  flex: 0 0 auto;
  position: relative;
  z-index: 3;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.actions > button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.slide-toggle {
  --toggle-thumb-bg: #ffffff;
  --toggle-thumb-border: #c8d3df;
  --toggle-thumb-x-inset: 4px;
  --toggle-thumb-x-total: 8px;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  min-height: 32px;
  min-width: 132px;
  padding: 2px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef2f6;
}

.slide-toggle::before {
  box-sizing: border-box;
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: var(--toggle-thumb-x-inset);
  z-index: -1;
  width: calc((100% - var(--toggle-thumb-x-total)) / 2);
  border: 1px solid var(--toggle-thumb-border);
  border-radius: 999px;
  background: var(--toggle-thumb-bg);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  transition: left 160ms ease, background 160ms ease, border-color 160ms ease;
}

.slide-toggle.mode-mock::before,
.slide-toggle.engine-stopped::before,
.slide-toggle.ai-disabled::before {
  left: calc(50% + 2px);
}

.slide-toggle.mode-real,
.slide-toggle.mode-mock {
  --toggle-thumb-bg: #eaf1ff;
  --toggle-thumb-border: #bdd0f8;
}

.slide-toggle.engine-running {
  --toggle-thumb-bg: #e7f6ee;
  --toggle-thumb-border: #b8dfcb;
}

.slide-toggle.ai-enabled {
  --toggle-thumb-bg: #e7f6ee;
  --toggle-thumb-border: #b8dfcb;
}

.slide-toggle.engine-stopped {
  --toggle-thumb-bg: #fff6db;
  --toggle-thumb-border: #ecd789;
}

.slide-toggle.is-pending {
  --toggle-thumb-bg: #eaf1ff;
  --toggle-thumb-border: #9fb9eb;
  cursor: progress;
}

.slide-toggle.is-pending button {
  cursor: progress;
}

.slide-toggle.ai-disabled {
  --toggle-thumb-bg: #fff6db;
  --toggle-thumb-border: #ecd789;
}

.ai-bulk-toggle {
  min-width: 148px;
}

.slide-toggle button {
  min-height: 26px;
  border: 0;
  border-radius: 999px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.slide-toggle button:hover {
  border-color: transparent;
}

.slide-toggle button.active {
  color: var(--text);
}

.slide-toggle.slide-toggle-vertical {
  --toggle-thumb-y-inset: 3px;
  --toggle-thumb-y-total: 6px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-height: 42px;
  min-width: 48px;
  width: 52px;
  padding: 3px;
  border-radius: 12px;
}

.slide-toggle.slide-toggle-vertical.engine-toggle {
  min-width: 58px;
  width: 62px;
}

.slide-toggle.slide-toggle-vertical::before {
  top: var(--toggle-thumb-y-inset);
  right: 3px;
  bottom: auto;
  left: 3px;
  width: auto;
  height: calc((100% - var(--toggle-thumb-y-total)) / 2);
  transition: top 160ms ease, background 160ms ease, border-color 160ms ease;
}

.slide-toggle.slide-toggle-vertical.mode-mock::before,
.slide-toggle.slide-toggle-vertical.engine-stopped::before,
.slide-toggle.slide-toggle-vertical.ai-disabled::before {
  top: calc(50% + 0px);
  left: 3px;
}

.slide-toggle.slide-toggle-vertical button {
  min-height: 16px;
  padding: 0 2px;
  font-size: 10px;
  border-radius: 9px;
}

button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  border-color: #9fb0c0;
}

button:disabled {
  color: #9aa6b2;
  background: #eef2f6;
  border-color: var(--line);
  cursor: not-allowed;
}

button.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

button.danger {
  color: #ffffff;
  background: var(--danger);
  border-color: var(--danger);
}

.icon-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.icon-text-button.danger-outline {
  color: var(--danger);
  background: #ffffff;
  border-color: #f0c7c2;
}

.icon-text-button.danger-outline:hover {
  background: #fff5f4;
  border-color: var(--danger);
}

.layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
  padding: 14px;
}

.layout[data-active-tab="trading"] {
  grid-template-columns: 300px 300px minmax(0, 1fr);
}

.layout[data-active-tab="orders"],
.layout[data-active-tab="notice"],
.layout[data-active-tab="config"] {
  grid-template-columns: minmax(0, 1fr);
}

.layout[data-active-tab="orders"] .sidebar,
.layout[data-active-tab="notice"] .sidebar,
.layout[data-active-tab="config"] .sidebar {
  display: none;
}

.sidebar {
  height: 100%;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.sidebar-tabbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

.sidebar-tab-button {
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.sidebar-tab-button.active {
  border-color: #1f6fb2;
  background: #eaf4ff;
  color: #0f4f88;
}

.sidebar-tabbar > button:not(.sidebar-tab-button) {
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 6px;
}

.sidebar-tab-panel {
  min-height: 0;
  flex: 1 1 auto;
  display: none;
  flex-direction: column;
}

.sidebar-tab-panel.active {
  display: flex;
}

.inspect-pane-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.inspect-pane-head strong {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.inspect-count,
.inspect-venue {
  flex: none;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.inspect-count {
  color: #92400e;
}

.inspect-venue {
  min-width: 36px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #0f172a;
  text-align: center;
}

.inspect-list-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.inspect-empty {
  padding: 16px 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.inspect-research-summary {
  display: grid;
  gap: 5px;
  padding: 12px 10px;
  margin-bottom: 8px;
  border: 1px solid #d8e4e9;
  border-radius: 8px;
  background: #f2f7fa;
  color: #314754;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.inspect-row {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  background: #fff7e0;
}

.inspect-row:last-child {
  border-bottom: 0;
}

.inspect-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 6px;
  align-items: center;
}

.inspect-name {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}

.inspect-name strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.inspect-code {
  flex: none;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.inspect-change {
  text-align: right;
  color: var(--danger);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.inspect-stage {
  margin-top: 5px;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.inspect-check {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
}

.inspect-check span {
  color: #64748b;
  font-weight: 800;
}

.inspect-check strong {
  min-width: 0;
  color: #111827;
  font-weight: 800;
}

.inspect-check.is-pass strong {
  color: #166534;
}

.inspect-check.is-fail strong {
  color: #b45309;
}

.inspect-check.is-pending strong, .inspect-decision-time {
  color: #64748b;
}

.inspect-decision-time {
  margin-top: 4px;
  font-size: 11px;
}

.inspect-detail {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: normal;
}

.inspect-row.is-rejected .inspect-stage { color: #9a3412; }
.inspect-row.is-selected { background: #edf8ef; }

.workspace {
  min-width: 0;
  overflow: hidden;
  display: block;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 0;
  min-width: 0;
  padding: 14px;
}

.workspace > .panel {
  overflow: hidden;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.workspace-page.active {
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr); /* 상태 패널 단독 — 세로 전체 사용 */
  align-content: stretch;
  gap: 14px;
}

.workspace-page > .panel,
.workspace > .panel.tab-panel.active {
  overflow: hidden;
}

.workspace > .panel.tab-panel.active {
  height: 100%;
}

.notice-panel.active {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
}

#ordersTab.active {
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.notice-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.notice-toolbar select,
.notice-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.notice-summary {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.notice-list {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 10px;
}

.notice-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 10px;
}

.notice-row + .notice-row {
  margin-top: 8px;
}

.notice-row.attention {
  border-color: #efc5be;
  background: #fff8f7;
}

.notice-row.active {
  border-color: #d7c274;
  background: #fffdf0;
}

.notice-row.filled {
  border-color: #b8dcc9;
  background: #f3fbf6;
}

.notice-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

.notice-row-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.notice-row-head strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.notice-row-head span,
.notice-row-head time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.notice-row-message {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.notice-row button {
  margin-top: 8px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

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

.span-2 {
  grid-column: span 2;
}

.panel-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  min-width: 0;
}

.market-investor-totals {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}

.market-investor-total-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 7px;
  margin-bottom: 5px;
}

.market-investor-total-head strong {
  color: var(--text);
  font-size: 12px;
}

.market-investor-total-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.market-investor-market-grid {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 6px 14px;
  max-width: 100%;
}

.market-investor-market {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  padding-right: 14px;
}

.market-investor-market + .market-investor-market {
  padding-right: 0;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.market-investor-market-name {
  flex: 0 0 auto;
  min-width: 48px;
  padding-top: 3px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.2;
}

.market-investor-total-grid {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 3px 9px;
}

.market-investor-total-cell {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 2px;
  border-radius: 4px;
  font-size: 12px;
}

.market-investor-total-cell span {
  color: var(--muted);
  white-space: nowrap;
}

.market-investor-total-cell strong {
  min-width: 58px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.market-investor-total-cell.buy strong {
  color: var(--danger);
}

.market-investor-total-cell.sell strong {
  color: var(--accent-2);
}

.market-investor-totals.is-stale {
  opacity: 0.62;
}

.market-investor-market.is-stale {
  opacity: 0.58;
}

.market-investor-totals.is-partial .market-investor-total-head span {
  color: var(--warn);
}

.today-trade-strip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: -2px 0 10px;
  padding: 2px 1px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
}

.today-trade-chip {
  flex: 0 0 auto;
  max-width: 220px;
  min-height: 40px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #263142;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.today-trade-chip-main {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-trade-chip-time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.today-trade-chip:hover {
  border-color: #6b7280;
  background: #ffffff;
}

.today-trade-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.rule31-progress {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
  min-height: 42px;
  margin: -2px 0 10px;
  padding: 7px 10px;
  border: 1px solid #c7d7e8;
  border-radius: 7px;
  background: #f7fbff;
  color: #263142;
}

.rule31-progress.paused,
.rule31-progress.session-closed {
  border-color: #d9dee5;
  background: #f7f8fa;
  color: #687586;
}

.rule31-progress.candles-loading,
.rule31-progress.retry-wait {
  border-color: #ead59a;
  background: #fffdf4;
}

.rule31-progress.watching,
.rule31-progress.entry-check,
.rule31-progress.scanning,
.rule31-progress.candidate-review {
  border-color: #b9d6be;
  background: #f3fbf5;
}

.rule31-progress-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.rule31-progress-head strong {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.rule31-progress-phase {
  padding: 2px 6px;
  border-radius: 999px;
  background: #dfeaf5;
  color: #28516f;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
}

.rule31-progress-message {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
}

.rule31-progress-account {
  grid-column: 1 / -1;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.rule31-progress-meta {
  grid-column: 1 / -1;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  color: #607285;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: normal;
}

.rule31-progress-candidates {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.rule31-progress-candidate {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 5px;
  max-width: 330px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 6px;
  border: 1px solid #d5e0ea;
  border-radius: 4px;
  background: #ffffff;
  color: #46586a;
  font-size: 10px;
  font-weight: 800;
}

.rule31-progress-candidate strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 800;
}

.rule31-progress-candidate em {
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  color: #566b85;
}

.rule31-progress-candidate small {
  grid-column: 1 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  color: #68768a;
}

.rule31-progress-candidate.selected {
  border-color: #69a977;
  background: #e8f7eb;
  color: #176b34;
}

@media (max-width: 860px) {
  .rule31-progress {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .rule31-progress-meta {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.badge {
  border-radius: 999px;
  padding: 3px 9px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge.ok {
  background: #e7f6ee;
  color: var(--ok);
}

.badge.warn {
  background: #fff6db;
  color: var(--warn);
}

.form-row {
  display: grid;
  grid-template-columns: 96px minmax(100px, 1fr) 118px 64px;
  gap: 8px;
  margin-bottom: 12px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  margin: 10px 0 8px;
}

.stock-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 8px;
  margin: 10px 0 8px;
}

.stock-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 6px;
  min-width: 0;
}

.stock-search-form button,
.stock-add-form button,
#refreshMasterBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.stock-add-form {
  min-width: 0;
}

.stock-add-form button {
  width: 100%;
  padding: 0 8px;
}

.target-register {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px 64px;
  gap: 8px;
  margin: 10px 0 12px;
}

.selection-box {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  background: #f8fafc;
}

.selection-box.selected {
  color: var(--text);
  background: #ffffff;
  border-color: #9fb0c0;
}

.quote-box {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  margin-bottom: 12px;
  background: #f8fafc;
  color: var(--muted);
}

.selected-quote-box {
  display: none;
}

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

.target-cards {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(368px, 1fr));
  justify-content: start;
  align-items: start;
  align-content: start;
  gap: 10px;
  padding-right: 2px;
}

/* 상태 패널이 본문 세로 공간을 전부 차지하고 카드 영역이 내부 스크롤을 갖도록 */
.status-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.status-panel .target-cards {
  flex: 1 1 auto;
}

.target-list {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.recommendation-filter {
  display: grid;
  grid-template-columns: 56px 52px 36px minmax(0, 1fr);
  gap: 5px;
  align-items: end;
  margin-bottom: 8px;
}

.recommendation-filter label {
  min-width: 0;
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.recommendation-filter label.is-disabled {
  opacity: 0.5;
}

.recommendation-filter input {
  width: 100%;
  min-width: 0;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  padding: 0 3px;
  font-size: 12px;
  line-height: 26px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.recommendation-filter input:disabled {
  background: #f1f5f9;
  color: var(--muted);
}

.recommendation-filter select {
  width: 100%;
  min-width: 0;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  padding: 0 4px;
  font-size: 12px;
}

.recommendation-market-toggle {
  min-width: 0;
  width: 100%;
  height: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  justify-content: start;
}

.recommendation-rank-toggle {
  min-width: 0;
  width: 100%;
  height: 21px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.recommendation-rank-market-controls {
  min-width: 0;
  display: grid;
  grid-template-rows: 21px 30px;
  gap: 2px;
  align-self: end;
}

.recommendation-rank-toggle button {
  min-width: 0;
  min-height: 0;
  padding: 0 1px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.recommendation-rank-toggle button.active {
  background: #1f6fb2;
  color: #ffffff;
}

.recommendation-rank-toggle button:disabled {
  cursor: not-allowed;
}

.recommendation-market-toggle button {
  min-width: 0;
  min-height: 0;
  padding: 0 5px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.recommendation-market-toggle button.active {
  background: #1f2937;
  color: #ffffff;
}

.bst-recommendation-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 5px;
  align-items: center;
  margin: -2px 0 8px;
}

.bst-recommendation-form[hidden] {
  display: none;
}

.bst-recommendation-form input {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 6px;
  font-size: 12px;
}

.bst-recommendation-form button {
  min-height: 28px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
}

.bst-search-results {
  display: grid;
  gap: 4px;
  margin: -3px 0 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.bst-search-results[hidden] {
  display: none;
}

.bst-search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 4px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #ffffff;
  text-align: left;
  font-size: 12px;
}

.bst-search-result strong,
.bst-search-result span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bst-search-result span {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.recommendation-list {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.recommendation-list-head,
.recommendation-row-main {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 58px 46px;
  gap: 6px;
  align-items: center;
}

.recommendation-list-head {
  min-height: 34px;
  padding: 0 9px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.recommendation-list-head > span:nth-child(n + 3),
.recommendation-row-main > span:nth-child(3),
.recommendation-row-main > button {
  text-align: right;
}

.recommendation-list-head > span:first-child,
.recommendation-rank {
  text-align: center;
}

.recommendation-list-body {
  overflow: auto;
}

.recommendation-row {
  display: grid;
  gap: 5px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  cursor: pointer;
}

.recommendation-row:hover {
  background: #f8fafc;
}

.recommendation-row.is-reviewing {
  background: #fff7e0;
  box-shadow: inset 3px 0 0 #d97706;
  animation: recommendation-review-pulse 1.2s ease-in-out infinite;
}

.recommendation-row.is-reviewing.is-selected-review {
  background: #dcfce7;
  box-shadow: inset 3px 0 0 #16a34a;
}

.recommendation-review-flag {
  flex: none;
  padding: 1px 4px;
  border-radius: 3px;
  background: #d97706;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  font-style: normal;
  letter-spacing: -0.2px;
}

.recommendation-row.is-selected-review .recommendation-review-flag {
  background: #16a34a;
}

@keyframes recommendation-review-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

.recommendation-row:last-child {
  border-bottom: 0;
}

.recommendation-row-main > span,
.recommendation-row-main strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommendation-rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.recommendation-name {
  display: grid;
  gap: 1px;
}

.recommendation-title {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.recommendation-name strong {
  color: var(--text);
  font-size: 12px;
}

.recommendation-title strong {
  flex: 0 1 auto;
}

.recommendation-market {
  flex: none;
  padding: 1px 3px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  color: #475569;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.1;
}

.recommendation-code {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.recommendation-change {
  color: var(--danger);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.recommendation-rank-metric {
  color: var(--text);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.recommendation-row-sub {
  color: var(--muted);
  font-size: 11px;
}

.recommendation-review-status {
  margin-top: 4px;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.recommendation-review-status.reviewing {
  color: #92400e;
}

.recommendation-review-status.selected {
  color: #166534;
}

.recommendation-review-status.rejected {
  color: #111827;
}

.recommendation-metrics {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 2px;
  overflow: visible;
  white-space: normal;
  line-height: 1.35;
}

.recommendation-add {
  justify-self: end;
  min-height: 22px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}

.recommendation-add.danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

.recommendation-empty {
  padding: 14px 9px;
  color: var(--muted);
  font-size: 12px;
}

.recommendation-news-modal {
  width: min(720px, 100%);
  height: min(620px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}

.recommendation-news-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.recommendation-news-head h2 {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommendation-news-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.recommendation-news-head button {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.recommendation-news-list {
  min-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  background: #f8fafc;
}

.recommendation-company-profile {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid #bfd5e2;
  border-radius: 6px;
  background: #f4fbff;
  color: var(--text);
}

.recommendation-company-profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.recommendation-company-profile-head strong {
  font-size: 12px;
  font-weight: 900;
}

.recommendation-company-profile-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.recommendation-company-profile em {
  width: fit-content;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  color: #334155;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.recommendation-company-profile p {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.recommendation-news-row {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
}

.recommendation-news-row + .recommendation-news-row {
  margin-top: 8px;
}

.recommendation-news-row:hover {
  border-color: #94a3b8;
  background: #fbfdff;
}

.recommendation-news-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.recommendation-news-title strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.recommendation-news-open {
  flex: none;
  min-width: 34px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: #334155;
  text-align: center;
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
}

.recommendation-news-open:hover {
  border-color: #64748b;
  background: #f1f5f9;
}

.recommendation-news-row p {
  margin: 0;
  max-height: 92px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.recommendation-news-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.recommendation-news-row em {
  font-style: normal;
}

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

.target-list-head,
.target-list-primary {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 76px; /* 코드 · 업체명 · 갱신시각 */
  gap: 6px;
  align-items: center;
}

.target-list-head {
  min-height: 34px;
  padding: 0 9px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.target-list-head > span:nth-child(n + 3),
.target-list-primary > span:nth-child(n + 3) {
  text-align: right;
}

.target-list-body {
  overflow: auto;
}

.target-list-row {
  display: grid;
  grid-template-rows: auto auto;
  gap: 4px;
  min-height: 58px;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.target-list-row:last-child {
  border-bottom: 0;
}

.target-list-empty {
  padding: 14px 9px;
  color: var(--muted);
  font-size: 12px;
}

.target-list-primary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-list-secondary {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.target-list-hpr {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.target-list-hpr span,
.target-list-hpr strong {
  white-space: nowrap;
}

.target-list-hpr strong {
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.target-list-hpr strong.up {
  color: var(--danger);
}

.target-list-hpr strong.down {
  color: var(--accent-2);
}

.target-list-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}

.target-list-delete:not(:disabled) {
  border-color: #f0c7c2;
  color: var(--danger);
  background: #ffffff;
}

.target-list-delete:not(:disabled):hover {
  border-color: var(--danger);
  background: #fff5f4;
}

.target-list-delete:disabled {
  color: #98a2ad;
  background: #f8fafc;
  cursor: not-allowed;
  opacity: 0.7;
}

.target-list-code {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.target-list-quantity {
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-list-name {
  font-weight: 700;
}

.target-list-time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.status-target-cards {
  margin-top: 12px;
}

.target-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px 8px;
  background: #ffffff;
  min-width: 0;
  overflow: visible;
  position: relative;
}

.target-card.us-market {
  border-color: #9fbce6;
  background: linear-gradient(90deg, #dbeafe 0, #dbeafe 5px, #eef6ff 5px, #eef6ff 100%);
}

.target-card.loading-card {
  background: #f8fafc;
  color: #485465;
}

.target-card.loading-card .target-current-price,
.target-card.loading-card .target-quick-stats strong {
  color: #7a8694;
}

.target-card.stale-quote {
  border-color: #d9b85f;
  background: linear-gradient(90deg, #fff3c4 0, #fff3c4 5px, #ffffff 5px, #ffffff 100%);
}

.target-card.halted-quote {
  border-color: #c55f5f;
  background: linear-gradient(90deg, #ffd8d8 0, #ffd8d8 5px, #fffafa 5px, #fffafa 100%);
}

.target-list-row.us-market {
  background: linear-gradient(90deg, #dbeafe 0, #dbeafe 4px, #eef6ff 4px, #eef6ff 100%);
}

.target-card-head {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin: 0 -8px 8px;
  padding: 7px 8px;
  border-bottom: 1px solid #cfdbe7;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #f1f6fb 0%, #e3edf7 100%);
  cursor: default;
}

body.target-card-dragging {
  cursor: grabbing;
  user-select: none;
}

.target-card-head button,
.target-card-head input {
  cursor: default;
  user-select: auto;
}

.target-card-head .target-margin-rate {
  cursor: default;
  user-select: text;
}

.target-card.us-market .target-card-head {
  border-bottom-color: #9fbce6;
  background: linear-gradient(180deg, #e0edff 0%, #c7dcfb 100%);
}

.target-card.loading-card .target-card-head {
  border-bottom-color: #d6dee8;
  background: linear-gradient(180deg, #f5f7fa 0%, #e8eef5 100%);
}

.target-card.stale-quote .target-card-head {
  border-bottom-color: #e7c86f;
  background: linear-gradient(180deg, #fff4cf 0%, #ffe49a 100%);
}

.target-card.halted-quote .target-card-head {
  border-bottom-color: #df9898;
  background: linear-gradient(180deg, #ffe3e3 0%, #ffcaca 100%);
}

.target-card.dragging {
  opacity: 0.62;
  box-shadow: 0 12px 28px rgba(36, 48, 66, 0.18);
}

.target-card.drag-over-before::before,
.target-card.drag-over-after::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  z-index: 5;
  height: 3px;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.target-card.drag-over-before::before {
  top: 3px;
}

.target-card.drag-over-after::after {
  bottom: 3px;
}

.target-card-title {
  display: flex;
  align-items: baseline;
  flex: 1 1 auto;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.target-card-title strong {
  display: inline-block;
  min-width: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-card-title span {
  display: inline-block;
  flex: 0 0 auto;
  margin-top: 0;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.target-card-title .target-card-code.price-trigger-watching {
  color: var(--danger);
  font-weight: 950;
}

.target-list-time.stale {
  color: #9a6700;
  font-weight: 800;
}

/* 수동 거래 — 수량 입력 + 사기/팔기 (카드 헤더 우측 정렬) */
.manual-trade {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 3px;
  min-width: 0;
  margin-left: 0;
  white-space: nowrap;
}

.target-margin-rate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  min-height: 26px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: default;
}

.manual-trade .all-accounts-arm {
  width: 17px;
  min-width: 17px;
  height: 17px;
  min-height: 17px;
  margin: 0 2px 0 0;
  padding: 0;
  accent-color: var(--danger);
  cursor: pointer;
}

.manual-trade .manual-price,
.manual-trade .manual-qty {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 4px;
  font-size: 11px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.manual-trade .manual-price {
  width: 72px;
}

.manual-trade .manual-qty {
  width: 54px;
}

.manual-trade button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 48px;
  min-height: 28px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  color: #ffffff;
}

.manual-trade .manual-buy {
  background: var(--danger);
  border-color: var(--danger);
}

.manual-trade .manual-sell {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.manual-trade .manual-view,
.manual-trade .manual-news {
  min-width: 30px;
  gap: 0;
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
}

.manual-trade .manual-view span,
.manual-trade .manual-news span {
  transform: translateY(-1px);
}

.manual-trade .manual-buy i,
.manual-trade .manual-sell i {
  font-size: 10px;
  line-height: 1;
}

.manual-trade .manual-view:hover,
.manual-trade .manual-news:hover {
  border-color: #9fb0c0;
  background: #f8fafc;
}

.manual-trade button:disabled {
  opacity: 0.45;
  cursor: default;
}

.manual-feedback {
  margin: -2px 0 6px;
  padding: 4px 7px;
  border-radius: 4px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.manual-feedback.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.status-line-message {
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-line-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-dismiss-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.status-dismiss-button:hover {
  color: var(--text);
  border-color: #9fb0c0;
}

.manual-feedback.pending {
  background: #fff8e5;
  color: #8a5b00;
}

.manual-feedback.ok {
  background: #eefbf3;
  color: #17683b;
}

.manual-feedback.error {
  background: #fff0ee;
  color: var(--danger);
}

.manual-feedback.partial {
  background: #fff8e5;
  color: #8a5b00;
}

.manual-feedback.trade-proposal-card {
  border: 1px solid #ead28a;
  background: #fff9df;
  color: #3d2d00;
}

.trade-proposal-card .status-line-message {
  font-weight: 900;
}

.trade-proposal-card .trade-proposal-actions button {
  min-height: 24px;
  padding: 0 9px;
}

.manual-feedback.order-progress {
  margin-top: -2px;
  border: 1px solid #c8d6e3;
  background: #f3f8fc;
  color: #24516b;
  white-space: normal;
  overflow-wrap: anywhere;
}

.manual-feedback.order-progress span {
  min-width: 0;
}

.order-cancel-button {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid #d8a8a2;
  border-radius: 4px;
  background: #ffffff;
  color: var(--danger);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.order-cancel-button:hover {
  border-color: var(--danger);
  background: #fff5f4;
}

.order-cancel-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.manual-feedback.order-progress.waiting {
  border-color: #d7c274;
  background: #fff9df;
  color: #765600;
}

.manual-feedback.order-progress.manual-limit-order {
  margin: -1px 0 6px;
  border-color: #d19a52;
  background: #fff4df;
  color: #5f3b00;
  font-weight: 900;
}

.manual-feedback.order-progress.manual-limit-order .status-line-message {
  line-height: 1.25;
}

.manual-feedback.order-progress.partial {
  border-color: #9cc5d8;
  background: #ecf8fc;
  color: #165672;
}

.manual-feedback.order-progress.terminal {
  border-color: #c9cfd6;
  background: #f4f6f8;
  color: #46525f;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.38);
}

.target-apply-modal {
  width: min(440px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}

.target-apply-modal h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.target-apply-modal p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.target-apply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.target-apply-actions button {
  min-height: 34px;
  padding: 0 12px;
}

.stock-message-modal {
  width: min(680px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}

.stock-message-head {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.stock-message-head button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.stock-message-list {
  min-height: 180px;
  overflow: auto;
  padding: 10px;
  background: #f8fafc;
}

.stock-message-row {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.stock-message-row + .stock-message-row {
  margin-top: 8px;
}

.stock-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.stock-message-text {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.price-marks-modal {
  width: min(920px, 100%);
  height: min(640px, calc(100vh - 48px));
  max-height: min(640px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}

.price-marks-head {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.price-marks-head h2 {
  margin: 0;
  font-size: 15px;
}

.price-marks-head button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.price-marks-body {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px 10px;
  flex: 1 1 auto;
}

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

.price-marks-market {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.price-marks-market-name {
  padding: 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: left;
  line-height: 1.2;
}

.price-marks-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-width: 0;
}

.price-marks-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  min-height: 42px;
  padding: 4px 6px;
  border: 1px solid #e5eaf0;
  border-radius: 5px;
  background: #f8fafc;
}

.price-marks-stat-top,
.price-marks-stat-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.price-marks-stat-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.price-marks-stat-price {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.price-marks-stat-meta {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price-marks-stat .price-marks-change {
  font-size: 11px;
}

.price-marks-chart {
  position: relative;
  flex: 1 1 auto;
  min-height: 280px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-template-rows: minmax(180px, 1fr) 96px 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.price-marks-y {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  border-right: 1px solid #eef2f6;
  background: #f8fafc;
}

.price-marks-y span {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.price-marks-scroll-x {
  grid-column: 2;
  grid-row: 1 / span 3;
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(180px, 1fr) 96px 24px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
}

.price-marks-price-svg,
.price-marks-vol-svg,
.price-marks-axis-svg {
  display: block;
  width: var(--price-marks-width, 800px);
  min-width: var(--price-marks-width, 800px);
  max-width: none;
  height: 100%;
}

.price-marks-price-svg path {
  stroke: #64748b;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.price-marks-price-svg.is-up path {
  stroke: var(--danger);
}

.price-marks-price-svg.is-down path {
  stroke: var(--accent-2);
}

.price-marks-dot {
  fill: #64748b;
}

.price-marks-dot.up {
  fill: var(--danger);
}

.price-marks-dot.down {
  fill: var(--accent-2);
}

.price-marks-bar {
  fill: #94a3b8;
}

.price-marks-bar.up {
  fill: #f5a3a3;
}

.price-marks-bar.down {
  fill: #93c5fd;
}

.price-marks-x {
  fill: var(--muted);
  font-size: 10px;
}

.price-marks-price-label {
  fill: #334155;
  font-size: 9px;
  font-weight: 700;
}

.price-marks-price-label.up {
  fill: var(--danger);
}

.price-marks-price-label.down {
  fill: var(--accent-2);
}

.price-marks-vol-label {
  fill: #475569;
  font-size: 8px;
  font-weight: 700;
}

.price-marks-hit {
  fill: transparent;
  cursor: pointer;
}

.price-marks-tip {
  position: absolute;
  z-index: 3;
  max-width: 240px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  font-size: 11px;
  line-height: 1.3;
  pointer-events: none;
  white-space: nowrap;
}

.price-marks-table {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.price-marks-pin {
  flex: 0 0 auto;
  z-index: 1;
  background: #f4f7fb;
}

.price-marks-pin.is-top {
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.price-marks-pin.is-bottom {
  border-top: 1px solid var(--line);
  background: #eef4ff;
  box-shadow: 0 -2px 6px rgba(15, 23, 42, 0.06);
}

.price-marks-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #ffffff;
}

.price-marks-row {
  display: grid;
  grid-template-columns: 40px 56px minmax(72px, 1fr) 68px minmax(64px, 0.95fr);
  gap: 6px;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  font-variant-numeric: tabular-nums;
}

.price-marks-row.is-head {
  min-height: 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.price-marks-pin .price-marks-row + .price-marks-row,
.price-marks-scroll .price-marks-row + .price-marks-row {
  border-top: 1px solid #eef2f6;
}

.price-marks-seq {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.price-marks-time {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.price-marks-price,
.price-marks-change,
.price-marks-volume {
  justify-self: end;
  text-align: right;
}

.price-marks-price {
  font-size: 14px;
}

.price-marks-change {
  font-size: 12px;
  font-weight: 800;
}

.price-marks-change.up {
  color: var(--danger);
}

.price-marks-change.down {
  color: var(--accent-2);
}

.price-marks-volume {
  font-size: 12px;
  font-weight: 700;
}

.price-marks-row.is-head > span:nth-child(3),
.price-marks-row.is-head > span:nth-child(4),
.price-marks-row.is-head > span:nth-child(5) {
  justify-self: end;
  text-align: right;
}

.price-marks-empty,
.price-marks-empty-scroll {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .price-marks-modal {
    width: 100%;
    height: min(760px, calc(100vh - 24px));
    max-height: min(760px, calc(100vh - 24px));
  }

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

  .price-marks-stat-price {
    font-size: 13px;
  }
}

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

.holding-mismatch-modal {
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #f1b6b6;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(127, 29, 29, 0.22);
}

.holding-mismatch-headline {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid #f1b6b6;
  background: #fff1f2;
}

.holding-mismatch-headline h2 {
  margin: 0;
  color: #991b1b;
  font-size: 15px;
  font-weight: 900;
}

.holding-mismatch-headline button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #f1b6b6;
  border-radius: 5px;
  background: #ffffff;
  color: #7f1d1d;
  cursor: pointer;
}

.holding-mismatch-body {
  min-height: 180px;
  overflow: auto;
  padding: 12px;
  background: #fffafa;
}

.holding-mismatch-summary,
.holding-mismatch-reason {
  margin: 0 0 8px;
  color: #7f1d1d;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
}

.holding-mismatch-reason {
  color: #475569;
  font-size: 12px;
}

.holding-mismatch-table {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #ffffff;
}

.holding-mismatch-head,
.holding-mismatch-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) repeat(4, minmax(72px, 0.65fr));
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.holding-mismatch-head {
  background: #fee2e2;
  color: #7f1d1d;
  font-size: 11px;
  font-weight: 900;
}

.holding-mismatch-row {
  border-top: 1px solid #fee2e2;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.holding-mismatch-row span:not(:first-child) {
  text-align: right;
}

.holding-mismatch-row strong,
.holding-mismatch-row em {
  display: block;
  overflow-wrap: anywhere;
}

.holding-mismatch-row em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.stock-chart-modal {
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}

.stock-chart-head {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}

.stock-chart-head h2 {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-chart-head button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.stock-chart-body {
  min-height: 470px;
  overflow: auto;
  padding: 12px;
  background: #f4f6f8;
}

.stock-chart-summary {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stock-chart-summary > div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.stock-chart-summary span {
  display: block;
}

.stock-chart-summary strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  text-align: left;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stock-chart-summary strong.up {
  color: var(--danger);
}

.stock-chart-summary strong.down {
  color: var(--accent-2);
}

.stock-chart-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.stock-chart-metrics span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stock-chart-svg {
  width: 100%;
  height: auto;
  min-height: 460px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.stock-chart-plot-bg,
.stock-chart-volume-bg {
  fill: #ffffff;
}

.stock-chart-grid {
  stroke: #dbe3eb;
  stroke-width: 1;
}

.stock-chart-volume-grid {
  stroke: #e4eaf0;
  stroke-width: 1;
}

.stock-chart-wick {
  stroke: currentColor;
  stroke-width: 1;
}

.stock-chart-body-rect {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1;
}

.stock-chart-candle.up {
  color: var(--danger);
}

.stock-chart-candle.down {
  color: var(--accent-2);
}

.stock-chart-volume-bar {
  fill: currentColor;
  opacity: 0.2;
}

.stock-chart-ma {
  fill: none;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.stock-chart-ma.ma5 {
  stroke: #f59e0b;
}

.stock-chart-ma.ma20 {
  stroke: #7c3aed;
}

.stock-chart-last-line {
  stroke: #334155;
  stroke-dasharray: 4 4;
  stroke-width: 1;
  opacity: 0.55;
}

.stock-chart-last-label-bg {
  fill: #1f2937;
}

.stock-chart-last-label {
  fill: #ffffff;
  font-size: 10px;
  font-weight: 900;
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
}

.stock-chart-axis,
.stock-chart-time,
.stock-chart-volume-axis,
.stock-chart-section-label {
  fill: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.stock-chart-axis.right,
.stock-chart-volume-axis {
  text-anchor: end;
}

.stock-chart-section-label {
  fill: #475569;
}

.stock-chart-time.end {
  text-anchor: end;
}

.stock-chart-time.middle {
  text-anchor: middle;
}

.stock-chart-legend text {
  font-size: 11px;
  font-weight: 900;
}

.stock-chart-legend text:first-child {
  fill: #f59e0b;
}

.stock-chart-legend text:last-child {
  fill: #7c3aed;
}

.stock-chart-ranges {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  overflow-x: auto;
}

.stock-chart-ranges button {
  flex: 1 1 0;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.stock-chart-ranges button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.ichimoku-chart-modal,
.bollinger-chart-modal {
  width: min(1080px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  grid-template-rows: auto minmax(0, 1fr);
}

.ichimoku-chart-body,
.bollinger-chart-body {
  min-height: 620px;
}

.ichimoku-summary {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.ichimoku-verdict {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 6px;
  background: #ffffff;
}

.ichimoku-verdict.up {
  border-left-color: var(--danger);
}

.ichimoku-verdict.down {
  border-left-color: var(--accent-2);
}

.ichimoku-verdict.flat {
  border-left-color: #64748b;
}

.ichimoku-verdict span,
.ichimoku-status-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ichimoku-verdict strong {
  margin-top: 1px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.ichimoku-verdict.up strong,
.ichimoku-status-grid strong.up {
  color: var(--danger);
}

.ichimoku-verdict.down strong,
.ichimoku-status-grid strong.down {
  color: var(--accent-2);
}

.ichimoku-verdict.flat strong,
.ichimoku-status-grid strong.flat {
  color: #475569;
}

.ichimoku-verdict em {
  margin-top: 2px;
  color: #475569;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.3;
}

.ichimoku-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.ichimoku-status-grid > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
}

.ichimoku-status-grid > div:last-child {
  border-right: 0;
}

.ichimoku-status-grid strong {
  margin-top: 1px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.ichimoku-status-grid em {
  margin-top: 2px;
  overflow: hidden;
  color: #475569;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ichimoku-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 16px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: #ffffff;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
}

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

.ichimoku-legend i {
  width: 18px;
  height: 3px;
  border-radius: 1px;
  background: #64748b;
}

.ichimoku-legend i.conversion {
  background: #dc2626;
}

.ichimoku-legend i.base {
  background: #2563eb;
}

.ichimoku-legend i.span-a {
  background: #f59e0b;
}

.ichimoku-legend i.span-b {
  background: #0f766e;
}

.ichimoku-legend i.lagging {
  background: #7c3aed;
}

.ichimoku-chart-svg {
  min-width: 760px;
  min-height: 500px;
  border-radius: 0 0 6px 6px;
}

.ichimoku-future-zone {
  fill: #f1f5f9;
  opacity: 0.7;
}

.ichimoku-cloud path.up {
  fill: #fecaca;
  opacity: 0.5;
}

.ichimoku-cloud path.down {
  fill: #bfdbfe;
  opacity: 0.56;
}

.ichimoku-line {
  fill: none;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.ichimoku-line.conversion {
  stroke: #dc2626;
  stroke-width: 2.1;
}

.ichimoku-line.base {
  stroke: #2563eb;
  stroke-width: 2.1;
}

.ichimoku-line.span-a {
  stroke: #f59e0b;
}

.ichimoku-line.span-b {
  stroke: #0f766e;
}

.ichimoku-line.lagging {
  stroke: #7c3aed;
  stroke-width: 1.7;
}

.ichimoku-current-boundary {
  stroke: #475569;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.65;
}

.ichimoku-chart-svg .stock-chart-time.current {
  fill: #0f172a;
  font-weight: 900;
}

.ichimoku-chart-svg .stock-chart-time.future {
  fill: #475569;
}

.ichimoku-caption {
  padding: 6px 2px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: right;
}

.bollinger-legend i.upper {
  background: #dc2626;
}

.bollinger-legend i.middle {
  background: #d97706;
}

.bollinger-legend i.lower {
  background: #2563eb;
}

.bollinger-legend i.band {
  height: 8px;
  border: 1px solid #94a3b8;
  background: #dbeafe;
}

.bollinger-chart-svg {
  min-width: 760px;
  min-height: 500px;
  border-radius: 0 0 6px 6px;
}

.bollinger-band-area path {
  fill: #dbeafe;
  opacity: 0.46;
}

.bollinger-status-grid em {
  overflow: visible;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
}

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

.bollinger-line.upper {
  stroke: #dc2626;
}

.bollinger-line.middle {
  stroke: #d97706;
  stroke-width: 2.2;
}

.bollinger-line.lower {
  stroke: #2563eb;
}

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

  .ichimoku-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ichimoku-status-grid > div:nth-child(2) {
    border-right: 0;
  }

  .ichimoku-status-grid > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }
}

.stock-chart-empty,
.stock-chart-loading {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.target-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.target-price-group {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.target-price-context {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.target-domestic-venue-group {
  display: block;
  min-width: 0;
}

.domestic-venue-card .target-card-main {
  display: block;
}

.target-domestic-venue-group .target-price-context {
  margin-top: 5px;
}

.venue-price-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
}

.venue-trade-column {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.venue-price-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 62px;
  padding: 5px 6px;
  border: 1px solid #ccd9e6;
  border-radius: 4px;
  background: #f8fbff;
  min-width: 0;
}

.venue-price-card.nxt {
  border-color: #d8cee8;
  background: #fbf9ff;
}

.venue-price-card.active {
  border-color: #8aaecf;
}

.venue-price-card.nxt.active {
  border-color: #aa91cc;
}

/* 거래소별 실제 주문 가능 구간을 카드 자체의 톤으로 즉시 구분합니다. */
.venue-price-card.market-open {
  border-color: #9bcfc3;
  background: linear-gradient(145deg, #e7f8f0, #f4fcf8);
}

.venue-price-card.nxt.market-open {
  border-color: #c5b5e6;
  background: linear-gradient(145deg, #f3edff, #fbf9ff);
}

.venue-price-card.market-open.active {
  border-color: #5eaa99;
  box-shadow: inset 0 0 0 1px rgba(94, 170, 153, 0.14);
}

.venue-price-card.nxt.market-open.active {
  border-color: #9b7bc9;
  box-shadow: inset 0 0 0 1px rgba(155, 123, 201, 0.14);
}

.venue-price-card.market-closed {
  border-color: #d8dde2;
  background: #f1f3f5;
}

.venue-price-card.market-closed .venue-price-label {
  color: #7d8892;
}

.venue-price-label {
  color: #386b9d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.venue-price-label.nxt {
  color: #7351a3;
}

.venue-price-identity {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.venue-price-receipt {
  color: #587182;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.venue-price-receipt.rest-baseline {
  color: #8a6419;
}

.venue-price-card-head,
.venue-price-rates {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}

.venue-price-rates {
  justify-content: flex-end;
  overflow: hidden;
}

.venue-price-value {
  min-width: 0;
  color: var(--text);
  font-size: clamp(20px, 1.8vw, 29px);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.venue-price-value-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 0;
}

.venue-price-pnl {
  position: absolute;
  right: 0;
  bottom: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.venue-price-value-row.holding {
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.venue-price-value-row.holding .venue-price-value {
  flex: 1 1 auto;
  text-align: left;
}

.venue-price-value-row.holding .venue-price-pnl {
  position: static;
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1.15;
  text-align: right;
}

.venue-price-value-row.holding .venue-price-pnl.split {
  font-size: 12px;
}

.venue-price-pnl.up {
  color: var(--danger);
}

.venue-price-pnl.down {
  color: var(--accent-2);
}

.venue-price-value.up {
  color: var(--danger);
}

.venue-price-value.down {
  color: var(--accent-2);
}

.venue-price-value.stale {
  color: #7a5a12;
}

.venue-price-change,
.venue-price-buy-change,
.venue-price-sep {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.venue-price-change.up,
.venue-price-buy-change.up {
  color: var(--danger);
}

.venue-price-change.down,
.venue-price-buy-change.down {
  color: var(--accent-2);
}

.domestic-manual-order {
  display: grid;
  grid-template-columns: minmax(64px, 0.78fr) minmax(52px, 1.15fr) minmax(36px, 0.7fr) minmax(40px, 0.68fr) minmax(40px, 0.68fr);
  align-items: stretch;
  gap: 3px;
  width: 100%;
  min-width: 0;
  margin-top: 5px;
}

.domestic-manual-order input,
.domestic-manual-order > button,
.manual-route-toggle button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  margin: 0;
  border-radius: 4px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.domestic-manual-order input {
  padding: 0 3px;
  border: 1px solid var(--line);
  background: #ffffff;
  text-align: center;
}

.domestic-manual-order > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 3px;
  border: 1px solid transparent;
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
}

.domestic-manual-order .manual-buy {
  border-color: var(--danger);
  background: var(--danger);
}

.domestic-manual-order .manual-sell {
  border-color: var(--accent-2);
  background: var(--accent-2);
}

.domestic-manual-order > button:disabled,
.domestic-manual-order input:disabled,
.manual-route-toggle button:disabled {
  cursor: default;
  opacity: 0.45;
}

.domestic-manual-order .manual-buy i,
.domestic-manual-order .manual-sell i {
  font-size: 11px;
  line-height: 1;
}

.manual-route-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  overflow: hidden;
  border: 1px solid #aebdca;
  border-radius: 4px;
  background: #eef3f7;
}

.manual-route-toggle button {
  padding: 0 1px;
  border: 0;
  border-right: 1px solid #c8d3dc;
  border-radius: 0;
  background: transparent;
  color: #5e6f7f;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.manual-route-toggle button:last-child {
  border-right: 0;
}

.manual-route-toggle button[aria-pressed="true"] {
  background: #305d84;
  color: #ffffff;
}

.manual-route-toggle button.is-unavailable:disabled {
  background: #e5e9ed;
  color: #87929b;
  opacity: 0.78;
}

.manual-route-toggle button.is-unavailable[aria-pressed="true"]:disabled {
  background: #b9c1c8;
  color: #ffffff;
}

.manual-route-toggle button:not(:disabled):not([aria-pressed="true"]):hover {
  background: #dce7ef;
  color: #284c6b;
}

.venue-quote-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.venue-quote-table td {
  height: 22px;
  min-width: 0;
  padding: 0 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  text-overflow: clip;
  white-space: nowrap;
}

.venue-quote-table td:nth-child(odd) {
  width: 28px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.venue-quote-table td:nth-child(even) {
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.target-chart-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 2px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  width: 100%;
}

.target-chart-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  min-height: 40px;
  padding: 4px 1px;
  overflow: hidden;
  border: 1px solid #bdcde0;
  border-radius: 7px;
  background: linear-gradient(180deg, #ffffff 0%, #e7f0f8 100%);
  box-shadow: inset 0 1px 0 #ffffff, 0 1px 2px rgba(43, 76, 110, 0.14);
  color: #244766;
  cursor: pointer;
  font-family: "Youth", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.05;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease, transform 120ms ease, filter 120ms ease;
}

.target-chart-action-label {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.target-chart-action-label > span {
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.target-chart-actions button:not(:disabled):hover {
  border-color: #779dc3;
  background: linear-gradient(180deg, #ffffff 0%, #d9e8f6 100%);
  box-shadow: inset 0 1px 0 #ffffff, 0 3px 6px rgba(43, 76, 110, 0.2);
  transform: translateY(-1px);
}

.target-chart-actions button:active:not(:disabled) {
  box-shadow: inset 0 1px 2px rgba(43, 76, 110, 0.18);
  transform: translateY(0);
}

.target-chart-actions button:nth-child(1) {
  border-color: #aebee6;
  background: linear-gradient(180deg, #ffffff 0%, #e5ebff 100%);
  color: #405baf;
}

.target-chart-actions button:nth-child(2) {
  border-color: #b2c8ba;
  background: linear-gradient(180deg, #ffffff 0%, #e2f1e7 100%);
  color: #26734b;
}

.target-chart-actions button:nth-child(3) {
  border-color: #b7c5d7;
  background: linear-gradient(180deg, #ffffff 0%, #e3edf8 100%);
  color: #2b6596;
}

.target-chart-actions button:nth-child(4) {
  border-color: #d0bbdc;
  background: linear-gradient(180deg, #ffffff 0%, #f0e5f7 100%);
  color: #7a488f;
}

.target-chart-actions button:nth-child(1):not(:disabled):hover {
  border-color: #778ed4;
  background: linear-gradient(180deg, #ffffff 0%, #d8e0ff 100%);
}

.target-chart-actions button:nth-child(2):not(:disabled):hover {
  border-color: #71a98a;
  background: linear-gradient(180deg, #ffffff 0%, #d5ecdc 100%);
}

.target-chart-actions button:nth-child(3):not(:disabled):hover {
  border-color: #769fc2;
  background: linear-gradient(180deg, #ffffff 0%, #d8e8f7 100%);
}

.target-chart-actions button:nth-child(4):not(:disabled):hover {
  border-color: #a77bbb;
  background: linear-gradient(180deg, #ffffff 0%, #e9d8f2 100%);
}

.target-chart-actions button:disabled {
  cursor: default;
  opacity: 0.45;
}

.venue-investor-flow {
  display: flex;
  flex-direction: column;
  align-self: start;
  justify-content: flex-start;
  gap: 4px;
  min-height: 0;
  min-width: 0;
  padding: 0;
}

.venue-investor-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.venue-investor-table td {
  height: 20px;
  min-width: 0;
  padding: 0 2px;
  overflow: hidden;
  border: 1px solid var(--line);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.venue-investor-table tr.investor-label td {
  color: var(--muted);
  background: #f8fafc;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.venue-investor-table tr.investor-value td {
  font-weight: 900;
}

.venue-investor-flow-values strong,
.venue-investor-table strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.venue-investor-flow-values strong.up,
.venue-investor-table strong.up {
  color: var(--danger);
}

.venue-investor-flow-values strong.down,
.venue-investor-table strong.down {
  color: var(--accent-2);
}

.keep-settings-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  width: auto;
  min-width: 78px;
  height: 42px;
  padding: 0 8px;
  border: 1px solid #b7c4d0;
  border-radius: 5px;
  background: #eef3f7;
  color: #5e6f7f;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.keep-settings-toggle.is-on {
  background: #305d84;
  border-color: #305d84;
  color: #ffffff;
}

.keep-settings-toggle:disabled {
  opacity: 0.6;
  cursor: default;
}

.venue-price-pnl.split,
.venue-price-buy-change.split {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  line-height: 1.1;
}

.venue-price-pnl.split span,
.venue-price-buy-change.split span {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.venue-price-pnl.split .up,
.venue-price-buy-change.split .up {
  color: var(--danger);
}

.venue-price-pnl.split .down,
.venue-price-buy-change.split .down {
  color: var(--accent-2);
}

.integrated-position-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 3px;
  margin-top: 4px;
  min-width: 0;
}

.venue-investor-stack {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.venue-investor-stack .keep-settings-toggle {
  width: 100%;
  min-width: 0;
  height: 32px;
}

.integrated-position-summary {
  display: grid;
  grid-template-columns: minmax(32px, 0.72fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2px;
  min-width: 0;
}

.integrated-position-summary > span {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 42px;
  padding: 2px 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
}

.integrated-position-summary em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.1;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integrated-position-summary em.realized-label {
  display: grid;
  gap: 0;
  font-size: 11px;
  line-height: 1.05;
  white-space: normal;
}

.integrated-position-summary strong {
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integrated-position-summary.split-legs > span {
  height: 42px;
  align-items: center;
}

.integrated-position-summary.split-legs em {
  grid-row: 1 / span 2;
}

.integrated-position-summary.split-legs strong {
  font-size: 13px;
  line-height: 1.1;
}

.integrated-position-summary strong.up {
  color: var(--danger);
}

.integrated-position-summary strong.down {
  color: var(--accent-2);
}

.integrated-reservation-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  margin-top: 4px;
  width: 100%;
  min-width: 0;
}

.integrated-reservation-control {
  display: grid;
  grid-template-columns: 22px minmax(41px, 0.9fr) 52px minmax(35px, 0.6fr) 32px;
  align-items: center;
  gap: 1px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
}

.integrated-reservation-control > strong {
  font-weight: 900;
  white-space: nowrap;
}

.integrated-reservation-control.buy > strong,
.integrated-reservation-control.buy button[type="submit"] {
  color: var(--danger);
}

.integrated-reservation-control.sell > strong,
.integrated-reservation-control.sell button[type="submit"] {
  color: var(--accent-2);
}

.integrated-reservation-control .integrated-trigger-price {
  min-width: 41px;
}

.integrated-reservation-control .integrated-trigger-qty {
  min-width: 35px;
}

.integrated-reservation-control input {
  box-sizing: border-box;
  min-width: 0;
  min-height: 25px;
  padding: 0 1px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.integrated-reservation-control select {
  box-sizing: border-box;
  width: 100%;
  min-width: 52px;
  min-height: 25px;
  padding: 0 0 0 2px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.integrated-reservation-control button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 25px;
  padding: 0 1px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  white-space: nowrap;
}

.integrated-reservation-control.buy button {
  border-color: #e1aaa4;
}

.integrated-reservation-control.sell button {
  border-color: #a9c6df;
}

.integrated-reservation-control button:disabled,
.integrated-reservation-control input:disabled,
.integrated-reservation-control select:disabled {
  cursor: default;
  opacity: 0.45;
}

.target-card-head .card-action-button.engine-toggle {
  min-width: 42px;
  padding: 0 3px;
}

.target-card-head .target-trade-count {
  width: 28px;
  min-width: 28px;
  padding: 0;
}

.target-card-head .target-header-detail {
  flex: 0 0 30px;
  width: 30px;
  min-width: 30px;
  padding: 0 2px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}

.target-card-head .target-header-detail span {
  transform: translateY(-1px);
}

.target-current-price {
  color: var(--text);
  font-size: clamp(15px, 1.45vw, 24px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.target-current-price.up {
  color: var(--danger);
}

.target-current-price.down {
  color: var(--accent-2);
}

.target-current-price.stale {
  color: #7a5a12;
}

.target-quote-stale {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid #e4c76f;
  border-radius: 4px;
  background: #fff8db;
  color: #6f4f00;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.target-change-rate {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: clamp(13px, 1.1vw, 18px);
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.target-change-rate.up {
  color: var(--danger);
}

.target-change-rate.down {
  color: var(--accent-2);
}

/* 시장 대비 상대강도 — "등락률 / 상대강도" 쌍 표기(표시 전용 지표, STRATEGY_RULES §2.4) */
.target-change-sep {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: clamp(13px, 1.1vw, 18px);
  font-weight: 400;
}

.target-relative-strength {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: clamp(13px, 1.1vw, 18px);
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.target-relative-strength[data-ichimoku-for] {
  cursor: zoom-in;
}

.target-relative-strength.up {
  color: var(--danger);
}

.target-relative-strength.down {
  color: var(--accent-2);
}

.target-card-actions {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: end;
  gap: 3px;
}

.target-card-switches,
.target-card-secondary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 28px;
  gap: 3px;
}

.target-today-trades {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 28px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  cursor: pointer;
}

.target-today-trades:hover {
  border-color: #9fb0c0;
}

.target-quick-stats {
  display: grid;
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 0.9fr) minmax(0, 0.95fr) minmax(0, 1.1fr) minmax(0, 1.85fr);
  gap: 3px;
  min-width: 0;
  margin-bottom: 6px;
}

.target-quick-stats > span:first-child {
  padding-left: 2px;
  padding-right: 2px;
}

.target-stock-flow {
  display: grid;
  gap: 1px;
  min-width: 0;
  min-height: 38px;
  padding: 3px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.target-stock-flow .flow-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.target-stock-flow .flow-pair {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.target-stock-flow .flow-row span {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: left;
}

.target-stock-flow .flow-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-quick-stats span {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1px;
  min-width: 0;
  min-height: 38px;
  padding: 3px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
}

.target-quick-stats em {
  min-width: 0;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.target-quick-stats strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  min-height: 28px;
  padding: 0 6px;
  font-size: 11px;
  white-space: nowrap;
  overflow: visible;
}

.card-action-button.active {
  border-color: var(--ok);
  color: var(--ok);
}

.card-action-button.engine-toggle {
  min-width: 54px;
  padding: 0 4px;
  gap: 0;
  font-weight: 900;
}

.target-quote-halted {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid #d88b8b;
  border-radius: 4px;
  background: #ffe5e5;
  color: #8f1d1d;
  font-size: 11px;
  font-weight: 900;
}

.card-action-button.engine-toggle.is-on {
  border-color: var(--ok);
  background: var(--ok);
  color: #ffffff;
}

.card-action-button.engine-toggle.is-off {
  border-color: #c9d3de;
  background: #eef2f6;
  color: #526071;
}

.card-action-button.engine-toggle.rule31-managed.is-review-paused {
  border-color: #d6aa46;
  background: #fff2cd;
  color: #805b00;
}

.card-action-button.engine-toggle.rule31-managed:disabled {
  opacity: 1;
  cursor: default;
}

.card-action-button.engine-toggle.is-pending,
.card-action-button.engine-toggle.is-pending:disabled {
  min-width: 68px;
  border-color: #6f91c8;
  background: #eaf1ff;
  color: #294f86;
  cursor: progress;
  opacity: 1;
}

.card-action-button.price-trigger-toggle {
  min-width: 42px;
  padding: 0 6px;
  font-weight: 900;
}

.card-action-button.price-trigger-toggle.is-on {
  border-color: var(--danger);
  background: #fff0ee;
  color: var(--danger);
}

.card-action-button.price-trigger-toggle.is-off {
  border-color: #c9d3de;
  background: #ffffff;
  color: #111827;
}

.card-action-button.price-trigger-toggle.is-pending,
.card-action-button.price-trigger-toggle.is-pending:disabled {
  border-color: #d49a4b;
  background: #fff6df;
  color: #805600;
  cursor: progress;
  opacity: 1;
}

.card-action-button[data-toggle-target] {
  width: 30px;
  min-width: 30px;
  flex: 0 0 30px;
  padding: 0 2px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}

.card-action-button.danger {
  background: #ffffff;
  border-color: #f0c7c2;
  color: var(--danger);
}

.card-action-button.danger:hover {
  background: #fff5f4;
  border-color: var(--danger);
}

.target-quote-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.quote-item strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.quote-item.status-halted strong {
  color: #8f1d1d;
}

.target-quote-grid .quote-item {
  text-align: right;
}

input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: #ffffff;
  color: var(--text);
}

select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: #ffffff;
  color: var(--text);
}

input[type="range"] {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
}

.table-wrap {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.table-wrap.compact {
  max-height: 180px;
}

.table-wrap.tall {
  max-height: 340px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

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

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.target-signal {
  display: grid;
  grid-template-rows: auto minmax(calc(1.35em * 3), auto);
  gap: 4px;
  margin-top: 6px;
  padding: 8px 10px;
  min-height: 92px;
  height: auto;
  box-sizing: border-box;
  border-left: 4px solid var(--accent-2);
  border-radius: 4px;
  background: #f8fafc;
  font-size: 12px;
  min-width: 0;
}

.target-card.expanded .target-signal {
  grid-template-rows: auto auto auto auto auto;
  min-height: 209px;
  height: auto;
}

.target-signal.sell,
.target-signal.wait-sell {
  border-left-color: var(--danger);
}

.target-signal.buy,
.target-signal.wait-buy {
  border-left-color: var(--ok);
}

.target-signal-main {
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.target-signal-main strong {
  flex: 0 0 auto;
  font-size: 14px;
}

.target-signal-main span,
.target-signal-detail span {
  font-variant-numeric: tabular-nums;
}

.target-signal-main span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: normal;
  color: var(--muted);
  line-height: 1.25;
}

.target-signal-main .target-signal-score {
  flex: 1 1 0;
  overflow: visible;
  overflow-wrap: anywhere;
  position: relative;
  top: 2px;
  text-overflow: clip;
  white-space: normal;
}

.target-signal-reservation-control {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
  max-width: 100%;
}

.target-signal-main .target-signal-reservation-value {
  flex: 0 1 auto;
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  color: var(--danger);
  font-weight: 900;
  text-align: right;
  text-overflow: clip;
  white-space: normal;
}

.target-signal-main .target-signal-reservation-value.empty {
  color: var(--muted);
  font-weight: 750;
}

.target-signal-reservation-toggle {
  flex: 0 0 auto;
  min-width: 42px;
  min-height: 26px;
  padding: 2px 7px;
  border: 1px solid #c9d3de;
  border-radius: 7px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.target-signal-reservation-toggle.is-on {
  border-color: var(--danger);
  background: #fff0ee;
  color: var(--danger);
}

.target-signal-reservation-toggle.is-pending,
.target-signal-reservation-toggle.is-pending:disabled {
  border-color: #d49a4b;
  background: #fff6df;
  color: #805600;
  cursor: progress;
  opacity: 1;
}

.target-signal-message {
  color: var(--text);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.target-card.expanded .target-signal-message {
  overflow-wrap: anywhere;
}

.target-signal-detail,
.target-signal-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.target-signal-detail {
  align-content: start;
}

.target-signal-rules {
  align-content: start;
}

.target-signal-detail span,
.target-signal-rules span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--muted);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-signal-detail .signal-chip.danger {
  border-color: rgba(185, 28, 28, 0.35);
  color: var(--danger);
  font-weight: 800;
}

.target-signal-indicators {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-details {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.price-trigger-panel {
  min-width: 0;
  margin-top: 2px;
  padding: 9px;
  border: 1px solid #c8d6e3;
  border-radius: 6px;
  background: #f8fbfe;
}

.price-trigger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.price-trigger-head > div {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.price-trigger-head strong {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.price-trigger-head strong i {
  color: #a87500;
}

.price-trigger-head > div > span,
.price-trigger-live-price {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.price-trigger-safety {
  margin: 5px 0 7px;
  padding: 5px 7px;
  border-radius: 4px;
  background: #fff8dc;
  color: #695000;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.35;
}

.price-trigger-form {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr 1fr 0.85fr;
  align-items: end;
  gap: 5px;
  min-width: 0;
}

.price-trigger-form label {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.price-trigger-form label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.price-trigger-form input,
.price-trigger-form select {
  min-width: 0;
  min-height: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.price-trigger-form input {
  text-align: right;
}

.price-trigger-submit {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 82px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid #9b7410;
  border-radius: 5px;
  background: #fff3c4;
  color: #654900;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.price-trigger-submit:hover {
  background: #ffeaa0;
}

.price-trigger-submit:disabled {
  cursor: progress;
  opacity: 0.6;
}

.price-trigger-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.price-trigger-form-foot > span:first-child {
  color: #435268;
  font-weight: 900;
}

.price-trigger-feedback {
  margin-top: 6px;
  padding: 5px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 850;
}

.price-trigger-feedback.pending {
  background: #fff8e5;
  color: #8a5b00;
}

.price-trigger-feedback.ok {
  background: #eefbf3;
  color: #17683b;
}

.price-trigger-feedback.error,
.price-trigger-empty.error {
  background: #fff0ee;
  color: var(--danger);
}

.price-trigger-list {
  display: grid;
  gap: 5px;
  max-height: 230px;
  margin-top: 7px;
  overflow: auto;
}

.price-trigger-row {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-left: 3px solid #94a3b8;
  border-radius: 5px;
  background: #ffffff;
}

.price-trigger-row.armed {
  border-left-color: #d4a51f;
}

.price-trigger-row.triggered,
.price-trigger-row.submitted,
.price-trigger-row.partially_filled {
  border-left-color: #3b82b6;
}

.price-trigger-row.filled {
  border-left-color: var(--ok);
}

.price-trigger-row.failed,
.price-trigger-row.rejected {
  border-left-color: var(--danger);
  background: #fffafa;
}

.price-trigger-row.cancelled,
.price-trigger-row.expired {
  opacity: 0.72;
}

.price-trigger-row-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 11px;
}

.price-trigger-row-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-trigger-side,
.price-trigger-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.price-trigger-side.buy {
  background: #fff0ee;
  color: var(--danger);
}

.price-trigger-side.sell {
  background: #edf7ff;
  color: var(--accent-2);
}

.price-trigger-status {
  background: #edf2f7;
  color: #485465;
}

.price-trigger-row.armed .price-trigger-status {
  background: #fff6d8;
  color: #765600;
}

.price-trigger-row.triggered .price-trigger-status,
.price-trigger-row.submitted .price-trigger-status,
.price-trigger-row.partially_filled .price-trigger-status {
  background: #eaf4fb;
  color: #24516b;
}

.price-trigger-row.filled .price-trigger-status {
  background: #e7f6ee;
  color: var(--ok);
}

.price-trigger-row.failed .price-trigger-status,
.price-trigger-row.rejected .price-trigger-status {
  background: #fff0ee;
  color: var(--danger);
}

.price-trigger-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.price-trigger-row-meta > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-trigger-row-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.price-trigger-cancel,
.price-trigger-edit,
.price-trigger-order-link {
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: #435268;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.price-trigger-edit {
  border-color: #b7c6d8;
  color: var(--accent-2);
}

.price-trigger-cancel {
  border-color: #d8a8a2;
  color: var(--danger);
}

.price-trigger-cancel:disabled {
  cursor: progress;
  opacity: 0.58;
}

.price-trigger-empty {
  margin-top: 7px;
  padding: 9px;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.config-panel.active {
  display: flex;
  flex-direction: column;
}

.config-panel .panel-head {
  flex: 0 0 auto;
}

.config-save-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.config-save-status {
  min-width: 0;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.config-save-status.saving {
  color: var(--muted);
}

.config-save-status.success {
  color: var(--ok);
}

.config-save-status.error {
  color: var(--danger);
}

.config-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.config-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.config-section,
.weights-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.config-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.config-section h3,
.weights-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.config-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.config-section-title h3 {
  margin: 0;
}

.config-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 72px);
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef1f4;
}

.config-mode-tabs button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.config-mode-tabs button.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.16);
}

.config-mode-tabs button[data-limit-mode="REAL"].active {
  color: #b42318;
}

.strategy-profile-title-row {
  justify-content: flex-start;
}

.strategy-profile-state {
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
}

.strategy-profile-state.running {
  border-color: #86c99b;
  background: #e9f8ee;
  color: #176b34;
}

.strategy-profile-state.paused {
  border-color: #e5c46d;
  background: #fff7dd;
  color: #805b00;
}

.strategy-profile-state.pending {
  color: var(--muted);
}

.strategy-profile-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 132px));
  gap: 6px;
  justify-content: start;
}

.strategy-profile-options button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #64748b;
  cursor: default;
  font-size: 12px;
  font-weight: 900;
}

.strategy-profile-options button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.14);
}

.strategy-profile-description {
  max-width: 920px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.weights-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 10px;
}

.weights-toolbar h3 {
  flex: 0 0 auto;
  margin: 0;
}

.weight-profile-name {
  width: 112px;
  min-width: 0;
  height: 32px;
  text-align: center;
}

#weightProfileUpdateBtn,
#weightProfileCreateBtn,
#weightProfileDeleteBtn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
}

.weight-profile-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.weight-profile-button {
  flex: 0 0 116px;
  width: 116px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weight-profile-button:hover {
  border-color: var(--accent);
  background: #eef5ff;
}

.weight-profile-button.active {
  border-color: var(--accent);
  background: #1f6feb;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.15);
}

.config-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, 126px);
  gap: 7px;
  justify-content: start;
}

.config-form label,
.config-form .config-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
}

.config-form .config-field > span,
.credential-field > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-form label.config-critical,
.config-form .config-field.config-critical {
  color: var(--danger);
  font-weight: 900;
}

.config-fields .wide-toggle-field {
  grid-column: span 2;
  justify-self: start;
  width: 168px;
}

.config-form input:not([type="range"]),
.config-form select {
  text-align: center;
  text-align-last: center;
}

.config-form select option {
  text-align: center;
}

.config-toggle-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  min-height: 36px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.config-toggle-group.compact {
  min-height: 34px;
}

.config-toggle-button {
  min-width: 0;
  padding: 0 5px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
}

.wide-toggle-field .config-toggle-button {
  white-space: nowrap;
}

.config-toggle-button.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.config-toggle-button:not(:disabled):hover {
  background: #e8f0ff;
  color: var(--accent);
}

.config-toggle-button.active:not(:disabled):hover {
  background: #155dcc;
  color: #ffffff;
}

.config-toggle-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.credential-rows {
  display: grid;
  gap: 8px;
}

.broker-config-section label,
.broker-config-section .credential-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
}

.broker-config-section input,
.broker-config-section select {
  text-align: left;
}

.broker-config-section select {
  text-align-last: center;
}

.credential-row {
  display: grid;
  grid-template-columns: 24px 72px 82px 88px 92px 92px 42px repeat(4, minmax(110px, 1fr)) auto;
  gap: 7px;
  align-items: end;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.credential-user-id,
.credential-password,
.credential-account,
.credential-product {
  width: 100%;
}

.credential-product input {
  text-align: center;
}

.credential-row.active {
  border-color: var(--ok);
  background: #f4fbf7;
}

.credential-seq {
  align-self: center;
  justify-self: center;
  color: #111827;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.credential-seq.active {
  color: var(--danger);
}

.credential-actions {
  display: flex;
  align-items: end;
  gap: 6px;
  min-width: max-content;
}

.credential-actions button {
  min-height: 32px;
  padding: 0 8px;
  font-size: 11px;
}

.weights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 166px);
  gap: 7px;
  justify-content: start;
}

/* 가중치 그리드의 매수/매도/양방향 그룹 제목 — 한 줄 전체 차지 */
.weights-group-title {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.weight-card {
  min-height: 58px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

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

.weight-card-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weight-card output {
  flex: 0 0 3ch;
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.rule31-readonly-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 82px;
  border-style: dashed;
  background: #f8fafc;
}

.rule31-readonly-card .weight-card-head {
  align-items: flex-start;
}

.rule31-weight-state {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
}

.rule31-readonly-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.rule31-readonly-card.running {
  border-color: #62ad7a;
  border-style: solid;
  background: #effaf2;
}

.rule31-readonly-card.running .rule31-weight-state {
  background: #d4f1dd;
  color: #176b34;
}

.rule31-readonly-card.paused {
  border-color: #d5ae43;
  background: #fff9e8;
}

.rule31-readonly-card.paused .rule31-weight-state {
  background: #f9e9b7;
  color: #805b00;
}

.rule31-readonly-card.inactive {
  opacity: 0.72;
}

#configSaveBtn {
  flex: 0 0 auto;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 252px minmax(0, 1fr); /* 기존 420px의 3/5 */
  }

  /* 좁은 폭에서 중앙 KOSPI가 탭/토글과 겹침 — 숨김(잔고 스탯 바는 유지) */
  .kospi-index {
    display: none;
  }

  .workspace-page.active {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .target-cards {
    grid-template-columns: repeat(auto-fill, minmax(368px, 1fr));
  }

  /* 중간 폭에서도 KRX/NXT 두 가격을 같은 행에 유지하고 요약 통계는 다음 행으로 둡니다. */
  .target-card-main {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .price-trigger-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .price-trigger-submit {
    grid-column: 1 / -1;
  }

  .price-trigger-form-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

@media (max-width: 1500px) {
  .actions {
    justify-content: flex-end;
  }
}

@media (max-width: 720px) {
  body {
    height: auto;
    overflow: auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  /* center+overflow는 좌측이 잘려 스크롤 불가 — 좁은 화면은 좌측 기준 스크롤 */
  .stats-bar {
    justify-content: flex-start;
  }

  .topbar-main {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .top-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .actions {
    width: 100%;
    justify-content: flex-start;
  }

  .trade-proposal-bar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .trade-proposal-main {
    white-space: normal;
    flex-wrap: wrap;
  }

  .trade-proposal-actions {
    justify-content: flex-start;
  }

  .layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    height: auto;
    min-height: 520px;
  }

  .form-row,
  .search-row,
  .target-register,
  .quote-grid,
  .target-cards,
  .config-fields,
  .credential-row,
  .weights-grid {
    grid-template-columns: 1fr;
  }

  .venue-price-grid {
    grid-template-columns: minmax(0, 1fr) 126px;
  }

  .credential-seq {
    justify-self: start;
  }

  .credential-actions {
    justify-content: start;
    flex-wrap: wrap;
  }

  .price-trigger-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .price-trigger-row-main {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .price-trigger-status {
    grid-column: 2 / -1;
    justify-self: end;
  }
}

/* 계좌 잔고와 코스피·코스닥 투자자 수급 요약. */
.account-summary {
  display: flex;
  gap: 8px;
  color: var(--muted, #8b93a7);
}

.account-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  width: 120px;
  flex: 0 0 auto;
  text-align: center;
  min-height: 42px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  color: var(--muted, #8b93a7);
}

.account-cell.account-split {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 146px;
  text-align: left;
}

.account-cell.account-wide {
  width: 126px;
  padding-right: 8px;
}

.account-cell.account-flow {
  width: 142px;
}

.account-cell.account-flow-bar {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  align-items: stretch;
  justify-content: flex-start;
  gap: 5px;
  flex-direction: row;
}

.account-cell.account-flow-bar .flow-market {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.account-cell.account-flow-bar .flow-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 0 0 auto;
}

.account-cell.account-flow-bar .flow-line {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 4px;
  min-height: 14px;
}

.account-cell.account-flow-bar .flow-line span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.account-cell.account-flow-bar .flow-line strong {
  flex: 0 0 3.6em;
  box-sizing: content-box;
  width: 3.6em;
  min-width: 3.6em;
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.account-cell.account-flow-bar .flow-sep {
  display: flex;
  align-items: center;
  padding: 0 2px;
  color: #94a3b8;
  font-size: 16px;
  font-weight: 700;
}

.account-cell.account-flow strong {
  display: flex;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.account-cell.account-flow strong .up,
.account-cell.account-flow-bar .up {
  color: var(--danger);
}

.account-cell.account-flow strong .down,
.account-cell.account-flow-bar .down {
  color: var(--accent-2);
}

.account-cell.account-flow.is-stale,
.account-cell.account-flow-bar.is-stale {
  opacity: 0.58;
}

.account-label {
  font-size: 11px;
}

.account-cell strong {
  font-size: 13px;
  color: inherit;
}

.account-cell.account-split strong {
  display: grid;
  gap: 1px;
  min-width: 82px;
  text-align: right;
  line-height: 1.08;
}

.account-cell.account-wide strong {
  min-width: 0;
}

.account-cell.account-split strong span {
  display: block;
}

.account-pnl.up {
  color: var(--danger);
}

.account-pnl.down {
  color: var(--accent-2);
}

/* 거래내역 기간 조회 바 */
.orders-mode-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin-left: 6px;
  padding: 0 7px;
  border: 1px solid #9aa4b2;
  border-radius: 4px;
  background: #f4f6f8;
  color: #475467;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}

.orders-mode-badge.real {
  border-color: #e6a39b;
  background: #fff1ef;
  color: #b42318;
}

.orders-period-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.orders-period-control {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.orders-period-control strong {
  font-size: 13px;
  color: var(--text);
}

.orders-period-control input {
  box-sizing: border-box;
  width: 120px;
  min-width: 120px;
  flex: 0 0 120px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.orders-range-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: 4px;
}

.orders-range-buttons button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 11px;
  white-space: nowrap;
}

.orders-range-buttons button:hover {
  border-color: #9fb7d8;
  background: #f6f9fd;
}

.orders-side-buttons,
.orders-market-buttons {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.orders-side-buttons button,
.orders-market-buttons button {
  min-width: 48px;
  min-height: 28px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.orders-side-buttons button:last-child,
.orders-market-buttons button:last-child {
  border-right: 0;
}

.orders-side-buttons button:hover,
.orders-market-buttons button:hover {
  background: #f6f9fd;
  color: var(--text);
}

.orders-side-buttons button.active,
.orders-market-buttons button.active {
  background: #263142;
  color: #ffffff;
}

.orders-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  min-width: 0;
}

.orders-search-bar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  flex: 0 0 auto;
}

.orders-stock-select {
  min-width: 0;
}

.orders-stock-select select {
  width: min(260px, 28vw);
  min-width: 160px;
}

.orders-search-field {
  flex: 1 1 auto;
  min-width: 140px;
}

.orders-search-field input {
  min-width: 0;
  width: 100%;
}

.orders-search-bar input,
.orders-search-bar select {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
}

.orders-search-bar input[type="number"] {
  width: 86px;
}

.orders-check {
  min-height: 30px;
  display: inline-flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 5px;
  color: var(--text) !important;
}

.orders-check input {
  min-height: auto;
  width: 14px;
  height: 14px;
  padding: 0;
}

.orders-search-bar button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.orders-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.orders-stock-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 92px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.orders-stock-card:hover,
.orders-stock-card.active {
  border-color: #9fb7d8;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.orders-stock-card.active {
  background: #f6f9fd;
}

.orders-card-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.orders-card-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-card-name em {
  font-style: normal;
  color: var(--muted);
  font-weight: 600;
}

.orders-card-hpr {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  min-width: 76px;
  white-space: nowrap;
  text-align: right;
}

.orders-card-hpr em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 700;
}

.orders-card-hpr strong {
  font-size: 11.5px;
  font-weight: 900;
  text-align: right;
}

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

.orders-card-row span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  flex: 1 1 96px;
}

.orders-card-row em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}

.orders-card-row strong {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.orders-card-money {
  padding-top: 0;
  border-top: 0;
}

.orders-card-row .up,
.orders-card-hpr .up {
  color: var(--danger);
}

.orders-card-row .down,
.orders-card-hpr .down {
  color: var(--accent-2);
}

.orders-detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 6px;
  flex-wrap: wrap;
}

.orders-detail-head h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}

.orders-detail-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.orders-detail-tools button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.orders-detail-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.orders-trade-list {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.orders-trade-row {
  display: grid;
  grid-template-rows: auto auto;
  gap: 6px;
  min-width: 1640px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  cursor: pointer;
}

.orders-trade-summary {
  display: grid;
  grid-template-columns:
    210px minmax(138px, 170px) 152px 56px 54px 54px 82px 78px 108px 96px 92px 76px 70px 112px;
  gap: 8px;
  align-items: center;
  min-width: 1628px;
}

.orders-trade-row:last-child {
  border-bottom: 0;
}

.orders-trade-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: default;
}

.orders-trade-head .orders-trade-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-trade-head .orders-trade-summary span:nth-child(1),
.orders-trade-head .orders-trade-summary span:nth-child(3),
.orders-trade-head .orders-trade-summary span:nth-child(4) {
  text-align: center;
}

.orders-trade-head .orders-trade-summary span:nth-child(5),
.orders-trade-head .orders-trade-summary span:nth-child(6),
.orders-trade-head .orders-trade-summary span:nth-child(7),
.orders-trade-head .orders-trade-summary span:nth-child(8),
.orders-trade-head .orders-trade-summary span:nth-child(9),
.orders-trade-head .orders-trade-summary span:nth-child(10),
.orders-trade-head .orders-trade-summary span:nth-child(11),
.orders-trade-head .orders-trade-summary span:nth-child(12),
.orders-trade-head .orders-trade-summary span:nth-child(13),
.orders-trade-head .orders-trade-summary span:nth-child(14) {
  text-align: right;
}

.orders-trade-body .orders-trade-row:hover {
  background: #fbfdff;
}

.orders-trade-body .orders-trade-row.expanded {
  background: #f8fbff;
}

.orders-trade-aggregate {
  cursor: default;
  font-weight: 900;
}

.orders-trade-aggregate.period {
  background: #edf3f8;
  color: #1f2937;
}

.orders-trade-body .orders-trade-aggregate.period:hover {
  background: #edf3f8;
}

.orders-trade-aggregate.day {
  background: #f8fafc;
  color: #334155;
}

.orders-trade-body .orders-trade-aggregate.day:hover {
  background: #f8fafc;
}

.orders-trade-aggregate .orders-trade-time {
  font-weight: 900;
}

.orders-trade-summary .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.orders-trade-time {
  text-align: center;
  line-height: 1.35;
  white-space: nowrap;
}

.orders-trade-summary > span:nth-child(3) {
  text-align: center;
}

.orders-trade-summary > span:nth-child(4) {
  text-align: center;
  font-weight: 800;
}

.orders-trade-side {
  font-weight: 900;
}

.orders-trade-side.buy {
  color: #c2410c;
}

.orders-trade-side.sell {
  color: #2563eb;
}

.orders-trade-buy-prices {
  line-height: 1.35;
  white-space: normal;
}

.orders-trade-reason {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  min-width: 1628px;
  padding-top: 6px;
  border-top: 1px dashed #d9e0e7;
  white-space: normal;
  line-height: 1.35;
}

.orders-trade-reason[hidden] {
  display: none;
}

.orders-trade-reason-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.orders-trade-reason-body {
  min-width: 0;
}

.orders-reason-line {
  font-weight: 700;
}

.orders-reason-sub {
  margin-top: 3px;
  color: #475569;
}

.orders-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  color: var(--muted);
  font-size: 12px;
}

/* 거래내역 종목 필터(레거시 캐시 호환) */
.order-filter {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
}

/* 카드에서 거래내역으로 이동하는 셀 */
.quote-item.order-link {
  cursor: pointer;
}

.quote-item.order-link:hover strong {
  text-decoration: underline;
}

/* 당일 실현손익(주문 패널 헤더) */
.daily-pnl {
  font-size: 14px;
  font-weight: 700;
}

.daily-pnl.up {
  color: var(--danger);
}

.daily-pnl.down {
  color: var(--accent-2);
}

/* 종목 카드 손익 줄 — 평가손익·실현손익·푸시 건별 거래량·거래횟수·수수료·세금 */
.target-pnl {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  text-align: right;
}

.target-pnl .quote-item span {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target-pnl .quote-item strong {
  font-size: 12.5px;
  white-space: nowrap;
  overflow-wrap: normal;
}

.target-pnl .up,
.order-reason-cell .up,
td .up {
  color: var(--danger);
}

.target-pnl .down,
.order-reason-cell .down,
td .down {
  color: var(--accent-2);
}

/* 주문 발생 원인 칼럼 */
.order-reason-cell {
  max-width: 380px;
  white-space: normal;
}

.order-reason-detail {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted, #8b93a7);
}

/* 거래내역 HPR 요약 — 기간 확정수익/미실현수익/HPR (SPEC §7.6) */
.orders-summary {
  margin-bottom: 8px;
}

.orders-summary-caption {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.orders-summary td {
  font-variant-numeric: tabular-nums;
}

.orders-summary td.up {
  color: var(--danger);
}

.orders-summary td.down {
  color: var(--accent-2);
}

.orders-summary .orders-summary-total td {
  font-weight: 800;
  background: #f8fafc;
}

@media (max-width: 900px) {
  .market-investor-market-grid {
    grid-template-columns: max-content;
  }

  .market-investor-market {
    padding-right: 0;
  }

  .market-investor-market + .market-investor-market {
    padding-top: 6px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

/* Rule31: account gate, eligible candidates and completed exclusions remain distinct. */
.inspect-buy-gate { display:grid; gap:6px; padding:12px 10px; background:#edf8ef; color:#174c30; line-height:1.5; overflow-wrap:anywhere; }
.inspect-buy-gate.is-blocked { background:#fff1d6; color:#793a09; border-left:3px solid #b66b19; }
.inspect-buy-gate small { font-size:11px; font-weight:400; }
.inspect-group h4, .inspect-group > summary { margin:0; padding:9px 10px; font-size:12px; background:#eaf0f5; color:#243c50; }
.inspect-group > summary, .inspect-check-details > summary { cursor:pointer; }
.inspect-check-details { margin-top:7px; font-size:11px; color:#526171; }
.inspect-check-details > summary { padding:5px 0; }
.inspect-row.is-qualified { background:#f0faf3; border-left:3px solid #34834e; }
.inspect-row.is-rejected { background:#faf7f4; }
.inspect-gate-reason { margin-top:5px; color:#79450e; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.inspect-account-detail { margin-top:4px; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.inspect-group-empty { padding:10px; font-size:12px; color:#64748b; }
.inspect-pane-head { flex-wrap:wrap; }
