﻿/* AI-trading — 반응형 디자인 (모바일·태블릿·PC) */

/* ─ 리셋·기본 ────────────────────────────────────────────────────────── */
:root {
  --font-ui: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic",
             -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, sans-serif;
  --font-num: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic",
              -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
              "Helvetica Neue", Arial, sans-serif;
  --metric-label-size: 10px;
  --metric-value-size: clamp(14px, 1.05vw, 18px);
}
*, *::before, *::after { box-sizing: border-box; }
/* 가로 오버플로(폰에서 좌우로 밀면 생기는 여백) 차단.
   overflow-x: clip 은 넘침만 잘라내고 스크롤 컨테이너를 안 만들어 sticky(키움 바) 유지. */
html, body { margin: 0; padding: 0; height: 100%; max-width: 100%; overflow-x: clip; }
body {
  font-family: var(--font-ui);
  background: #f5f7fa;
  color: #1e293b;
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 60px;
  width: 100%;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* ─ 상단 네비 ────────────────────────────────────────────────────────── */
.topnav {
  background: #1e293b;
  color: #f1f5f9;
  border-bottom: 1px solid #0f172a;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  max-width: 1280px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}
.brand {
  color: #fff;
  font-weight: 700;
  font-size: 17px;
}
.brand:hover { text-decoration: none; }
.nav-links {
  display: flex;
  gap: 16px;
  flex: 1;
  justify-content: center;
}
.nav-links a {
  color: #cbd5e1;
  padding: 4px 6px;
  border-radius: 4px;
}
.nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user { color: #94a3b8; font-size: 13px; }
.logout-form { margin: 0; }
.btn-logout {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid #475569;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
}
.btn-logout:hover { background: #334155; color: #fff; }

/* ─ 컨테이너 ────────────────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 16px;
}
.page-title { margin: 0 0 8px; font-size: 22px; }
.page-subtitle { margin: 0 0 20px; color: #64748b; font-size: 13px; }

/* ─ 카드 ───────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.card-label {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.card-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin: 4px 0;
}
.card-sub { font-size: 13px; color: #64748b; }

/* ─ 그리드 ──────────────────────────────────────────────────────────── */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* ─ 섹션 ───────────────────────────────────────────────────────────── */
.section { margin-bottom: 24px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h2 { margin: 0; font-size: 16px; }
.section-head .link { font-size: 13px; }

/* ─ 테이블 ──────────────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
}
.table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .pnl-pos { color: #dc2626; font-weight: 700; }
.table .pnl-neg { color: #2563eb; font-weight: 700; }
.loading { text-align: center; color: #94a3b8; padding: 16px; }

/* ─ 알림 ───────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 13px;
}
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ─ 로그인 ──────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}
.login-card h1 {
  margin: 0 0 4px;
  text-align: center;
  font-size: 22px;
}
.login-subtitle {
  text-align: center;
  color: #64748b;
  font-size: 13px;
  margin: 0 0 24px;
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; }
.login-form span { font-size: 12px; color: #475569; font-weight: 600; }
.login-form input {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.login-form input:focus { outline: 2px solid #2563eb; outline-offset: -2px; }
.login-note {
  margin: 20px 0 0;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

/* ─ 버튼 ───────────────────────────────────────────────────────────── */
.btn-primary {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}
.btn-primary:hover { background: #1d4ed8; }

/* ─ CEO 채팅 ───────────────────────────────────────────────────────── */
.ceo-live-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  padding: 11px 14px;
  margin: 0 0 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ceo-live-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}
.ceo-live-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #94a3b8;
  flex: 0 0 auto;
}
.ceo-live-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 14px;
}
.ceo-live-sub {
  color: #64748b;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(760px, 62vw);
}
.ceo-live-meta {
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ceo-live-panel.is-online .ceo-live-dot {
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}
.ceo-live-panel.is-working .ceo-live-dot {
  background: #2563eb;
  animation: ceo-live-pulse 1.2s ease-out infinite;
}
.ceo-live-panel.is-error .ceo-live-dot {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14);
}
.ceo-live-panel.is-offline .ceo-live-dot {
  background: #f59e0b;
}
@keyframes ceo-live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.38); }
  70%  { box-shadow: 0 0 0 9px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
.chat-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 16px;
  margin-bottom: 20px;
}
.chat-history {
  min-height: 240px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 8px;
  margin-bottom: 12px;
}
.chat-msg {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  max-width: 88%;
  font-size: 14px;
}
.chat-ceo {
  background: #eff6ff;
  border-left: 3px solid #2563eb;
}
.ceo-fold-card {
  width: 100%;
  max-width: 95%;
  padding: 0;
  overflow: hidden;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  background: #f8fbff;
}
.ceo-fold-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}
.ceo-fold-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
  line-height: 1.35;
}
.ceo-fold-toggle {
  flex: 0 0 auto;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}
.ceo-fold-preview {
  padding: 0 14px 10px;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}
.ceo-fold-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 0 0;
}
.ceo-fold-chips span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}
.ceo-fold-body {
  padding: 0 14px 14px;
  border-top: 1px solid #dbeafe;
  background: #fff;
}
.ceo-fold-section {
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
}
.ceo-fold-section:last-child {
  border-bottom: 0;
}
.ceo-fold-section h4 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.35;
}
.ceo-fold-text {
  color: #1e293b;
  font-size: 13px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.ceo-fold-text b {
  color: #0f172a;
}
.ceo-fold-card.is-open .ceo-fold-preview {
  display: none;
}
.chat-user {
  background: #f1f5f9;
  margin-left: auto;
  text-align: right;
}
.chat-result {
  background: #f0fdf4;
  border-left: 3px solid #16a34a;
  font-size: 12px;
  color: #166534;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.chat-form {
  display: flex;
  gap: 8px;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}
.chat-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 24px;
  font-size: 14px;
}
.chat-form input:focus { outline: 2px solid #2563eb; outline-offset: -2px; }
.btn-voice {
  width: 42px;
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #f8fafc;
  color: #0f172a;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.btn-voice:hover { background: #e2e8f0; }
.btn-voice:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-voice.unsupported {
  opacity: 0.72;
}
.btn-voice.listening {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.16);
}

/* ─ 빠른 명령 ───────────────────────────────────────────────────────── */
.quick-actions h3 { font-size: 14px; margin: 0 0 10px; color: #475569; }
.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-quick {
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: #1e293b;
}
.btn-quick:hover { background: #f8fafc; border-color: #94a3b8; }
.btn-quick.danger { color: #b91c1c; border-color: #fca5a5; }
.btn-quick.danger:hover { background: #fef2f2; }

/* ─ 빠른 명령 카테고리 (펼치기·접기) ─────────────────────────────── */
.cmd-group {
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.cmd-group-title {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  text-align: left;
}
.cmd-group-title:hover { background: #f8fafc; }
.cmd-toggle {
  font-size: 12px;
  color: #94a3b8;
  transition: transform 0.2s ease;
}
.cmd-group.open .cmd-toggle { transform: rotate(180deg); }
.cmd-group-body {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
  border-top: 1px solid #f1f5f9;
  margin-top: -1px;
}
.cmd-group.open .cmd-group-body { display: flex; }
.cmd-group-body .btn-quick { font-size: 12.5px; padding: 7px 12px; }

@media (prefers-color-scheme: dark) {
  .cmd-group {
    background: #1e293b;
    border-color: #334155;
  }
  .cmd-group-title { color: #f1f5f9; }
  .cmd-group-title:hover { background: #334155; }
  .cmd-group-body { border-color: #334155; }
}

/* ─ 푸터 ───────────────────────────────────────────────────────────── */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 8px 16px;
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  z-index: 40;
}
.footer-sep { margin: 0 6px; }

/* ─ 모바일 (갤럭시 S25 같은 폰) ─────────────────────────────────────── */
@media (max-width: 640px) {
  .ceo-live-panel {
    align-items: flex-start;
    flex-direction: column;
  }
  .ceo-live-sub {
    max-width: calc(100vw - 72px);
  }
  .chat-msg,
  .chat-msg.chat-ceo,
  .ceo-fold-card {
    max-width: 100%;
  }
  .ceo-fold-head {
    align-items: flex-start;
  }
  .ceo-fold-title {
    white-space: normal;
  }
  .ceo-fold-preview {
    font-size: 12px;
  }
  .topnav-inner { padding: 10px 12px; }
  .nav-links { width: 100%; order: 3; justify-content: space-around; }
  .nav-right { font-size: 12px; }
  .container { padding: 12px 12px; }
  .page-title { font-size: 18px; }
  .grid-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 12px; }
  .card-value { font-size: 18px; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 6px 8px; }
  .table th { font-size: 11px; }
}

/* ─ 태블릿 (갤럭시 탭 S7+) ──────────────────────────────────────────── */
@media (min-width: 641px) and (max-width: 1024px) {
  .container { padding: 16px 20px; }
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ─ 사용자 관리 추가 스타일 ────────────────────────────────────────── */
.alert-ok    { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-info  { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
.alert-warn  { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert a     { color: inherit; text-decoration: underline; font-weight: 600; }

.profile-hint {
  display: inline-block;
  font-size: 11px;
  color: #94a3b8;
  margin-left: 6px;
  border-left: 1px solid #475569;
  padding-left: 8px;
}
.user:hover .profile-hint { color: #f1f5f9; }

.grid-2cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .grid-2cols { grid-template-columns: 1fr; }
}

.card-section-title {
  margin: 0 0 12px;
  font-size: 15px;
  color: #1e293b;
}

.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-stack label { display: flex; flex-direction: column; gap: 6px; }
.form-stack span { font-size: 12px; color: #475569; font-weight: 600; }
.form-stack input {
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.form-stack input:focus { outline: 2px solid #2563eb; outline-offset: -2px; }

/* 역할 뱃지 */
.role-badge {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.role-admin { background: #fef3c7; color: #92400e; }
.role-guest { background: #e0e7ff; color: #3730a3; }
.user { color: #94a3b8; font-size: 13px; cursor: pointer; }
.user:hover { color: #fff; text-decoration: none; }

/* 관리자 페이지 액션 버튼 */
.actions { display: flex; gap: 4px; flex-wrap: wrap; }
.inline { display: inline; margin: 0; }
.btn-mini {
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: #1e293b;
  cursor: pointer;
}
.btn-mini:hover { background: #f1f5f9; }
.btn-approve { background: #10b981; color: #fff; border-color: #059669; }
.btn-approve:hover { background: #059669; }
.btn-warn { background: #f59e0b; color: #fff; border-color: #d97706; }
.btn-warn:hover { background: #d97706; }
.btn-danger { background: #ef4444; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #dc2626; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.badge-admin { background: #fef3c7; color: #92400e; }
.badge-guest { background: #e0e7ff; color: #3730a3; }
.badge-ok    { background: #d1fae5; color: #065f46; }
.badge-warn  { background: #fed7aa; color: #9a3412; }

.table .sub { color: #64748b; font-size: 11px; }

.cli-help {
  background: #0f172a;
  color: #f1f5f9;
  padding: 14px;
  border-radius: 6px;
  font-size: 12px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ─ 단타 라운드 테이블 ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table-rounds td { vertical-align: middle; padding: 10px 12px; }
.table-rounds .round-time {
  display: block; font-weight: 600; color: #0f172a; font-size: 13px;
}
.table-rounds .round-entry {
  display: block; font-size: 11px; color: #94a3b8;
}
.table-rounds .stock-name {
  font-weight: 600; color: #1e293b;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.table-rounds .stock-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; color: #94a3b8;
}
.formula-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}
.sell-reason {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}
.sell-reason.r-take_profit          { background: #dcfce7; color: #166534; }
.sell-reason.r-stop_loss            { background: #fee2e2; color: #991b1b; }
.sell-reason.r-trailing_stop        { background: #ecfccb; color: #365314; }
.sell-reason.r-time_stop            { background: #ede9fe; color: #4c1d95; }
.sell-reason.r-market_close         { background: #f3e8ff; color: #581c87; }
.sell-reason.r-portfolio_loss_flatten { background: #fecaca; color: #7f1d1d; }
.sell-reason.r-scale_out            { background: #cffafe; color: #155e75; }
.sell-reason.r-ai_hold_review       { background: #fae8ff; color: #6b21a8; }
.sell-reason.r-emergency            { background: #fef3c7; color: #92400e; }
.sell-reason.r-manual               { background: #e0e7ff; color: #3730a3; }

/* 신규 라운드 진입 애니메이션 — 1.5초 페이드 후 강조 해제 */
.row-new { animation: round-flash 1.8s ease-out 1; }
@keyframes round-flash {
  0%   { background: #fef9c3; }     /* 노란빛 강조 */
  60%  { background: #fefce8; }
  100% { background: transparent; }
}

/* 라운드 카운트 pill */
.dr-pill {
  display: inline-block;
  padding: 1px 10px;
  margin-left: 6px;
  border-radius: 12px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

/* ─ 오늘의 결과 카드 (daily_report) ────────────────────────────────── */
.card-daily-report {
  background: linear-gradient(to right, #fff, #fafbfd);
  border-left: 4px solid #2563eb;
}
.dr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 4px 0;
}
.dr-metric { text-align: left; }
.dr-text-wrap { margin-top: 14px; }
.dr-text-wrap summary {
  cursor: pointer; font-size: 13px; color: #475569;
  padding: 8px 0; user-select: none;
}
.dr-text-wrap summary:hover { color: #1e293b; }
.dr-text {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 8px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 640px) {
  .dr-grid { grid-template-columns: 1fr; gap: 12px; }
  .table-rounds .stock-name { max-width: 80px; }
}

/* ─ 수식 통계 페이지 ──────────────────────────────────────────────── */
.window-tabs {
  display: inline-flex;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 18px;
  overflow: hidden;
}
.window-tabs button {
  background: transparent;
  border: none;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.window-tabs button:hover { color: #1e293b; }
.window-tabs button.active { background: #2563eb; color: #fff; }

.table-formulas {
  font-size: 13px;
}
.table-formulas th.sortable { cursor: pointer; user-select: none; }
.table-formulas th.sortable:hover { background: #eef2f7; }
.table-formulas th.sort-asc::after  { content: " ▲"; font-size: 9px; }
.table-formulas th.sort-desc::after { content: " ▼"; font-size: 9px; }
.table-formulas td code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.table-formulas .formula-name {
  font-weight: 600;
  color: #1e293b;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-formulas .formula-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* 프로핏 팩터 색상 */
.table-formulas .pf-strong { color: #16a34a; font-weight: 700; }
.table-formulas .pf-ok     { color: #475569; font-weight: 600; }
.table-formulas .pf-weak   { color: #dc2626; font-weight: 600; }

/* 시간대별 히트맵 */
.table-heatmap td { vertical-align: middle; }
.table-heatmap .h-empty { background: transparent; color: #cbd5e1; }
.table-heatmap .h-pf    { font-weight: 700; font-size: 13px; line-height: 1.2; }
.table-heatmap .h-wr    { font-size: 10px; opacity: 0.85; margin-top: 1px; }
/* 5단계 색조 — 진할수록 강함 */
.table-heatmap .h-pf-1 { background: #fef2f2; color: #991b1b; }  /* PF < 0.7 */
.table-heatmap .h-pf-2 { background: #fef9c3; color: #854d0e; }  /* PF 0.7~1.0 */
.table-heatmap .h-pf-3 { background: #f0fdf4; color: #166534; }  /* PF 1.0~1.5 */
.table-heatmap .h-pf-4 { background: #dcfce7; color: #14532d; }  /* PF 1.5~2.0 */
.table-heatmap .h-pf-5 { background: #bbf7d0; color: #052e16; }  /* PF >= 2.0 */

@media (prefers-color-scheme: dark) {
  .table-heatmap .h-empty { color: #475569; }
  .table-heatmap .h-pf-1 { background: #450a0a; color: #fecaca; }
  .table-heatmap .h-pf-2 { background: #422006; color: #fde68a; }
  .table-heatmap .h-pf-3 { background: #14532d; color: #bbf7d0; }
  .table-heatmap .h-pf-4 { background: #166534; color: #dcfce7; }
  .table-heatmap .h-pf-5 { background: #14532d; color: #f0fdf4; font-weight: 800; }
}

.muted-note {
  margin: 12px 4px 0;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .window-tabs { width: 100%; justify-content: space-between; }
  .window-tabs button { padding: 6px 8px; font-size: 12px; }
  .table-formulas { font-size: 11px; }
  .table-formulas th, .table-formulas td { padding: 6px 4px; }
  .table-formulas .formula-name { max-width: 100px; }
}

@media (prefers-color-scheme: dark) {
  .window-tabs { background: #1e293b; border-color: #334155; }
  .window-tabs button { color: #94a3b8; }
  .window-tabs button:hover { color: #f1f5f9; }
  .table-formulas th.sortable:hover { background: #334155; }
  .table-formulas td code { background: #334155; color: #e2e8f0; }
  .table-formulas .formula-name { color: #f1f5f9; }
  .muted-note { color: #64748b; }
  .table-formulas .pf-ok { color: #cbd5e1; }
}

/* 다크 모드 보정 */
@media (prefers-color-scheme: dark) {
  .table-rounds .round-time { color: #f1f5f9; }
  .table-rounds .stock-name { color: #e2e8f0; }
  .formula-pill { background: #334155; color: #cbd5e1; }
  .dr-pill { background: #312e81; color: #c7d2fe; }
  .card-daily-report { background: #1e293b; border-left-color: #3b82f6; }
  .dr-text-wrap summary { color: #cbd5e1; }
  @keyframes round-flash {
    0%   { background: #422006; }
    60%  { background: #292524; }
    100% { background: transparent; }
  }
}

/* 조직도 SVG */
.org-chart {
  margin: 8px 0 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
}
.org-chart svg {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}
@media (prefers-color-scheme: dark) {
  .org-chart {
    background: #0f172a;
    border-color: #334155;
  }
}

/* 채팅 안 CEO 메시지 박스가 더 넓게 보이도록 */
.chat-msg.chat-ceo {
  max-width: 95%;
}

/* ─ 다크 모드 (선택, OS 따라감) ─────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  body { background: #0f172a; color: #e2e8f0; }
  .card { background: #1e293b; border-color: #334155; }
  .card-label { color: #94a3b8; }
  .card-value { color: #f1f5f9; }
  .card-sub { color: #94a3b8; }
  .table th { background: #1e293b; color: #cbd5e1; }
  .table td { border-color: #334155; color: #e2e8f0; }
  .table { color: #e2e8f0; }
  .ceo-live-panel { background: #1e293b; border-color: #334155; }
  .ceo-live-title { color: #f1f5f9; }
  .ceo-live-sub, .ceo-live-meta { color: #94a3b8; }
  .chat-card { background: #1e293b; border-color: #334155; }
  .chat-ceo { background: #1e3a8a; color: #dbeafe; }
  .ceo-fold-card { background: #172554; border-color: #1d4ed8; color: #dbeafe; }
  .ceo-fold-head { color: #eff6ff; }
  .ceo-fold-toggle { color: #93c5fd; }
  .ceo-fold-preview { color: #bfdbfe; }
  .ceo-fold-chips span { background: #1e40af; color: #dbeafe; }
  .ceo-fold-body { background: #0f172a; border-color: #1e3a8a; }
  .ceo-fold-section { border-color: #334155; }
  .ceo-fold-section h4,
  .ceo-fold-text b { color: #eff6ff; }
  .ceo-fold-text { color: #dbeafe; }
  .chat-user { background: #334155; color: #f1f5f9; }
  .chat-result { background: #14532d; color: #bbf7d0; }
  .login-card { background: #1e293b; }
  .login-form input,
  .chat-form input { background: #0f172a; color: #f1f5f9; border-color: #475569; }
  .btn-voice { background: #0f172a; color: #f1f5f9; border-color: #475569; }
  .btn-voice:hover { background: #1e293b; }
  .btn-quick { background: #1e293b; color: #e2e8f0; border-color: #475569; }
  .footer { background: #1e293b; border-color: #334155; color: #94a3b8; }
}

/* ═ 에이전트 활동 대시보드 (/agents) ════════════════════════════════ */

/* ── 부서 카드 그리드 ── */
.ag-dept-grid { display: flex; flex-direction: column; gap: 18px; }

/* ── 카테고리 그룹 밴드 (부서 상태 + 명령 타임라인 공용) ── */
.ag-cat-head {
  display: flex; align-items: center; gap: 8px;
  margin: 0 2px 9px; padding-left: 9px;
  border-left: 3px solid #cbd5e1;
}
.ag-cat-emoji { font-size: 15px; }
.ag-cat-label { font-size: 14px; font-weight: 700; color: #0f172a; }
.ag-cat-count { font-size: 12px; color: #94a3b8; font-weight: 600; }
.ag-cat-summary { margin-left: auto; display: flex; gap: 9px; font-size: 12px; font-weight: 600; }
.ag-sum-live { color: #16a34a; }
.ag-sum-partial { color: #d97706; }
.ag-sum-idle { color: #2563eb; }
.ag-sum-stub { color: #94a3b8; }
.ag-cat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.ag-band-infra .ag-cat-head         { border-color: #0ea5e9; }
.ag-band-decision .ag-cat-head      { border-color: #6366f1; }
.ag-band-execution .ag-cat-head     { border-color: #ef4444; }
.ag-band-day_trading .ag-cat-head   { border-color: #9333ea; }
.ag-band-swing_trading .ag-cat-head { border-color: #06b6d4; }
.ag-band-management .ag-cat-head    { border-color: #16a34a; }
.ag-band-ceo .ag-cat-head           { border-color: #d97706; }

/* 명령 타임라인 안의 밴드는 더 촘촘하게 */
.ag-cmd-list .ag-cat-band { margin-bottom: 8px; }
.ag-cmd-list .ag-cat-head { margin: 2px 2px 4px; padding-left: 7px; }
.ag-cmd-list .ag-cat-label { font-size: 12px; }
.ag-dept-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.ag-dept-card.ag-state-live    { border-left-color: #16a34a; }
.ag-dept-card.ag-state-partial { border-left-color: #f59e0b; }
.ag-dept-card.ag-state-idle    { border-left-color: #3b82f6; }
.ag-dept-card.ag-state-stub    { border-left-color: #cbd5e1; }
.ag-dept-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ag-dept-emoji { font-size: 18px; }
.ag-dept-name { font-weight: 700; color: #0f172a; }
.ag-dept-ko { font-size: 12px; color: #94a3b8; }
.ag-dept-head .ag-dot { margin-left: auto; }
.ag-dept-resp { font-size: 12px; color: #475569; margin-bottom: 8px; line-height: 1.4; }
.ag-dept-hb { font-size: 12px; color: #334155; margin-bottom: 6px; }
.ag-dept-stats {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 12px; color: #64748b;
}
.ag-dept-stats .ag-err { color: #dc2626; font-weight: 600; }
.ag-dept-last { font-size: 11px; color: #94a3b8; margin-top: 4px; }

/* ── 상태 점 / 범례 ── */
.ag-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: #cbd5e1; vertical-align: middle;
}
.ag-dot-live    { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,0.18); }
.ag-dot-partial { background: #f59e0b; }
.ag-dot-idle    { background: #3b82f6; }
.ag-dot-stub    { background: #cbd5e1; }
.ag-legend {
  margin: 10px 2px 0; font-size: 12px; color: #64748b;
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
}
.ag-legend .ag-dot { margin-right: 4px; }

/* ── 명령 추적 레이아웃 ── */
.ag-trace-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 16px;
  align-items: start;
}
.ag-cmd-list { padding: 6px; max-height: 70vh; overflow-y: auto; }
.ag-trace-detail { min-height: 240px; }
.ag-trace-empty, .ag-actual-note {
  color: #94a3b8; font-size: 13px; text-align: center;
  padding: 28px 12px; line-height: 1.6;
}
.ag-actual-note { text-align: left; padding: 10px 4px; }

/* ── 명령 목록 아이템 ── */
.ag-cmd-item {
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; margin-bottom: 2px;
}
.ag-cmd-item:hover { background: #f1f5f9; }
.ag-cmd-item.ag-cmd-active { background: #eff6ff; border-color: #bfdbfe; }
.ag-cmd-item.ag-cmd-failed .ag-cmd-intent { color: #dc2626; }
.ag-cmd-top { display: flex; justify-content: space-between; align-items: baseline; }
.ag-cmd-intent {
  font-size: 11px; font-weight: 700; color: #2563eb;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.ag-cmd-time { font-size: 11px; color: #94a3b8; }
.ag-cmd-text {
  font-size: 13px; color: #0f172a; margin: 3px 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ag-cmd-meta { font-size: 11px; color: #94a3b8; }

/* ── 작업 흐름 (타임라인) ── */
.ag-trace-head { border-bottom: 1px solid #e2e8f0; padding-bottom: 10px; margin-bottom: 12px; }
.ag-trace-cmd { font-size: 15px; font-weight: 700; color: #0f172a; }
.ag-trace-sub { font-size: 12px; color: #64748b; margin-top: 3px; }
.ag-trace-title { font-size: 13px; color: #2563eb; font-weight: 600; margin-top: 6px; }

.ag-flow { position: relative; margin: 4px 0 8px; }
.ag-step { display: flex; gap: 12px; }
.ag-step-rail {
  position: relative; flex: 0 0 28px; display: flex; justify-content: center;
}
.ag-step-rail::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 2px;
  background: #e2e8f0; left: 50%; transform: translateX(-50%);
}
.ag-step:first-child .ag-step-rail::before { top: 14px; }
.ag-step:last-child .ag-step-rail::before { bottom: calc(100% - 14px); }
.ag-step-dot {
  position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%;
  background: #f1f5f9; border: 1px solid #cbd5e1;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.ag-step-body { padding: 2px 0 14px; flex: 1; }
.ag-step-agent { font-size: 13px; font-weight: 700; color: #0f172a; }
.ag-step-kind {
  font-size: 10px; font-weight: 500; color: #94a3b8;
  text-transform: uppercase; margin-left: 4px;
}
.ag-step-action { font-size: 12px; color: #475569; line-height: 1.45; margin-top: 2px; }
/* kind 별 점 색상 */
.ag-step-classify .ag-step-dot { border-color: #6366f1; background: #eef2ff; }
.ag-step-llm .ag-step-dot      { border-color: #a855f7; background: #faf5ff; }
.ag-step-queue .ag-step-dot    { border-color: #f59e0b; background: #fffbeb; }
.ag-step-db .ag-step-dot       { border-color: #0ea5e9; background: #f0f9ff; }
.ag-step-external .ag-step-dot { border-color: #ef4444; background: #fef2f2; }
.ag-step-report .ag-step-dot   { border-color: #16a34a; background: #f0fdf4; }

/* ── 실제 큐 기록 ── */
.ag-actual-head {
  font-size: 12px; font-weight: 700; color: #475569;
  margin: 10px 0 6px; padding-top: 10px; border-top: 1px dashed #e2e8f0;
}
.ag-actual-row {
  display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px;
}
.ag-actual-time { color: #94a3b8; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.ag-actual-label { color: #334155; flex: 1; }
.ag-actual-err { font-size: 12px; color: #dc2626; padding: 2px 0; }
.ag-badge {
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: #f1f5f9; color: #475569; text-transform: uppercase;
}
.ag-badge-executed, .ag-badge-COMPLETED { background: #dcfce7; color: #15803d; }
.ag-badge-failed, .ag-badge-FAILED { background: #fee2e2; color: #b91c1c; }
.ag-badge-pending { background: #fef3c7; color: #b45309; }
.ag-badge-claimed { background: #dbeafe; color: #1d4ed8; }

.ag-reply { margin-top: 12px; }
.ag-reply summary { cursor: pointer; font-size: 12px; color: #2563eb; }
.ag-reply pre {
  white-space: pre-wrap; word-break: break-word; font-size: 12px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 10px; margin-top: 8px; color: #334155;
  font-family: inherit; max-height: 320px; overflow-y: auto;
}

@media (max-width: 720px) {
  .ag-trace-layout { grid-template-columns: 1fr; }
  .ag-cmd-list { max-height: 320px; }
}

@media (prefers-color-scheme: dark) {
  .ag-dept-card { background: #1e293b; border-color: #334155; }
  .ag-dept-name { color: #f1f5f9; }
  .ag-dept-resp { color: #cbd5e1; }
  .ag-dept-hb { color: #cbd5e1; }
  .ag-cmd-item:hover { background: #334155; }
  .ag-cmd-item.ag-cmd-active { background: #1e3a8a; border-color: #3b82f6; }
  .ag-cmd-text { color: #f1f5f9; }
  .ag-trace-cmd, .ag-step-agent { color: #f1f5f9; }
  .ag-step-action { color: #cbd5e1; }
  .ag-step-dot { background: #0f172a; border-color: #475569; }
  .ag-step-rail::before { background: #334155; }
  .ag-actual-label { color: #e2e8f0; }
  .ag-reply pre { background: #0f172a; border-color: #334155; color: #cbd5e1; }
  .ag-actual-head { border-color: #334155; color: #cbd5e1; }
  .ag-trace-head { border-color: #334155; }
  .ag-cat-label { color: #f1f5f9; }
}

/* ── 라이브 에이전트 맵 ── */
.agm-card { padding: 8px; }
.agm-svg { width: 100%; height: auto; display: block; max-height: 46vh; }
.agm-edge {
  stroke: #cbd5e1; stroke-width: 1.2; opacity: .22;
  transition: opacity .2s, stroke-width .2s;
}
.agm-edge-delegate { stroke: #d97706; }   /* 위임 */
.agm-edge-comms    { stroke: #0ea5e9; }   /* 외부통신 */
.agm-edge-db       { stroke: #16a34a; }   /* 저장 */
.agm-edge-recv     { stroke: #6366f1; }   /* 명령수신 */
.agm-edge.agm-edge-on { opacity: .95; stroke-width: 3; }   /* 패킷 통과 시 점등 */
.agm-node { cursor: pointer; outline: none; }
.agm-node:focus .agm-body { stroke-width: 3; }
.agm-body {
  fill: #f1f5f9; stroke: #cbd5e1; stroke-width: 1.6;
  transition: fill .3s, stroke .3s;
}
.agm-emoji { font-size: 15px; }
.agm-label { font-size: 10px; font-weight: 600; fill: #475569; }

/* 명령 흐름 캡션 (누가 → 누구에게) */
.agm-caption {
  margin: 8px 4px 0; padding: 7px 11px; font-size: 13px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  color: #334155; min-height: 18px;
}
.agm-caption b { color: #0f172a; }
.agm-cap-hop { color: #2563eb; font-weight: 600; }
.agm-cap-done { color: #16a34a; font-weight: 600; }
.agm-sep { color: #cbd5e1; margin: 0 2px; }
.agm-lg-delegate { color: #d97706; font-weight: 700; }
.agm-lg-comms { color: #0ea5e9; font-weight: 700; }
.agm-lg-db { color: #16a34a; font-weight: 700; }
.agm-ring {
  fill: none; stroke: #94a3b8; stroke-width: 2.5; opacity: 0;
  transform-box: fill-box; transform-origin: center; pointer-events: none;
}
.agm-ceo .agm-body { fill: #fef3c7; stroke: #d97706; stroke-width: 2.4; }
.agm-state-live .agm-body    { fill: #dcfce7; stroke: #16a34a; }
.agm-state-partial .agm-body { fill: #fef9c3; stroke: #f59e0b; }
.agm-state-idle .agm-body    { fill: #dbeafe; stroke: #3b82f6; }
.agm-state-stub .agm-body    { fill: #f1f5f9; stroke: #cbd5e1; }
.agm-state-live .agm-ring    { stroke: #16a34a; }
.agm-state-partial .agm-ring { stroke: #f59e0b; }

.agm-node.agm-active .agm-ring { animation: agm-pulse 1.9s ease-out infinite; }
@keyframes agm-pulse {
  0%   { transform: scale(1);   opacity: .55; }
  80%  { opacity: 0; }
  100% { transform: scale(2);   opacity: 0; }
}
.agm-node.agm-flash .agm-body { animation: agm-flash 1.05s ease-out; }
@keyframes agm-flash {
  0%   { filter: drop-shadow(0 0 0 rgba(37,99,235,0)); }
  20%  { filter: drop-shadow(0 0 10px rgba(37,99,235,.9)); }
  100% { filter: drop-shadow(0 0 0 rgba(37,99,235,0)); }
}
.agm-packet { fill: #2563eb; filter: drop-shadow(0 0 5px rgba(37,99,235,.8)); }
/* ambient 패킷 — 실제 통신 1건 (작고 은은하게, 종류별 색) */
.agm-packet-ambient { filter: drop-shadow(0 0 4px currentColor); }
.agm-pk-comms    { fill: #0ea5e9; color: #0ea5e9; }
.agm-pk-db       { fill: #16a34a; color: #16a34a; }
.agm-pk-recv     { fill: #6366f1; color: #6366f1; }
.agm-pk-delegate { fill: #d97706; color: #d97706; }

/* ═ 부서 전용 관제실 (/agents/dept/{id}) ════════════════════════ */
.dept-shell { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.dept-tree {
  position: sticky; top: 12px; align-self: start;
  background: #fff; border: 1px solid #dbe3ee; border-radius: 12px;
  padding: 12px; max-height: calc(100vh - 28px); overflow-y: auto;
}
.dept-tree-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dept-back { font-size: 12px; font-weight: 700; color: #2563eb; text-decoration: none; }
.dept-tree-title { font-size: 13px; font-weight: 800; color: #0f172a; }
.dept-tree-list { display: flex; flex-direction: column; gap: 5px; }
.dept-tree-item {
  display: grid; grid-template-columns: 24px 1fr 12px; gap: 8px; align-items: center;
  padding: 9px 8px; border-radius: 8px; color: inherit; text-decoration: none;
  border: 1px solid transparent;
}
.dept-tree-item:hover { background: #f8fafc; border-color: #e2e8f0; }
.dept-tree-item.is-active { background: #eff6ff; border-color: #bfdbfe; }
.dept-tree-icon { font-size: 17px; text-align: center; }
.dept-tree-text b { display: block; font-size: 13px; color: #0f172a; }
.dept-tree-text small {
  display: block; margin-top: 2px; font-size: 11px; color: #64748b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dept-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.dept-hero {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  background: #fff; border: 1px solid #dbe3ee; border-radius: 12px; padding: 16px 18px;
}
.dept-kicker { font-size: 12px; font-weight: 800; color: #2563eb; margin-bottom: 4px; text-transform: uppercase; }
.dept-title { margin: 0; font-size: 25px; color: #0f172a; letter-spacing: 0; }
.dept-summary { margin: 6px 0 0; font-size: 14px; color: #475569; line-height: 1.55; }
.dept-state-box {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  border: 1px solid #e2e8f0; border-radius: 999px; padding: 7px 11px;
  font-size: 12px; font-weight: 800; color: #334155; background: #f8fafc;
}
.dept-panel {
  background: #fff; border: 1px solid #dbe3ee; border-radius: 12px;
  padding: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
.dept-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.dept-panel-head h2 { margin: 0; font-size: 16px; color: #0f172a; letter-spacing: 0; }
.dept-panel-head span { font-size: 12px; color: #64748b; }
.dept-map-panel { padding-bottom: 10px; }
.dept-map-svg { width: 100%; height: auto; display: block; min-height: 300px; max-height: 56vh; background: #f8fafc; border-radius: 10px; }
.dept-map-link { fill: none; stroke: #94a3b8; stroke-width: 1.4; opacity: .42; }
.dept-link-0 { stroke: #0ea5e9; }
.dept-link-1 { stroke: #16a34a; }
.dept-link-2 { stroke: #d97706; }
.dept-link-3 { stroke: #6366f1; }
.dept-map-link-label { font-size: 10px; fill: #64748b; paint-order: stroke; stroke: #f8fafc; stroke-width: 3px; }
.dept-map-ring {
  fill: none; stroke: #22c55e; stroke-width: 3; opacity: .2;
  transform-box: fill-box; transform-origin: center;
}
.dept-map-node.is-live .dept-map-ring { animation: dept-ring 2.4s ease-out infinite; opacity: .35; }
.dept-map-body { fill: #e0f2fe; stroke: #0ea5e9; stroke-width: 2; }
.dept-map-node.is-center .dept-map-body { fill: #dcfce7; stroke: #16a34a; stroke-width: 3; }
.dept-map-node.is-top .dept-map-body { fill: #fef3c7; stroke: #d97706; stroke-width: 3; }
.dept-map-node.is-strategy .dept-map-body { fill: #eef2ff; stroke: #4f46e5; }
.dept-map-node.is-ready-strategy .dept-map-ring {
  stroke: #f59e0b;
  opacity: .38;
  animation: dept-ready-glow 2.2s ease-in-out infinite;
}
.dept-map-node.is-ready-strategy .dept-map-body {
  fill: #fff7ed;
  stroke: #f97316;
  stroke-width: 3;
  filter: drop-shadow(0 0 8px rgba(249,115,22,.36));
}
.dept-map-node.is-clickable { cursor: pointer; }
.dept-map-node.is-clickable:hover .dept-map-body,
.dept-map-node.is-clickable:focus .dept-map-body {
  stroke: #dc2626;
  filter: drop-shadow(0 0 11px rgba(220,38,38,.42));
}
.dept-map-node.is-support .dept-map-body { fill: #f1f5f9; stroke: #64748b; }
.dept-map-node.is-input .dept-map-body { fill: #ecfeff; stroke: #0891b2; }
.dept-map-node.is-queue .dept-map-body { fill: #fff7ed; stroke: #ea580c; }
.dept-map-node.is-market .dept-map-body { fill: #fef2f2; stroke: #dc2626; }
.dept-map-node-label { font-size: 10px; font-weight: 800; fill: #0f172a; pointer-events: none; }
.dept-map-node.is-center .dept-map-node-label { font-size: 12px; }
.dept-map-node-subline { font-size: 9px; font-weight: 700; fill: #475569; }
.dept-map-ready-badge { font-size: 13px; fill: #f59e0b; font-weight: 900; pointer-events: none; }
.dept-map-ready-hint { font-size: 8px; fill: #c2410c; font-weight: 800; pointer-events: none; }
.dept-map-packet { fill: #ef4444; filter: drop-shadow(0 0 6px rgba(239,68,68,.8)); }
.capital-lane-line { stroke: #dbe3ee; stroke-width: 1; stroke-dasharray: 5 5; }
.capital-lane-label { font-size: 10px; font-weight: 900; fill: #64748b; letter-spacing: 0; }
.capital-link {
  fill: none;
  stroke: #64748b;
  stroke-width: 1.8;
  opacity: .58;
  marker-end: url(#capital-arrow);
}
.capital-link-0 { stroke: #2563eb; }
.capital-link-1 { stroke: #16a34a; }
.capital-link-2 { stroke: #d97706; }
.capital-link-3 { stroke: #7c3aed; }
.capital-link-4 { stroke: #0891b2; }
.capital-arrow-head { fill: #64748b; }
.capital-link-label {
  font-size: 10px;
  font-weight: 800;
  fill: #475569;
  paint-order: stroke;
  stroke: #f8fafc;
  stroke-width: 4px;
}
.capital-node-box {
  fill: #fff;
  stroke: #94a3b8;
  stroke-width: 2.4;
  filter: drop-shadow(0 3px 0 rgba(34,197,94,.20));
}
.capital-node-title { font-size: 12px; font-weight: 900; fill: #0f172a; pointer-events: none; }
.capital-node-sub { font-size: 10px; font-weight: 750; fill: #475569; pointer-events: none; }
.capital-node-top .capital-node-box { fill: #fef3c7; stroke: #d97706; stroke-width: 3; }
.capital-node-trigger .capital-node-box { fill: #eff6ff; stroke: #2563eb; }
.capital-node-center .capital-node-box { fill: #dcfce7; stroke: #16a34a; stroke-width: 3.5; }
.capital-node-source .capital-node-box { fill: #fef2f2; stroke: #dc2626; }
.capital-node-process .capital-node-box { fill: #eef2ff; stroke: #4f46e5; }
.capital-node-store .capital-node-box { fill: #fff7ed; stroke: #ea580c; }
.capital-node-output .capital-node-box { fill: #ecfeff; stroke: #0891b2; }
.capital-packet { fill: #ef4444; filter: drop-shadow(0 0 7px rgba(239,68,68,.8)); }
@keyframes dept-ring {
  0% { transform: scale(1); opacity: .28; }
  90% { opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}
@keyframes dept-ready-glow {
  0%, 100% { opacity: .30; }
  50% { opacity: .58; }
}
.dept-map-caption {
  margin-top: 8px; padding: 7px 10px; border-radius: 8px; border: 1px solid #e2e8f0;
  background: #fff; color: #475569; font-size: 13px;
}
.dept-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.dept-metrics, .dept-data-items {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 9px;
}
.dept-metric, .dept-data-item {
  border: 1px solid #e2e8f0; border-radius: 9px; padding: 10px; background: #f8fafc; min-width: 0;
}
.dept-metric small, .dept-data-item small { display: block; color: #64748b; font-size: 11px; font-weight: 800; }
.dept-metric b, .dept-data-item b { display: block; color: #0f172a; font-size: 19px; margin-top: 4px; line-height: 1.2; overflow-wrap: anywhere; }
.dept-metric span, .dept-data-item span { display: block; color: #64748b; font-size: 11px; margin-top: 4px; line-height: 1.35; overflow-wrap: anywhere; }
.dept-data-item.is-plus b { color: #dc2626; }
.dept-data-item.is-minus b { color: #2563eb; }
.dept-duty-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.dept-duty-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #334155; }
.dept-duty-list li span { margin-top: 5px; width: 7px; height: 7px; border-radius: 50%; background: #0ea5e9; flex: 0 0 auto; }
.dept-data-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.dept-chart { border: 1px solid #e2e8f0; border-radius: 9px; background: #fff; padding: 11px; min-width: 0; }
.dept-chart h3 { margin: 0 0 9px; font-size: 14px; color: #334155; }
.dept-bars { display: grid; gap: 8px; }
.dept-bar-row { display: grid; grid-template-columns: minmax(82px, 120px) minmax(90px, 1fr) minmax(86px, auto); gap: 8px; align-items: center; }
.dept-bar-label { color: #334155; font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.dept-bar-track { height: 10px; background: #f1f5f9; border-radius: 999px; overflow: hidden; border: 1px solid #e2e8f0; }
.dept-bar-fill { height: 100%; background: #0ea5e9; border-radius: inherit; min-width: 2px; }
.dept-bar-row.is-plus .dept-bar-fill { background: #dc2626; }
.dept-bar-row.is-minus .dept-bar-fill { background: #2563eb; }
.dept-bar-value { color: #0f172a; font-size: 12px; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dept-bar-row.is-plus .dept-bar-value { color: #dc2626; }
.dept-bar-row.is-minus .dept-bar-value { color: #2563eb; }
.dept-bar-note { grid-column: 2 / -1; color: #64748b; font-size: 11px; line-height: 1.3; }
.dept-data-tables { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.dept-table-wrap { width: 100%; overflow-x: auto; border-top: 1px solid #e2e8f0; padding-top: 10px; }
.dept-table-wrap h3 { margin: 0 0 8px; font-size: 14px; color: #334155; }
.dept-table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 12px; table-layout: auto; }
.dept-table th, .dept-table td { text-align: left; padding: 6px 7px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.dept-table th { color: #64748b; font-size: 11px; background: #f8fafc; }
.dept-table td { color: #334155; overflow-wrap: normal; word-break: keep-all; }
.dept-table-total td { font-weight: 900; background: #f8fafc; color: #0f172a; border-top: 2px solid #cbd5e1; }
.dept-table .dept-num-plus { color: #dc2626; font-weight: 900; }
.dept-table .dept-num-minus { color: #2563eb; font-weight: 900; }
.dept-activity { display: grid; gap: 6px; }
.dept-act-row {
  display: grid; grid-template-columns: 88px minmax(120px, 1fr) 80px; gap: 8px; align-items: center;
  padding: 8px 9px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 12px;
}
.dept-act-row span { color: #64748b; font-variant-numeric: tabular-nums; }
.dept-act-row b { color: #0f172a; }
.dept-act-row em { font-style: normal; color: #2563eb; font-weight: 800; text-align: right; }
.dept-act-row small { grid-column: 2 / -1; color: #dc2626; }
.dept-empty { color: #94a3b8; font-size: 13px; padding: 12px 4px; }

@media (max-width: 900px) {
  .dept-shell { grid-template-columns: 1fr; }
  .dept-tree { position: relative; top: auto; max-height: none; }
  .dept-tree-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .dept-grid { grid-template-columns: 1fr; }
  .dept-hero { flex-direction: column; }
  .dept-map-svg { min-height: 220px; }
  .dept-bar-row { grid-template-columns: 1fr; gap: 4px; }
  .dept-bar-value { text-align: left; }
  .dept-bar-note { grid-column: auto; }
}

/* ═ 단타 전용 페이지 (/danta) ═══════════════════════════════════════ */
.dt-command { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  margin: 4px 0 12px; padding: 11px 14px; border: 1px solid #dbe3ee; border-radius: 10px;
  background: #f8fafc; }
.dt-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #2563eb;
  font-weight: 800; margin-bottom: 4px; }
.dt-title { margin: 0; font-size: 21px; line-height: 1.2; color: #0f172a; letter-spacing: 0; }
.dt-subtitle { display: none; margin: 3px 0 0; font-size: 12px; color: #64748b; }
.dt-command-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.dt-command-top { display: flex; align-items: center; gap: 8px; }

/* ─ 단타 페이지 모바일 최적화 (S25 Ultra 대응) ───────────────── */
.dt-command-sticky { position: sticky; top: 0; z-index: 100; background: #fff;
  border-bottom: 1px solid #e2e8f0; margin-bottom: 12px; padding: 12px 14px; border-radius: 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04); }
.dt-command-sticky .dt-title { margin: 2px 0; font-size: 22px; }
.dt-command-sticky .dt-subtitle { display: none; }
/* 한 줄 컴팩트: 좌측 제목 + 우측 [전략분석][상태칩][시각] 한 줄에 */
.dt-command-compact { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dt-command-compact .dt-title { font-size: 19px; margin: 0; flex: 1 1 auto; min-width: 0; }
.dt-command-compact .dt-command-side { flex-direction: row; align-items: center; gap: 8px; flex-wrap: nowrap; }
.dt-command-compact .dt-updated { font-size: 11px; color: #94a3b8; }

/* 키움계좌·단타운영 펼침 카드 내부 그리드 (모바일 1열, PC 다열) */
.dt-summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px 10px; padding-top: 6px; }
.dt-summary-grid > div { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.dt-summary-grid > div span { font-size: 11px; color: #64748b; }
.dt-summary-grid > div b { font-size: 14px; color: #0f172a; font-weight: 700; }
.dt-summary-grid > div b.pnl-pos { color: #dc2626; }
.dt-summary-grid > div b.pnl-neg { color: #2563eb; }
.dt-summary-grid > div.dt-op-total { grid-column: 1 / -1; background: #f1f5f9; border-color: #cbd5e1; }
.dt-summary-grid > div.dt-op-total b { font-size: 15px; font-weight: 900; }
@media (prefers-color-scheme: dark) {
  .dt-summary-grid > div b.pnl-pos { color: #f87171; }
  .dt-summary-grid > div b.pnl-neg { color: #60a5fa; }
  .dt-summary-grid > div.dt-op-total { background: #1e293b; border-color: #334155; }
}
.dt-kw-holdings { margin-top: 10px; }
.dt-kw-hold-box { background: #fff; border: 1px solid #bfdbfe; border-radius: 10px; overflow: hidden; }
.dt-kw-hold-head { display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; background: #eff6ff; border-bottom: 1px solid #bfdbfe; }
.dt-kw-hold-head span { color: #1e3a8a; font-size: 13px; font-weight: 800; }
.dt-kw-hold-head small { color: #2563eb; font-size: 11px; font-weight: 800; }
.dt-kw-hold-list { display: flex; flex-direction: column; }
.dt-kw-hold-row { display: grid; grid-template-columns: 24px minmax(110px, 1fr) minmax(96px, auto) minmax(94px, auto);
  align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid #dbeafe; }
.dt-kw-hold-row:last-child { border-bottom: 0; }
.dt-kw-hold-no { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: #dbeafe; color: #1d4ed8; font-size: 11px; font-weight: 900; }
.dt-kw-hold-name b,
.dt-kw-hold-price b { display: block; color: #0f172a; font-size: 13px; font-weight: 900;
  font-variant-numeric: tabular-nums; }
.dt-kw-hold-name small,
.dt-kw-hold-price small { display: block; margin-top: 2px; color: #64748b; font-size: 11px; font-weight: 700; }
.dt-kw-hold-price,
.dt-kw-hold-pnl { text-align: right; }
.dt-kw-hold-pnl { font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; }
.dt-kw-hold-pnl.pnl-pos { color: #dc2626; }
.dt-kw-hold-pnl.pnl-neg { color: #2563eb; }
.dt-kw-hold-empty,
.dt-kw-hold-more { padding: 9px 10px; color: #64748b; font-size: 12px; }
.dt-kw-hold-more { border-top: 1px solid #dbeafe; background: #f8fafc; }
@media (max-width: 700px) {
  .dt-kw-hold-row {
    grid-template-columns: 22px minmax(92px, 1fr) auto;
    grid-template-areas:
      "no name pnl"
      "no price price";
    row-gap: 2px;
  }
  .dt-kw-hold-no { grid-area: no; }
  .dt-kw-hold-name { grid-area: name; min-width: 0; }
  .dt-kw-hold-price { grid-area: price; text-align: left; }
  .dt-kw-hold-pnl { grid-area: pnl; }
  .dt-kw-hold-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (prefers-color-scheme: dark) {
  .dt-kw-hold-box { background: #0f172a; border-color: #1d4ed8; }
  .dt-kw-hold-head { background: #1e3a8a; border-color: #1d4ed8; }
  .dt-kw-hold-head span { color: #dbeafe; }
  .dt-kw-hold-head small { color: #93c5fd; }
  .dt-kw-hold-row { border-color: #1e293b; }
  .dt-kw-hold-no { background: #1e3a8a; color: #dbeafe; }
  .dt-kw-hold-name b,
  .dt-kw-hold-price b { color: #f1f5f9; }
  .dt-kw-hold-name small,
  .dt-kw-hold-price small,
  .dt-kw-hold-empty,
  .dt-kw-hold-more { color: #94a3b8; }
  .dt-kw-hold-pnl.pnl-pos { color: #f87171; }
  .dt-kw-hold-pnl.pnl-neg { color: #60a5fa; }
  .dt-kw-hold-more { background: #0c4a6e; border-color: #1e293b; }
}

/* 운용 승인 — 한 줄 압축 + STOP 버튼 */
.dt-control-row1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.dt-control-row1 b { font-size: 14px; }
.dt-control-row1 span { font-size: 12px; color: #64748b; }
.dt-control-mini-rounds { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dt-round-chip-wrap { display: inline-flex; align-items: center; gap: 4px; }
.dt-round-stop { border: 1px solid #fca5a5; background: #fef2f2; color: #b91c1c;
  border-radius: 6px; padding: 2px 6px; font-size: 12px; cursor: pointer; line-height: 1; }
.dt-round-stop:hover { background: #fee2e2; border-color: #ef4444; }
.dt-allactions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.dt-allok { border: 1px solid #16a34a; background: #f0fdf4; color: #15803d;
  border-radius: 8px; padding: 5px 11px; font-size: 12px; font-weight: 700; cursor: pointer; }
.dt-allok:hover { background: #dcfce7; }
.dt-allstop { border: 1px solid #ef4444; background: #fef2f2; color: #b91c1c;
  border-radius: 8px; padding: 5px 11px; font-size: 12px; font-weight: 700; cursor: pointer; }
.dt-allstop:hover { background: #fecaca; }
.dt-round-ok { border: 1px solid #86efac; background: #f0fdf4; color: #15803d;
  border-radius: 6px; padding: 2px 6px; font-size: 12px; cursor: pointer; line-height: 1; }
.dt-round-ok:hover { background: #dcfce7; border-color: #16a34a; }

/* 펼침 카드 (네이티브 <details>) — 메인 결과 밑으로 쌓이는 6개 카드 */
.dt-fold-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  margin: 0 0 10px; overflow: hidden; transition: box-shadow .15s; }
.dt-fold-card[open] { box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06); border-color: #cbd5e1; }
.dt-fold-summary { cursor: pointer; padding: 14px 16px; display: flex; align-items: center;
  gap: 10px; user-select: none; min-height: 48px; list-style: none; }
.dt-fold-summary::-webkit-details-marker { display: none; }
.dt-fold-summary::marker { content: ""; }
.dt-fold-title { font-weight: 700; font-size: 15px; color: #0f172a; flex: 0 0 auto; }
.dt-fold-meta { font-size: 12px; color: #64748b; flex: 1 1 auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-fold-chevron { color: #94a3b8; font-size: 18px; transition: transform .15s; margin-left: auto; }
.dt-fold-card[open] .dt-fold-chevron { transform: rotate(180deg); }
.dt-engine-edit-fold { display: none; }
body.dt-edit-page-mode .dt-money-section,
body.dt-edit-page-mode .dt-control-fold,
body.dt-edit-page-mode .dt-status-fold,
body.dt-edit-page-mode .dt-budget-fold,
body.dt-edit-page-mode .dt-formula-perf-fold,
body.dt-edit-page-mode #dt-engine-fold {
  display: none;
}
body.dt-edit-page-mode .dt-engine-edit-fold {
  display: block;
}
.dt-fold-extra-link { color: #2563eb; text-decoration: none; font-size: 12px; font-weight: 600;
  padding: 4px 8px; border-radius: 6px; }
.dt-fold-extra-link:hover { background: #eff6ff; }
.dt-fold-body { padding: 0 14px 14px; border-top: 1px solid #f1f5f9; }
.dt-rounds-bare { padding: 2px 0 4px; }
.dt-control-fold { display: none; }
.dt-sched-control-meta { display: flex; justify-content: flex-end; align-items: center; gap: 8px; min-width: 0; }
.dt-sched-meta-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-sched-global-actions { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.dt-sched-global-actions .dt-allok,
.dt-sched-global-actions .dt-allstop { padding: 4px 9px; font-size: 11px; border-radius: 7px; white-space: nowrap; }

/* 큰 액션 버튼 — 페이지 맨 아래 */
.dt-analysis-big { display: block; text-align: center; padding: 14px 18px; margin: 14px 0 24px;
  background: #0f172a; color: #f8fafc; border-radius: 14px; font-weight: 700; font-size: 15px;
  text-decoration: none; }
.dt-analysis-big:hover { background: #1e293b; }

/* S25 Ultra / 모바일 (≤760px) — 한 줄·여유 패딩·큰 터치 */
@media (max-width: 760px) {
  .dt-command-sticky { padding: 10px 12px; }
  .dt-command-sticky .dt-title { font-size: 19px; }
  .dt-command-sticky .dt-eyebrow { font-size: 10px; }
  .dt-command-side { width: 100%; align-items: flex-start; }
  .dt-hero { grid-template-columns: 1fr; gap: 8px; }
  .dt-hero-num { font-size: 24px; }
  .dt-fold-summary { padding: 13px 14px; min-height: 52px; }
  .dt-fold-title { font-size: 14.5px; }
  .dt-sched-control-meta { flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
  .dt-sched-meta-text { flex: 1 1 150px; }
  .dt-sched-global-actions .dt-allok,
  .dt-sched-global-actions .dt-allstop { padding: 4px 7px; font-size: 10.5px; }
  .dt-fold-body { padding: 0 12px 12px; }
  .dt-live-board { grid-template-columns: 1fr 1fr; gap: 8px; }
  .dt-live-card { padding: 10px 12px; }
  /* 회차 카드 모바일 — 버튼 가로 풀폭 */
  .dt-sched-card { padding: 12px 13px; }
  .dt-round-actions { display: grid; grid-template-columns: 1fr; gap: 6px; }
  .dt-round-actions-three { grid-template-columns: 1fr 1fr; }
  .dt-round-actions-three .dt-edit-btn { font-size: 12px; padding: 9px 8px; }
  /* 표 가로 스크롤 — 좁아도 강제 줄바꿈 안 함 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 540px; }
}
.dt-state-pill { font-size: 12px; font-weight: 800; color: #334155; background: #fff;
  border: 1px solid #cbd5e1; border-radius: 999px; padding: 4px 9px; white-space: nowrap; }
.dt-state-on { color: #166534; border-color: #86efac; background: #dcfce7; }
.dt-state-warn { color: #9a3412; border-color: #fdba74; background: #ffedd5; }
.dt-updated { color: #64748b; font-size: 11px; }

.dt-live-board { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.dt-live-card { min-height: 108px; border: 1px solid #e2e8f0; background: #fff; border-radius: 10px;
  padding: 13px 14px; display: flex; flex-direction: column; justify-content: space-between; }
.dt-live-primary { background: #111827; border-color: #111827; color: #f8fafc; }
.dt-live-label { display: block; font-size: 11px; color: #64748b; font-weight: 800; margin-bottom: 8px; }
.dt-live-primary .dt-live-label { color: #cbd5e1; }
.dt-live-card strong { display: block; color: #0f172a; font-size: 19px; line-height: 1.25; letter-spacing: 0; }
.dt-live-primary strong { color: #fff; font-size: 22px; }
.dt-live-card p { margin: 8px 0 0; color: #64748b; font-size: 12px; line-height: 1.45; }
.dt-live-primary p { color: #dbeafe; }
.dt-live-good { border-color: #86efac; background: #f0fdf4; }
.dt-live-warn { border-color: #fdba74; background: #fff7ed; }
.dt-live-good strong { color: #166534; }
.dt-live-warn strong { color: #9a3412; }
.dt-live-primary.dt-live-good { background: #14532d; border-color: #14532d; }
.dt-live-primary.dt-live-warn { background: #7c2d12; border-color: #7c2d12; }
.dt-live-board,
.dt-money-section { display: none; }
.dt-duplicate-summary-section { display: none; }
.section:has(#dt-budget) { display: none; }

.dt-engine-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  background: #cbd5e1; vertical-align: middle; margin-left: 4px; }
.dt-engine-dot.dt-on  { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.dt-engine-dot.dt-off { background: #94a3b8; }
.dt-engine { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dt-engine-card { border: 1px solid #dbe3ee; border-radius: 12px; background: #fff; padding: 13px 14px; }
.dt-engine-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dt-engine-card-head b { display: block; color: #0f172a; font-size: 17px; line-height: 1.25; }
.dt-engine-card-head span { display: block; color: #64748b; font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.dt-engine-card-head i { color: #64748b; font-style: normal; font-size: 18px; line-height: 1; transition: transform .16s; }
.dt-engine-copy { color: #475569; font-size: 12px; line-height: 1.5; margin: 10px 0 9px; }
.dt-engine-detail { display: block; }
.dt-engine-detail .dt-row:last-child { border-bottom: 0; }
.dt-sched-price { font-size: 12px; color: #64748b; margin-top: 4px; }
.dt-edit-btn { margin-top: 8px; width: 100%; font-size: 12px; padding: 5px; border: 1px dashed #94a3b8;
  background: #fff; color: #334155; border-radius: 6px; cursor: pointer; }
.dt-edit-btn:hover { background: #f1f5f9; border-style: solid; }
.dt-round-actions { display: grid; gap: 6px; margin-top: 8px; }
.dt-round-actions .dt-edit-btn { margin-top: 0; }
.dt-round-actions-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dt-round-actions-three,
.dt-round-compact-demo .dt-round-actions.dt-round-actions-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dt-engine-link-btn { border-style: solid; background: #eff6ff; color: #1d4ed8; }
.dt-engine-link-btn:hover { background: #dbeafe; }
.dt-result-btn { border-style: solid; background: #f0fdf4; color: #166534; }
.dt-result-btn:hover { background: #dcfce7; }
.dt-live-progress-btn { border-style: solid; background: #eff6ff; color: #1d4ed8; }
.dt-live-progress-btn:hover { background: #dbeafe; }
.dt-edit { grid-column: 1 / -1; border: 1px solid #bfdbfe; border-radius: 12px; padding: 16px;
  background: #ffffff; box-shadow: 0 12px 28px rgba(15,23,42,.08); }
.dt-edit-card { padding: 0; overflow: hidden; }
.dt-edit-card-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; color: #0f172a; cursor: pointer; list-style: none; background: #f8fafc;
  border-bottom: 1px solid transparent; }
.dt-edit-card-summary::-webkit-details-marker { display: none; }
.dt-edit-card-summary b { display: block; font-size: 16px; line-height: 1.2; }
.dt-edit-card-summary small { display: block; margin-top: 3px; color: #64748b; font-size: 11px; font-weight: 800; }
.dt-edit-card-summary em { flex: 0 0 auto; font-style: normal; color: #2563eb; background: #eff6ff;
  border: 1px solid #bfdbfe; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 900; }
.dt-edit-card[open] > .dt-edit-card-summary { border-bottom-color: #e2e8f0; }
.dt-edit-card-body { padding: 14px 16px 16px; }
.dt-result-panel { grid-column: 1 / -1; border: 1px solid #bbf7d0; border-radius: 12px; padding: 16px;
  background: #ffffff; box-shadow: 0 12px 28px rgba(15,23,42,.08); }
.dt-progress-panel { grid-column: 1 / -1; border: 1px solid #bfdbfe; border-radius: 12px; padding: 16px;
  background: #ffffff; box-shadow: 0 12px 28px rgba(15,23,42,.08); }
.dt-progress-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.dt-progress-summary span { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 9px 10px; }
.dt-progress-summary b { display: block; font-size: 17px; color: #0f172a; }
.dt-progress-summary small { display: block; color: #64748b; font-size: 11px; margin-top: 2px; }
.dt-progress-topline { display: flex; align-items: center; gap: 8px; min-width: 0;
  padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid #e2e8f0; }
.dt-progress-topline b { flex: 0 0 auto; color: #0f172a; font-size: 16px; line-height: 1.2; }
.dt-progress-topline span { min-width: 0; color: #64748b; font-size: 13px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-progress-topline strong { flex: 0 0 auto; color: #1d4ed8; background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 999px; font-size: 12px; padding: 4px 8px; white-space: nowrap; }
.dt-progress-summary-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 9px; }
.dt-progress-summary-compact span { display: flex; align-items: center; justify-content: space-between; gap: 6px;
  min-width: 0; padding: 7px 9px; }
.dt-progress-summary-compact small { order: 0; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 11px; font-weight: 800; }
.dt-progress-summary-compact b { order: 1; flex: 0 0 auto; font-size: 19px; line-height: 1; }
.dt-progress-summary-compact b.pnl-pos { color: #dc2626; }
.dt-progress-summary-compact b.pnl-neg { color: #2563eb; }
/* 모바일 회차 진행 — 상단 요약칩(터치하면 종목 펼침/접힘) */
.dt-progress-summary.dt-progress-summary-tap { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.dt-progress-summary-tap .dt-sum { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 6px; min-width: 0;
  cursor: pointer; text-align: center; font: inherit; -webkit-tap-highlight-color: transparent; }
.dt-progress-summary-tap .dt-sum small { color: #64748b; font-size: 11px; font-weight: 800; }
.dt-progress-summary-tap .dt-sum b { font-size: 18px; line-height: 1.1; color: #0f172a; }
.dt-progress-summary-tap .dt-sum b.pnl-pos { color: #dc2626; }
.dt-progress-summary-tap .dt-sum b.pnl-neg { color: #2563eb; }
.dt-progress-summary-tap button.dt-sum.on { background: #eff6ff; border-color: #93c5fd; box-shadow: inset 0 0 0 1px #bfdbfe; }
.dt-progress-summary-tap .dt-sum-pnl { cursor: default; }
.dt-sum-drawer { border: 1px solid #dbe3ee; border-radius: 8px; background: #f8fafc; padding: 8px; margin: 0 0 10px; }
.dt-live-cond-head { font-size: 13px; font-weight: 900; color: #0f172a; margin: 2px 0 8px; }
/* 컴팩트 종목 줄: 종목명 · 가격 · 등락률(한국색: 상승 빨강 / 하락 파랑) */
.dt-stock-list { display: flex; flex-direction: column; gap: 3px; }
.dt-stock-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center;
  width: 100%; border: 1px solid #e9eef5; border-radius: 6px; background: #fff; padding: 5px 8px;
  text-align: left; cursor: pointer; font: inherit; }
.dt-stock-row.on { border-color: #93c5fd; background: #eff6ff; }
.dt-stock-no { min-width: 18px; text-align: right; color: #94a3b8; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dt-stock-name { min-width: 0; font-weight: 800; font-size: 12.5px; color: #0f172a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-stock-price { font-size: 12.5px; font-weight: 700; color: #334155; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt-stock-chg { min-width: 50px; text-align: right; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dt-stock-chg.up { color: #dc2626; }
.dt-stock-chg.down { color: #2563eb; }
.dt-stock-chg.flat { color: #94a3b8; }
.dt-progress-console { max-height: 520px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 8px; background: #0f172a; padding: 8px; }
.dt-progress-row { display: grid; grid-template-columns: 70px 112px minmax(110px, .85fr) minmax(0, 2fr);
  gap: 9px; align-items: start; padding: 8px 9px; border-bottom: 1px solid rgba(148,163,184,.18);
  color: #e2e8f0; font-size: 12px; }
.dt-progress-row:last-child { border-bottom: 0; }
.dt-progress-row time { color: #94a3b8; font-variant-numeric: tabular-nums; }
.dt-progress-row span { font-weight: 900; color: #dbeafe; }
.dt-progress-row b { color: #fff; overflow-wrap: anywhere; }
.dt-progress-row small { color: #cbd5e1; line-height: 1.35; overflow-wrap: anywhere; }
.dt-progress-catch span { color: #93c5fd; }
.dt-progress-ai span, .dt-progress-check span { color: #fde68a; }
.dt-progress-order span { color: #c4b5fd; }
.dt-progress-filled span { color: #86efac; }
.dt-progress-blocked span { color: #fca5a5; }
.dt-live-drill { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.dt-live-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dt-live-formulas { display: flex; flex-direction: column; }
.dt-live-pane { min-width: 0; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; overflow: hidden; }
.dt-live-pane-head { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 10px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.dt-live-pane-head b { color: #0f172a; font-size: 13px; }
.dt-live-pane-head span { color: #64748b; font-size: 12px; font-weight: 800; }
.dt-live-list { display: grid; gap: 6px; overflow: auto; padding: 8px; flex: 1 1 auto; min-height: 0; }
.dt-live-formula { width: 100%; text-align: left; border: 1px solid #e2e8f0; border-radius: 8px;
  background: #fff; padding: 9px 10px; cursor: pointer; }
.dt-live-formula:hover { border-color: #bfdbfe; background: #eff6ff; }
.dt-live-formula.on { border-color: #2563eb; background: #eff6ff; box-shadow: inset 3px 0 0 #2563eb; }
.dt-live-formula b { display: block; color: #0f172a; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.dt-live-formula span { display: block; color: #475569; font-size: 12px; margin-top: 4px; }
.dt-live-formula small { display: block; color: #94a3b8; font-size: 11px; margin-top: 3px; overflow-wrap: anywhere; }
.dt-live-stock-table { max-height: 460px; overflow: auto; }
.dt-live-stock-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dt-live-stock-table th, .dt-live-stock-table td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; text-align: left; white-space: nowrap; }
.dt-live-stock-table th { position: sticky; top: 0; z-index: 1; color: #64748b; background: #fff; font-weight: 900; }
.dt-live-stock-table th:first-child, .dt-live-stock-table td:first-child { text-align: left; }
.dt-live-stock-table tbody tr { cursor: pointer; }
.dt-live-stock-table tbody tr:hover { background: #f8fafc; }
.dt-live-stock-table tbody tr.on { background: #eff6ff; box-shadow: inset 3px 0 0 #2563eb; }
.dt-live-stock-table td b { display: block; color: #0f172a; font-size: 12px; line-height: 1.2; }
.dt-live-stock-table td small { display: block; color: #94a3b8; font-size: 11px; margin-top: 2px; }
.dt-live-detail .dt-progress-console { max-height: 360px; border: 0; border-radius: 0; }
.dt-live-detail .dt-progress-row { grid-template-columns: 58px 88px minmax(64px, .7fr) minmax(0, 1.3fr); gap: 7px; }
.dt-live-mobile { display: grid; gap: 9px; }
.dt-live-mobile-card { border: 1px solid #dbe3ee; border-radius: 8px; background: #fff; overflow: hidden; }
.dt-live-mobile-card.open { border-color: #93c5fd; box-shadow: 0 8px 18px rgba(37,99,235,.08); }
.dt-live-mobile-head { width: 100%; border: 0; background: #fff; color: #0f172a; cursor: pointer;
  display: grid; grid-template-columns: minmax(0, 1fr) repeat(4, auto); gap: 6px; align-items: center;
  padding: 10px 10px; text-align: left; }
.dt-live-mobile-head:hover { background: #f8fafc; }
.dt-live-mobile-head span { min-width: 0; }
.dt-live-mobile-head b { display: block; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.dt-live-mobile-head small { display: block; margin-top: 2px; color: #64748b; font-size: 11px; overflow-wrap: anywhere; }
.dt-live-mobile-head i { font-style: normal; font-size: 11px; font-weight: 900; color: #475569;
  background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 999px; padding: 3px 7px; white-space: nowrap; }
.dt-live-mobile-card.open .dt-live-mobile-head { background: #eff6ff; }
.dt-live-mobile-card.open .dt-live-mobile-head i:first-of-type { color: #1d4ed8; background: #dbeafe; border-color: #bfdbfe; }
.dt-live-mobile-body { border-top: 1px solid #dbeafe; background: #f8fafc; }
.dt-live-mobile-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 10px; color: #475569; font-size: 12px; font-weight: 800; }
.dt-live-mobile-toolbar button { flex: 0 0 auto; border: 1px solid #bfdbfe; border-radius: 7px; background: #fff;
  color: #1d4ed8; padding: 5px 9px; font-size: 12px; font-weight: 900; cursor: pointer; }
.dt-live-mobile-section { margin: 0 8px 8px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; overflow: hidden; }
.dt-live-mobile-section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 10px; border-bottom: 1px solid #edf2f7; background: #fff; }
.dt-live-mobile-section-head b { font-size: 13px; color: #0f172a; }
.dt-live-mobile-section-head span { color: #64748b; font-size: 12px; font-weight: 900; }
.dt-live-mobile-empty { padding: 11px 10px; color: #94a3b8; font-size: 12px; line-height: 1.45; }
.dt-live-mobile-stocks { display: grid; gap: 5px; padding: 6px; }
.dt-live-mobile-stock { border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; padding: 7px 8px;
  text-align: left; cursor: pointer; }
.dt-live-mobile-stock.on { border-color: #2563eb; background: #eff6ff; box-shadow: inset 3px 0 0 #2563eb; }
.dt-live-mobile-stock b { display: block; color: #0f172a; font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.dt-live-mobile-stock span { display: block; color: #94a3b8; font-size: 11px; margin-top: 2px; }
.dt-live-mobile-stock div { display: none; }
.dt-live-mobile-stock em { min-width: 0; font-style: normal; text-align: center; font-size: 11px; font-weight: 900;
  color: #334155; border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 6px; padding: 4px 3px;
  overflow-wrap: anywhere; }
.dt-live-mobile-more { color: #64748b; font-size: 12px; font-weight: 800; text-align: center; padding: 3px 0 1px; }
.dt-live-mobile-feed { display: grid; gap: 0; background: #0f172a; }
.dt-live-mobile-feed-row { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 8px;
  padding: 8px 9px; border-bottom: 1px solid rgba(148,163,184,.18); color: #e2e8f0; }
.dt-live-mobile-feed-row:last-child { border-bottom: 0; }
.dt-live-mobile-feed-row time { color: #94a3b8; font-size: 11px; font-variant-numeric: tabular-nums; }
.dt-live-mobile-feed-row b { display: block; color: #fff; font-size: 12px; line-height: 1.25; }
.dt-live-mobile-feed-row span { display: block; margin-top: 2px; color: #cbd5e1; font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.dt-live-mobile-detail .dt-live-mobile-feed { border-top: 1px solid #e2e8f0; }
@media (max-width: 760px) {
  .dt-progress-panel, .dt-result-panel, .dt-edit { padding: 12px; border-radius: 8px; }
  .dt-progress-summary, .dt-result-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dt-progress-topline { gap: 6px; padding-bottom: 7px; margin-bottom: 7px; }
  .dt-progress-topline b { font-size: 15px; }
  .dt-progress-topline span { font-size: 12px; }
  .dt-progress-topline strong { font-size: 11px; padding: 3px 7px; }
  .dt-progress-summary.dt-progress-summary-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .dt-progress-summary-compact span { padding: 6px 5px; gap: 3px; }
  .dt-progress-summary-compact small { font-size: 9.5px; }
  .dt-progress-summary-compact b { font-size: 17px; }
  .dt-edit-head { align-items: flex-start; gap: 8px; margin-bottom: 10px; padding-bottom: 10px; }
  .dt-edit-head b { font-size: 16px; }
  .dt-edit-head strong { font-size: 11px; padding: 5px 8px; }
  .dt-live-drill { display: block; }
  .dt-live-mobile-head { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px; }
  .dt-live-mobile-head span { grid-column: auto; }
  .dt-live-mobile-head b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dt-live-mobile-head i { text-align: right; padding: 3px 7px; font-size: 10.5px; }
  .dt-live-mobile-toolbar { align-items: flex-start; }
  .dt-live-mobile-toolbar span { line-height: 1.35; }
  .dt-live-mobile-stock div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dt-live-mobile-feed-row { grid-template-columns: 48px minmax(0, 1fr); }
  .dt-live-mobile-detail .dt-history-empty { padding: 10px; }
  .dt-edit-actions { justify-content: stretch; }
  .dt-edit-actions .btn-quick { flex: 1 1 0; min-width: 0; }
}
@media (max-width: 420px) {
  .dt-progress-topline b { font-size: 14px; }
  .dt-progress-topline span { font-size: 11px; }
  .dt-progress-topline strong { font-size: 10.5px; padding: 3px 6px; }
  .dt-progress-summary-compact small { font-size: 9px; }
  .dt-progress-summary-compact b { font-size: 16px; }
}
.dt-edit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid #e2e8f0; color: #0f172a; }
.dt-edit-head b { display: block; font-size: 18px; line-height: 1.25; }
.dt-edit-head span { display: block; color: #64748b; font-size: 13px; margin-top: 3px; }
.dt-edit-head strong { flex: 0 0 auto; color: #1d4ed8; background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 999px; font-size: 12px; padding: 6px 10px; }
.dt-edit-fields { display: flex; flex-direction: column; gap: 10px; }
.dt-edit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dt-edit-field input::placeholder { color: #94a3b8; font-size: 12px; }
.dt-edit-field { display: block; min-width: 0; background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 9px 10px; }
.dt-edit-field span { display: block; color: #475569; font-weight: 800; font-size: 12px; margin-bottom: 6px; }
.dt-edit-field input, .dt-edit-field select { width: 100%; box-sizing: border-box; padding: 9px 10px; border: 1px solid #cbd5e1;
  border-radius: 8px; background: #fff; color: #0f172a; font-size: 16px; font-weight: 700; }
.dt-edit-field select { cursor: pointer; }
.dt-edit-toggle input { width: auto; transform: scale(1.18); transform-origin: left center; }
.dt-engine-editor { grid-column: 1 / -1; }
.dt-engine-edit-fields { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.dt-engine-disabled { opacity: .52; }
.dt-engine-disabled input,
.dt-engine-disabled select { cursor: not-allowed; }
.dt-edit-field small { display: block; color: #94a3b8; font-size: 11px; margin-top: 5px; }
.dt-edit-help { align-self: stretch; display: flex; align-items: center; color: #64748b; font-size: 12px;
  line-height: 1.45; background: #f1f5f9; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 10px 12px; }
.dt-edit-label { font-size: 12px; font-weight: 700; color: #0f172a; margin: 12px 0 6px; }
.dt-pick-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 32px; margin-bottom: 6px; padding: 7px 9px; border-radius: 8px; background: #ecfdf5;
  border: 1px solid #bbf7d0; color: #166534; font-size: 12px; }
.dt-pick-summary b { font-size: 12px; font-weight: 700; }
.dt-pick-summary span { color: #15803d; overflow-wrap: anywhere; text-align: right; }
.dt-edit-chks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; padding: 6px; }
.dt-edit-chk { display: grid; grid-template-columns: 16px 1fr; align-items: center; gap: 6px; font-size: 12px;
  color: #334155; padding: 5px 7px; border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 6px; cursor: pointer; }
.dt-edit-chk input { margin: 0; transform: scale(.9); transform-origin: center; }
.dt-edit-chk span { line-height: 1.2; overflow-wrap: anywhere; }
.dt-edit-chk b { display: block; color: #0f172a; font-size: 12px; font-weight: 500; }
.dt-edit-chk small { display: block; color: #64748b; font-size: 11px; margin-top: 2px; }
.dt-edit-chk:hover { background: #eff6ff; border-color: #bfdbfe; }
.dt-engine-edit-console {
  display: block;
}
.dt-engine-edit-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.dt-engine-edit-card {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  text-align: left;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
  color: #0f172a;
  cursor: pointer;
}
.dt-engine-edit-card:hover {
  border-color: #2563eb;
  background: #eff6ff;
}
.dt-engine-edit-card b {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 2px;
}
.dt-engine-edit-card small {
  display: block;
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.25;
}
.dt-engine-edit-card i {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  max-width: 220px;
  font-style: normal;
}
.dt-engine-edit-card em {
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  padding: 3px 6px;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}
.dt-engine-editor-compact .dt-edit-head {
  margin-bottom: 7px;
  padding-bottom: 7px;
}
.dt-engine-editor-compact .dt-edit-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 5px;
}
.dt-engine-editor-compact .dt-edit-field {
  padding: 6px 7px;
  border-radius: 7px;
}
.dt-engine-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(72px, 104px);
  gap: 7px;
  align-items: center;
}
.dt-engine-field.dt-edit-toggle {
  grid-template-columns: minmax(0, 1fr) auto;
}
.dt-engine-editor-compact .dt-edit-field span {
  font-size: 11px;
  line-height: 1.15;
  margin: 0;
}
.dt-engine-editor-compact .dt-engine-field span small {
  display: block;
  margin: 2px 0 0;
  color: #94a3b8;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.15;
}
.dt-engine-editor-compact .dt-edit-field input,
.dt-engine-editor-compact .dt-edit-field select {
  min-height: 30px;
  padding: 5px 7px;
  font-size: 13px;
  border-radius: 7px;
}
.dt-result-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dt-result-summary span { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 9px 10px; }
.dt-result-summary b { display: block; font-size: 16px; color: #0f172a; }
.dt-result-summary small { display: block; color: #64748b; font-size: 11px; margin-top: 2px; }
.dt-minus-btn { width: 26px; height: 26px; border-radius: 999px; border: 1px solid #fecaca;
  background: #fef2f2; color: #dc2626; font-size: 18px; line-height: 1; font-weight: 900; cursor: pointer; }
.dt-minus-btn:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.dt-edit-msg { font-size: 12px; color: #2563eb; min-height: 16px; margin: 10px 0; }
.dt-edit-history { margin-top: 16px; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; background: #fff; }
.dt-edit-history-head { display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.dt-edit-history-head b { font-size: 13px; color: #0f172a; }
.dt-edit-history-head span { font-size: 12px; color: #64748b; }
.dt-history-empty { padding: 13px 12px; color: #94a3b8; font-size: 13px; }
.dt-history-table { overflow-x: auto; }
.dt-history-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dt-history-table th, .dt-history-table td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; text-align: left; white-space: nowrap; }
.dt-history-table th { color: #64748b; background: #fff; font-weight: 800; }
.dt-history-table td:last-child { white-space: normal; color: #0f172a; font-weight: 700; }
.dt-data-notice { margin: 0 0 12px; border: 1px solid #f59e0b; background: #fffbeb;
  color: #78350f; border-radius: 8px; padding: 10px 12px; display: grid; gap: 3px; }
.dt-data-notice b { font-size: 13px; }
.dt-data-notice span { font-size: 12px; overflow-wrap: anywhere; }
.dt-edit-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 760px) {
  .dt-edit-head { align-items: flex-start; gap: 8px; margin-bottom: 10px; padding-bottom: 10px; }
  .dt-edit-head b { font-size: 16px; }
  .dt-edit-head strong { font-size: 11px; padding: 5px 8px; }
  .dt-edit-actions { justify-content: stretch; }
  .dt-edit-actions .btn-quick { flex: 1 1 0; min-width: 0; }
  .dt-engine-edit-menu { grid-template-columns: 1fr; }
  .dt-engine-edit-card { grid-template-columns: 1fr; padding: 9px 10px; }
  .dt-engine-edit-card i { justify-content: flex-start; max-width: none; }
  .dt-engine-editor-compact .dt-edit-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dt-engine-field { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .dt-engine-field.dt-edit-toggle { grid-template-columns: minmax(0, 1fr) auto; }
  .dt-engine-editor-compact .dt-edit-field input,
  .dt-engine-editor-compact .dt-edit-field select { min-height: 28px; font-size: 12px; }
}
.dt-row { display: flex; gap: 10px; font-size: 13px; border-bottom: 1px solid #f1f5f9; padding: 5px 0; }
.dt-k { flex: 0 0 92px; color: #64748b; font-weight: 600; }
.dt-v { color: #0f172a; }
.dt-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
  padding-top: 12px; border-top: 1px solid #e2e8f0; }
.dt-ctrl-msg { margin-top: 8px; font-size: 12px; color: #2563eb; min-height: 16px; }
.dt-formulas { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-chip { font-size: 12px; padding: 4px 9px; border-radius: 999px;
  background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.dt-chip-on { background: #dcfce7; color: #15803d; border-color: #86efac; font-weight: 600; }
/* 1차 상단 줄 우측(AUTO 뱃지 앞)에 들어간 자동매매 엔진 선택 (AUTO ↔ HA AUTO) */
.dt-reng-sw { flex: none; display: inline-flex; border: 1px solid #cbd5e1; border-radius: 7px; overflow: hidden; }
.dt-reng { border: 0; border-left: 1px solid #e2e8f0; background: #fff; color: #475569;
  font-size: 11px; font-weight: 800; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.dt-reng:first-child { border-left: 0; }
.dt-reng:disabled { cursor: default; opacity: .65; }
.dt-reng.on.engine { background: #2563eb; color: #fff; }
.dt-reng.on.ha { background: #14b8a6; color: #04201c; }
.dt-formulas-lab { width: 100%; color: #94a3b8; font-size: 11px; font-weight: 700; margin: 0 0 5px; }
.dt-muted { color: #94a3b8; font-size: 13px; }
.dt-status { font-size: 11px; color: #475569; background: #f1f5f9; padding: 1px 7px; border-radius: 4px; }
.dt-gate { font-size: 12px; font-weight: 600; }
.dt-gate-ok { color: #16a34a; }
.dt-gate-no { color: #dc2626; }
.dt-verdict { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  border: 1px solid #e2e8f0; background: #f8fafc; white-space: nowrap; }
.dt-verdict-ok { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.dt-verdict-warn { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.dt-verdict-no { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.dt-stage-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.dt-stage-card { border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 8px; padding: 8px 9px; min-width: 0; }
.dt-stage-card span { display: block; color: #64748b; font-size: 11px; font-weight: 800; }
.dt-stage-card b { display: block; color: #0f172a; font-size: 16px; line-height: 1.2; margin-top: 2px; }
.dt-stage-card small { display: block; color: #64748b; font-size: 11px; margin-top: 3px; overflow-wrap: anywhere; }
.dt-stage-badge { display: inline-block; white-space: nowrap; font-size: 11px; font-weight: 800;
  border-radius: 999px; padding: 2px 7px; border: 1px solid #e2e8f0; background: #f8fafc; }
.dt-stage-sold { color: #7c2d12; background: #fff7ed; border-color: #fed7aa; }
.dt-stage-bought { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.dt-stage-ordered { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.dt-stage-rejected { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.dt-stage-recommended { color: #475569; background: #f8fafc; border-color: #e2e8f0; }
.dt-stage-total { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-top: 10px;
  padding-top: 9px; border-top: 1px solid #e2e8f0; font-size: 12px; color: #475569; }
.dt-stage-total span, .dt-stage-total b { background: #fff; border: 1px solid #e2e8f0; border-radius: 999px;
  padding: 4px 8px; }
.dt-warn { color: #b45309; font-weight: 600; background: #fef3c7; padding: 1px 6px; border-radius: 4px; }
/* 손익 색상 (테이블 밖에서도 적용) */
.pnl-pos { color: #dc2626; }
.pnl-neg { color: #2563eb; }

.dt-money-section { margin-top: 4px; }

/* 단타 운용 승인 제어판 */
.dt-control-section { margin-bottom: 12px; }
.dt-control-panel { display: grid; gap: 8px; }
.dt-control-summary { display: flex; justify-content: space-between; gap: 10px; align-items: center;
  border: 1px solid #dbe3ee; border-radius: 10px; padding: 10px 12px; background: #fff; }
.dt-control-summary b { display: block; font-size: 15px; color: #0f172a; }
.dt-control-summary span { display: block; margin-top: 2px; font-size: 12px; color: #64748b; }
.dt-control-mini-rounds { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.dt-control-mini-rounds span { display: inline-flex; align-items: center; margin: 0; font-size: 11px; font-weight: 900;
  border-radius: 999px; padding: 4px 8px; }
.dt-control-ok { border-color: #86efac; background: #f0fdf4; }
.dt-control-wait { border-color: #fde68a; background: #fffbeb; }
.dt-control-stop { border-color: #fecaca; background: #fef2f2; }
.dt-control-rounds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dt-control-round { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border: 1px solid #e2e8f0; border-radius: 9px; padding: 8px 9px; background: #fff; }
.dt-control-round b { font-size: 13px; color: #0f172a; }
.dt-control-round span { display: block; margin-top: 1px; font-size: 11px; color: #64748b; overflow-wrap: anywhere; }
.dt-control-round.off { border-color: #fecaca; background: #fff7f7; }
.dt-control-toggle { flex: 0 0 auto; border: 1px solid #cbd5e1; background: #f8fafc; color: #334155;
  border-radius: 7px; padding: 5px 9px; font-size: 12px; font-weight: 800; cursor: pointer; }
.dt-control-round.on .dt-control-toggle { border-color: #fecaca; color: #b91c1c; background: #fff; }
.dt-control-round.off .dt-control-toggle { border-color: #86efac; color: #15803d; background: #f0fdf4; }
.dt-control-issues { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-control-issues span { font-size: 12px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 999px; padding: 4px 8px; }
.dt-control-issues.ok span { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.dt-control-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dt-control-actions-rounds { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #e2e8f0; }
.dt-control-actions-rounds .btn-quick { font-size: 12px; padding: 5px 9px; }

/* 💰 오늘의 돈 — 히어로 (가장 잘 보이게) */
.dt-hero { display: grid; grid-template-columns: 1fr 1.22fr 1fr; gap: 10px; }
.dt-hero-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 12px 14px; text-align: center; }
.dt-hero-main { background: #0f172a; border-color: #0f172a; }
.dt-hero-main .dt-hero-label, .dt-hero-main .dt-hero-sub { color: #cbd5e1; }
.dt-hero-main .dt-hero-num { color: #f1f5f9; }
.dt-hero-label { font-size: 11px; color: #64748b; font-weight: 600; }
.dt-hero-num { font-size: 22px; font-weight: 800; color: #0f172a; margin: 3px 0 1px;
  letter-spacing: 0; }
.dt-hero-main .dt-hero-num { font-size: 26px; }
.dt-hero-num.pnl-pos { color: #dc2626; }
.dt-hero-num.pnl-neg { color: #2563eb; }
.dt-hero-sub { font-size: 11px; color: #94a3b8; }
.dt-cta { margin-top: 12px; min-height: 0; }
.dt-cta-on { background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 10px; padding: 12px 16px; font-size: 14px; line-height: 1.6; }

/* ─ 스윙매매 상단 관제판 ───────────────────────────────────────────── */
.sw-command {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin: 4px 0 12px;
  padding: 11px 14px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #f8fafc;
}
.sw-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #2563eb;
  font-weight: 800;
}
.sw-title {
  margin: 3px 0 2px;
  font-size: 24px;
  letter-spacing: 0;
  color: #0f172a;
}
.sw-subtitle {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}
.sw-command-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.sw-state-pill {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}
.sw-state-on { color: #166534; border-color: #86efac; background: #dcfce7; }
.sw-state-warn { color: #9a3412; border-color: #fdba74; background: #ffedd5; }
.sw-updated { color: #64748b; font-size: 11px; }
.sw-scan-btn {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #2563eb;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.sw-scan-btn:disabled {
  opacity: .65;
  cursor: wait;
}

.sw-board-section {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin-bottom: 8px;
}
.sw-board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 41px;
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.sw-board-head h2 {
  margin: 0;
  font-size: 15px;
  color: #0f172a;
  letter-spacing: 0;
}
.sw-board-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.sw-metric-grid {
  display: grid;
  gap: 8px;
}
.sw-kiwoom-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.sw-oper-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.sw-metric-card {
  min-height: 76px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.sw-metric-card span {
  color: #64748b;
  font-size: var(--metric-label-size);
  font-weight: 800;
  line-height: 1.2;
}
.sw-metric-card strong {
  display: block;
  margin-top: 2px;
  color: #020617;
  font-family: var(--font-num);
  font-size: var(--metric-value-size);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.sw-metric-card strong.pnl-pos { color: #dc2626; }
.sw-metric-card strong.pnl-neg { color: #2563eb; }

.sw-flow-section {
  margin-bottom: 12px;
}
.sw-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 8px;
}
.sw-flow-node {
  position: relative;
  min-height: 118px;
  padding: 10px 10px 9px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.sw-flow-node::after {
  content: "";
  position: absolute;
  left: -40%;
  top: 0;
  width: 38%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, .12), transparent);
  animation: sw-flow-scan 2.8s infinite;
}
.sw-flow-blocked::after,
.sw-flow-waiting::after {
  display: none;
}
.sw-flow-top {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 6px;
  align-items: center;
}
.sw-flow-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
}
.sw-flow-active .sw-flow-dot,
.sw-flow-ready .sw-flow-dot {
  background: #16a34a;
  box-shadow: 0 0 0 5px rgba(22, 163, 74, .12);
  animation: sw-pulse 1.7s infinite;
}
.sw-flow-warn .sw-flow-dot { background: #f97316; }
.sw-flow-blocked .sw-flow-dot { background: #ef4444; }
.sw-flow-step {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}
.sw-flow-node b {
  color: #0f172a;
  font-size: 13px;
}
.sw-flow-node p {
  position: relative;
  z-index: 1;
  min-height: 36px;
  margin: 10px 0 8px;
  color: #475569;
  font-size: 11px;
  line-height: 1.35;
}
.sw-flow-node em {
  position: relative;
  z-index: 1;
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}
.sw-flow-active em,
.sw-flow-ready em {
  background: #dcfce7;
  color: #166534;
}
.sw-flow-blocked em {
  background: #fee2e2;
  color: #991b1b;
}
.sw-engine-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.sw-engine-panel {
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
}
.sw-engine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}
.sw-engine-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 15px;
}
.sw-engine-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.sw-engine-body {
  padding: 8px 12px 12px;
}
.sw-engine-body dl {
  display: grid;
  gap: 6px;
  margin: 0;
}
.sw-engine-body dl div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
}
.sw-engine-body dl div:last-child {
  border-bottom: 0;
}
.sw-engine-body dt {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}
.sw-engine-body dd {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}
.sw-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.sw-card-summary-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.sw-card-summary {
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}
.sw-card-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.sw-card-summary-top b {
  display: block;
  color: #0f172a;
  font-size: 13px;
}
.sw-card-summary-top span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}
.sw-card-summary-top strong {
  color: #2563eb;
  font-family: var(--font-num);
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}
.sw-card-summary-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
}
.sw-card-summary-stats span {
  padding: 4px 5px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}
.sw-card-stock-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.sw-card-stock-tags span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 6px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
}
.sw-card-stock-tags b {
  color: #64748b;
  font-size: 10px;
}
.sw-work-panel {
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.sw-work-list {
  max-height: 360px;
  overflow: auto;
  padding: 8px;
}
.sw-work-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: start;
  padding: 9px 4px;
  border-bottom: 1px solid #f1f5f9;
}
.sw-work-row:last-child { border-bottom: 0; }
.sw-work-row b {
  display: block;
  color: #0f172a;
  font-size: 13px;
}
.sw-work-row span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
}
.sw-work-row strong {
  color: #0f172a;
  font-size: 12px;
  white-space: nowrap;
}
.sw-work-row p {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: #475569;
  font-size: 11px;
  line-height: 1.35;
}
.sw-row-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: -1px;
}
.sw-row-actions button {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.sw-row-actions button:hover {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
}
.sw-status {
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}
.sw-st-filled,
.sw-st-approved { background: #dcfce7; color: #166534; }
.sw-st-rejected,
.sw-st-expired { background: #fee2e2; color: #991b1b; }

@keyframes sw-flow-scan {
  0% { left: -45%; }
  55% { left: 110%; }
  100% { left: 110%; }
}
@keyframes sw-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.sw-account-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.sw-account-card {
  min-height: 104px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.sw-account-card span {
  display: block;
  font-size: 11px;
  color: #64748b;
  font-weight: 800;
  margin-bottom: 8px;
}
.sw-account-card strong {
  display: block;
  color: #0f172a;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: 0;
}
.sw-account-card p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}
.sw-account-primary {
  background: #111827;
  border-color: #111827;
  color: #f8fafc;
}
.sw-account-primary span { color: #cbd5e1; }
.sw-account-primary strong { color: #fff; font-size: 22px; }
.sw-account-primary p { color: #dbeafe; }
.sw-card-profit { border-color: #fecaca; background: #fff7f7; }
.sw-card-loss { border-color: #bfdbfe; background: #eff6ff; }

.sw-money-section { margin-top: 4px; }
.sw-hero {
  display: grid;
  grid-template-columns: 1fr 1.22fr 1fr;
  gap: 10px;
}
.sw-hero-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}
.sw-hero-main { background: #0f172a; border-color: #0f172a; }
.sw-hero-label { font-size: 11px; color: #64748b; font-weight: 600; }
.sw-hero-num {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 3px 0 1px;
  letter-spacing: 0;
}
.sw-hero-main .sw-hero-label,
.sw-hero-main .sw-hero-sub { color: #cbd5e1; }
.sw-hero-main .sw-hero-num { color: #f1f5f9; font-size: 26px; }
.sw-hero-num.pnl-pos,
.sw-account-card strong.pnl-pos { color: #dc2626; }
.sw-hero-num.pnl-neg,
.sw-account-card strong.pnl-neg { color: #2563eb; }
.sw-hero-sub { font-size: 11px; color: #94a3b8; }

/* 📅 단타 스케줄 */
.dt-round-section .section-head { align-items: center; }
.dt-sched { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dt-sched-card { position: relative; overflow: hidden; background: #fff; border: 1px solid #dbe3ee;
  border-radius: 10px; padding: 11px 12px 10px; box-shadow: 0 6px 16px rgba(15,23,42,.04); }
.dt-sched-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: #2563eb; }
.dt-round-open::before { background: #2563eb; }
.dt-round-core::before { background: #16a34a; }
.dt-round-close::before { background: #ea580c; }
.dt-sched-top { display: flex; justify-content: space-between; align-items: center; }
.dt-sched-no { font-weight: 900; font-size: 18px; color: #0f172a; letter-spacing: 0; }
.dt-sched-no em { margin-left: 5px; font-style: normal; font-size: 13px; font-weight: 800; color: #334155; }
.dt-sched-badges { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.dt-sched-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.dt-st-live { background: #dcfce7; color: #15803d; }
.dt-st-done { background: #e2e8f0; color: #475569; }
.dt-st-wait { background: #dbeafe; color: #1d4ed8; }
.dt-st-closed { background: #fee2e2; color: #991b1b; }
.dt-round-op-badge { font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 999px; }
.dt-round-op-ready { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.dt-round-op-on { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.dt-round-op-stop { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.dt-round-headline { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dt-round-headline-compact { margin-top: 2px; }
.dt-sched-name { font-size: 16px; font-weight: 800; color: #0f172a; margin-top: 8px; }
.dt-round-chevron { display: none; flex: 0 0 auto; color: #64748b; font-size: 18px; transition: transform .16s; }
.dt-round-compact { display: none; color: #64748b; font-size: 12px; margin-top: 7px; overflow-wrap: anywhere; }
.dt-sched-copy { min-height: 34px; font-size: 12px; color: #64748b; line-height: 1.45; margin-top: 4px; }
.dt-sched-time { font-size: 11px; color: #64748b; margin-top: 0; }
.dt-round-metrics { display: grid; grid-template-columns: 1fr 54px 1fr; gap: 5px; margin-top: 7px; }
.dt-round-metrics span { background: #f8fafc; border: 1px solid #edf2f7; border-radius: 7px; padding: 6px 7px; min-width: 0; }
.dt-round-metrics b { display: block; color: #0f172a; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-round-metrics small { display: block; color: #94a3b8; font-size: 10px; margin-top: 2px; }
.dt-sched-pnl { font-size: 15px; font-weight: 700; margin-top: 8px;
  border-top: 1px solid #e2e8f0; padding-top: 8px; }
.dt-round-settlement { margin-top: 7px; padding-top: 7px; border-top: 1px solid #e2e8f0;
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 5px 8px; }
.dt-round-settlement span { color: #64748b; font-size: 11px; font-weight: 800; }
.dt-round-settlement b { justify-self: end; font-size: 15px; line-height: 1.15; color: #0f172a; }
.dt-round-settlement small { grid-column: 1 / -1; color: #64748b; font-size: 11px; line-height: 1.25; }
.dt-round-compact-demo { padding: 10px 12px 10px 14px; }
.dt-round-compact-demo .dt-sched-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px; align-items: center; }
.dt-round-compact-demo .dt-sched-no { font-size: 18px; line-height: 1.1; white-space: nowrap; }
.dt-sched-status-wrap { display: inline-flex; justify-content: flex-end; align-items: center; gap: 5px; min-width: 0; }
.dt-round-mode-switch { display: inline-flex; align-items: center; gap: 3px; min-width: 0;
  padding: 3px; border-radius: 999px; background: #e8eef6; border: 1px solid #dbe5f0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75); }
.dt-round-mode-switch button { appearance: none; border: 0; background: transparent; color: #526174;
  border-radius: 999px; padding: 4px 7px; min-height: 24px; font-size: 10px; font-weight: 900;
  letter-spacing: 0; line-height: 1; cursor: pointer; white-space: nowrap;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease; }
.dt-round-mode-switch button:hover { background: rgba(255,255,255,.62); color: #1f2937; }
.dt-round-mode-switch button.on { background: #e5484d; color: #fff;
  box-shadow: 0 2px 5px rgba(229,72,77,.24), 0 0 0 1px rgba(185,28,28,.16); }
.dt-round-mode-switch button.off { color: #7b8796; background: transparent; box-shadow: none; }
.dt-round-mode-switch button.ai.on,
.dt-round-mode-switch button.local.on,
.dt-round-mode-switch button.ha.on { background: #e5484d; color: #fff; }
.dt-round-mode-switch button.ha.off,
.dt-round-mode-switch button.ai.off,
.dt-round-mode-switch button.local.off { color: #7c8796; }
.dt-round-mode-switch button:active { transform: translateY(1px); }
.dt-round-mode-switch button:disabled { opacity: .58; cursor: not-allowed; }
.dt-sched-inline-status { display: inline-flex; align-items: center; border-radius: 999px;
  padding: 2px 7px; font-size: 11px; font-weight: 900; white-space: nowrap; }
.dt-round-cancel { border: 1px solid #fecaca; background: #fff; color: #b91c1c; border-radius: 999px;
  padding: 2px 7px; font-size: 11px; font-weight: 900; line-height: 1.2; cursor: pointer; white-space: nowrap; }
.dt-round-cancel:hover { background: #fef2f2; border-color: #ef4444; }
.dt-round-compact-demo .dt-sched-time { min-width: 0; color: #475569; font-size: 12px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-round-compact-demo .dt-sched-badge { border: 1px solid transparent; font-size: 11px; font-weight: 900;
  padding: 3px 8px; white-space: nowrap; }
.dt-round-compact-demo .dt-round-compact { display: block; margin-top: 8px; color: #475569; font-size: 12px;
  font-weight: 800; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-round-compact-demo .dt-round-settlement { margin-top: 7px; padding-top: 7px; }
.dt-round-compact-demo .dt-round-settlement small { display: none; }
.dt-round-compact-demo .dt-round-actions { margin-top: 8px; gap: 6px; }
.dt-round-compact-demo .dt-round-actions .dt-edit-btn { min-height: 32px; padding: 6px 8px; font-size: 12px;
  font-weight: 800; border-radius: 7px; }
.dt-round-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  grid-column: 1 / -1;
  width: 100%;
}
.dt-round-board-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 11px 12px 10px 14px;
  cursor: pointer;
}
.dt-round-board-open {
  min-height: 136px;
}
.dt-round-board-detail[hidden] {
  display: none !important;
}
.dt-round-board-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px #bfdbfe inset, 0 6px 16px rgba(37,99,235,.08);
}
.dt-round-board-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.dt-round-board-grid span {
  min-width: 0;
  border: 1px solid #edf2f7;
  border-radius: 7px;
  background: #f8fafc;
  padding: 6px 7px;
}
.dt-round-board-grid small {
  display: block;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
}
.dt-round-board-grid b {
  display: block;
  color: #0f172a;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.25;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dt-round-board-flow {
  color: #475569;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
}
/* 회차 상세 — 운용자금·수식·금액필터를 작은 글씨 한 줄로 */
.dt-round-board-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  line-height: 1.3;
}
.dt-round-board-line b {
  color: #0f172a;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.dt-round-line-item { white-space: nowrap; }
/* 운용자금 인라인 편집 버튼 */
.dt-round-budget-edit {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}
.dt-round-budget-edit em { font-style: normal; color: #2563eb; font-size: 10px; }
.dt-round-budget-edit:not(:disabled):hover b { color: #2563eb; text-decoration: underline; }
.dt-round-budget-edit:disabled { cursor: default; }
/* AUTO ↔ 정지 토글 배지 */
.dt-round-auto-toggle {
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  transition: filter .14s ease, box-shadow .14s ease;
}
.dt-round-auto-toggle:hover { filter: brightness(.96); box-shadow: 0 1px 4px rgba(15,23,42,.16); }
.dt-round-auto-toggle:active { transform: translateY(1px); }
/* 회차 카드 시간 — 살짝 키움 */
.dt-round-board-card .dt-sched-time {
  font-size: 13.5px;
  font-weight: 800;
  color: #475569;
  white-space: nowrap;
}
/* 시간 옆 '시간 청산' 작은 태그 */
.dt-round-close-tag {
  margin-left: 7px;
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  cursor: help;
  white-space: nowrap;
}
.dt-round-reserved {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 7px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #047857;
  font-size: 12px;
  font-weight: 950;
}
.dt-round-reservation-mini {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
  color: #047857;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 950;
  white-space: nowrap;
}
.dt-round-actions-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: auto;
}
.dt-round-actions-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: auto;
}
.dt-edit-btn.ok {
  border-color: #86efac;
  background: #ecfdf5;
  color: #047857;
}
.dt-edit-btn.ok:hover {
  background: #d1fae5;
}
.dt-edit-actions-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.btn-quick.ghost {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}
.btn-quick.ghost:hover {
  background: #e2e8f0;
}
.dt-edit-page-mode .dt-control-fold {
  display: none;
}
.dt-edit-page-mode .dt-edit-round-fold > summary {
  display: none;
}
.dt-edit-page-mode .dt-edit-round-fold > .dt-fold-body {
  padding-top: 0;
}
.dt-edit-page-mode .dt-edit-head {
  margin-bottom: 8px;
  padding-bottom: 8px;
  gap: 0;
}
.dt-edit-page-mode .dt-edit-head b {
  font-size: 17px;
}
.dt-edit-top-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.dt-edit-top-actions .dt-allok,
.dt-edit-top-actions .dt-allstop {
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}
.dt-round-open {
  border-left-color: #2563eb;
  background: linear-gradient(90deg, #eff6ff 0%, #fff 58%);
}
.dt-round-core {
  border-left-color: #16a34a;
  background: linear-gradient(90deg, #ecfdf5 0%, #fff 58%);
}
.dt-round-close {
  border-left-color: #ea580c;
  background: linear-gradient(90deg, #fff7ed 0%, #fff 58%);
}
.dt-round-open .dt-sched-no { color: #1d4ed8; }
.dt-round-core .dt-sched-no { color: #047857; }
.dt-round-close .dt-sched-no { color: #c2410c; }
.dt-formula-picker {
  border: 1px solid #dbe3ee;
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}
.dt-formula-picker summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  padding: 8px 10px;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  list-style: none;
}
.dt-formula-summary-title { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dt-formula-summary-title b { color: inherit; font-size: 12px; line-height: 1.2; }
.dt-formula-summary-title small { color: #15803d; font-size: 11px; font-weight: 800; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(560px, 58vw); }
.dt-formula-refresh {
  flex: 0 0 auto;
  border: 1px solid #2563eb;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.dt-formula-refresh:disabled {
  opacity: .6;
  cursor: wait;
}
.dt-formula-picker summary::-webkit-details-marker,
.dt-edit-history-fold summary::-webkit-details-marker {
  display: none;
}
.dt-formula-picker[open] summary {
  border-bottom: 1px solid #edf2f7;
  background: #f8fafc;
}
.dt-edit-history-fold {
  margin-top: 10px;
}
.dt-round-summary {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 8px;
}
.dt-round-summary div {
  min-width: 0;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 8px 10px;
}
.dt-round-summary span {
  display: block;
  color: #64748b;
  font-size: var(--metric-label-size);
  font-weight: 800;
  margin-bottom: 2px;
}
.dt-round-summary b {
  display: block;
  color: #0f172a;
  font-family: var(--font-num);
  font-size: var(--metric-value-size);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.dt-round-summary b.pnl-pos { color: #dc2626; }
.dt-round-summary b.pnl-neg { color: #2563eb; }
.dt-summary-title {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 8px;
  padding: 7px 10px !important;
  background: #f8fafc !important;
}
.dt-summary-title span {
  margin: 0;
  color: #0f172a;
  font-size: 12px;
}
.dt-summary-title b {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}
.dt-summary-title-sub { margin-top: 2px; }

/* 📊 대시보드 — 자산 히어로 + 전략 카드 */
.dash-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; }
.dash-hero-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 14px; }
.dash-hero-main { background: #0f172a; border-color: #0f172a; }
.dash-hero-main .dash-hero-label, .dash-hero-main .dash-hero-sub { color: #cbd5e1; }
.dash-hero-main .dash-hero-num { color: #f1f5f9; }
.dash-hero-label { font-size: 11px; color: #64748b; font-weight: 600; }
.dash-hero-num { font-size: 22px; font-weight: 800; color: #0f172a; margin: 3px 0 1px; letter-spacing: -.3px; }
.dash-hero-num.pnl-pos { color: #dc2626; }
.dash-hero-num.pnl-neg { color: #2563eb; }
.dash-hero-sub { font-size: 12px; color: #94a3b8; }
a.strat-card { text-decoration: none; display: block; transition: transform .08s, box-shadow .08s; }
a.strat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(15,23,42,.12); }

/* 🏆 수식 성과 — 기간 토글 + 회차 칩 */
.dt-period { display: inline-flex; gap: 4px; }
.dt-period button { font-size: 12px; padding: 4px 10px; border: 1px solid #cbd5e1;
  background: #fff; color: #475569; border-radius: 6px; cursor: pointer; }
.dt-period button.on { background: #0f172a; color: #fff; border-color: #0f172a; font-weight: 700; }
.dt-fp-rounds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dt-fp-round { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; }
.dt-fp-rno { font-weight: 700; font-size: 13px; color: #0f172a; margin-bottom: 6px; }
.dt-fp-chip { display: flex; justify-content: space-between; font-size: 12px; padding: 2px 0;
  color: #475569; gap: 8px; }
.dt-fp-chip span:last-child { font-weight: 700; }

.dt-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dt-sched,
.dt-engine,
.dt-fp-rounds,
.dt-control-rounds {
  grid-template-columns: 1fr;
}
.dt-engine-section {
  margin-top: 16px;
}
.dt-fold {
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #fff;
}
.dt-fold summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}
.dt-fold summary::-webkit-details-marker {
  display: none;
}
.dt-fold summary span {
  color: #0f172a;
  font-weight: 800;
}
.dt-fold summary b {
  color: #2563eb;
  font-size: 12px;
}
.dt-fold[open] summary {
  border-bottom: 1px solid #e2e8f0;
}
.dt-fold[open] summary b::before {
  content: "닫기 · ";
}
.dt-fold .card {
  border: 0;
  border-radius: 0 0 10px 10px;
  box-shadow: none;
}
.dt-signal-panel {
  border-color: #bfdbfe;
}
.dt-signal-panel .dt-edit-history-head {
  background: #eff6ff;
}
/* 분석 스냅샷 — 기본 접힘(상시 정보 안내만), 클릭 시 펼침 */
.dt-snapshot { background: #f8fafc; }
.dt-snapshot > .dt-snapshot-summary {
  cursor: pointer; padding: 10px 12px; outline: none;
}
.dt-snapshot[open] > .dt-snapshot-summary { border-bottom: 1px solid #e2e8f0; }
.dt-snapshot-title { display: inline-flex; align-items: center; gap: 7px; }
.dt-snapshot-title b { font-size: 13px; color: #0f172a; }
.dt-snapshot-badge {
  font-size: 11px; background: #e2e8f0; color: #475569;
  border-radius: 10px; padding: 1px 8px; font-weight: 700;
}
.dt-snapshot-note {
  display: block; margin-top: 5px; font-size: 11.5px; color: #94a3b8; line-height: 1.55;
}
.dt-snapshot-note b { color: #64748b; }
.dt-snapshot-note em { color: #2563eb; font-style: normal; }
.dt-snapshot-body { padding: 4px 10px 10px; }
.dt-snapshot-meta { font-size: 11px; color: #94a3b8; margin: 6px 0; }

/* 단타 → 전략분석 진입 링크 */
.dt-analysis-link { display:inline-flex; align-items:center; gap:4px; border:1px solid #2563eb;
  color:#1d4ed8; background:#eff6ff; border-radius:8px; padding:6px 12px; font-size:13px;
  font-weight:700; text-decoration:none; white-space:nowrap; }
.dt-analysis-link:hover { background:#dbeafe; }
.an-back { color:#2563eb; text-decoration:none; font-weight:700; }
.an-back:hover { text-decoration:underline; }

/* ─ 전략 분석 페이지 (/danta/analysis) — 좌측 메뉴 + 우측 결과 ──────── */
.an-command { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
.an-eyebrow { font-size:11px; letter-spacing:.08em; color:#2563eb; font-weight:700; text-transform:uppercase; }
.an-title { font-size:22px; margin:2px 0 4px; color:#0f172a; }
.an-subtitle { font-size:13px; color:#64748b; margin:0; }
.an-period { display:flex; gap:6px; flex-wrap:wrap; }
.an-period button { border:1px solid #cbd5e1; background:#fff; color:#475569; border-radius:8px; padding:6px 12px; font-size:13px; cursor:pointer; }
.an-period button.on { background:#0f172a; color:#fff; border-color:#0f172a; }

.an-layout { display:grid; grid-template-columns:210px minmax(0,1fr); gap:14px; align-items:start; }
.an-sidebar { display:flex; flex-direction:column; gap:6px; position:sticky; top:12px; }
.an-nav { text-align:left; border:1px solid #e2e8f0; background:#fff; color:#0f172a; border-radius:10px; padding:11px 13px; font-size:14px; cursor:pointer; transition:.12s; }
.an-nav:hover:not(:disabled) { border-color:#93c5fd; background:#f8fafc; }
.an-nav.on { background:#eff6ff; border-color:#2563eb; color:#1d4ed8; font-weight:700; }
.an-nav:disabled { opacity:.5; cursor:not-allowed; }
.an-nav-soon span { font-size:10px; color:#94a3b8; margin-left:4px; }
.an-content { min-height:300px; }

.an-hero { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px; margin-bottom:14px; }
.an-card {
  display:grid; grid-template-columns:minmax(0, 1fr) minmax(112px, auto); column-gap:14px; row-gap:6px;
  align-items:start; min-width:0; overflow:hidden;
  background:#f8fafc; border:1px solid #e2e8f0; border-radius:12px; padding:13px 15px;
}
.an-card-l { min-width:0; font-size:12px; color:#64748b; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.an-card-b {
  min-width:0; justify-self:end; max-width:100%;
  font-size:clamp(18px, 2.2vw, 22px); font-weight:800; color:#0f172a; margin:0;
  text-align:right; white-space:nowrap; overflow:hidden; text-overflow:clip;
  font-variant-numeric:tabular-nums;
}
.an-card-b b {
  display:inline-block; max-width:100%; font-size:inherit; line-height:1.12;
  white-space:nowrap; overflow:hidden; text-overflow:clip; vertical-align:top;
}
.an-card-s {
  grid-column:1 / -1; min-width:0;
  font-size:11.5px; color:#94a3b8; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

.an-block { margin-bottom:16px; }
.an-block h3 { font-size:14px; color:#0f172a; margin:0 0 8px; }
.an-empty { padding:18px; color:#94a3b8; font-size:13px; text-align:center; background:#f8fafc; border:1px dashed #cbd5e1; border-radius:10px; }

.an-round-mini { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.an-round-chip { background:#fff; border:1px solid #e2e8f0; border-radius:10px; padding:11px 13px; display:flex; flex-direction:column; gap:3px; }
.an-round-chip span { font-size:12px; color:#64748b; }
.an-round-chip b { font-size:17px; }
.an-round-chip small { font-size:11px; color:#94a3b8; }

.an-rcards { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:12px; }
.an-rcard { background:#fff; border:1px solid #e2e8f0; border-radius:12px; padding:13px 15px; }
.an-rcard-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; font-size:15px; }
.an-rcard-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.an-metric { display:flex; flex-direction:column; align-items:center; background:#f8fafc; border-radius:8px; padding:7px 4px; }
.an-metric b { font-size:14px; color:#0f172a; }
.an-metric small { font-size:10.5px; color:#94a3b8; margin-top:2px; }

.an-table { width:100%; border-collapse:collapse; font-size:13px; }
.an-table th, .an-table td { padding:8px 10px; border-bottom:1px solid #eef2f7; }
.an-table th { background:#f8fafc; color:#64748b; font-weight:600; font-size:12px; text-align:left; }
.an-table td.num, .an-table th.num { text-align:right; }

.an-day { background:#fff; border:1px solid #e2e8f0; border-radius:12px; padding:11px 14px; margin-bottom:10px; }
.an-day-head { display:flex; justify-content:space-between; align-items:center; font-size:14px; margin-bottom:4px; }
.an-day-head b { color:#0f172a; }
.an-day-best { font-size:12px; color:#64748b; margin-bottom:7px; }
.an-round-sec { background:#fff; border:1px solid #e2e8f0; border-radius:12px; padding:13px 15px; margin-bottom:12px; }
.an-round-h { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; font-size:15px; }
.an-round-h b { color:#0f172a; }
.an-round-time { font-size:12px; color:#64748b; background:#f1f5f9; border-radius:6px; padding:2px 8px; }
.an-round-h > span:last-child { margin-left:auto; font-size:13px; font-weight:700; }
.an-sub { margin-top:12px; }
.an-sub h4 { margin:0 0 6px; font-size:13px; color:#334155; }
.an-stat { background:#eff6ff; border:1px solid #bfdbfe; border-radius:10px; padding:12px 14px; font-size:13px; line-height:1.7; color:#1e293b; }
.an-stat b { color:#0f172a; }

/* 회차 분석 — 달력 + 창3개 */
.an-round-title { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.an-round-title b { font-size:17px; color:#0f172a; }
.an-round-title .an-round-time { font-size:12px; color:#64748b; background:#f1f5f9; border-radius:6px; padding:2px 8px; }
.an-scope { margin-left:auto; font-size:12px; color:#1d4ed8; background:#eff6ff; border:1px solid #bfdbfe; border-radius:6px; padding:3px 9px; }
.an-hint { font-size:12px; color:#94a3b8; margin-top:10px; }
.an-basis { font-size:11.5px; color:#64748b; margin-top:6px; }
.an-n { font-weight:400; color:#94a3b8; font-size:11px; }
.an-table tr.an-top { background:#fffbeb; }
.an-table.an-wr td:first-child { text-align:center; }

.cal-head { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.cal-head b { font-size:15px; color:#0f172a; }
.cal-nav { border:1px solid #cbd5e1; background:#fff; border-radius:7px; width:30px; height:30px; cursor:pointer; font-size:16px; line-height:1; }
.cal-nav:hover { background:#f1f5f9; }
.cal-clear { margin-left:auto; border:1px solid #2563eb; color:#1d4ed8; background:#eff6ff; border-radius:7px; padding:5px 10px; font-size:12px; cursor:pointer; }
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:5px; }
.cal-wd { text-align:center; font-size:11px; color:#64748b; padding:3px 0; font-weight:700; }
.cal-wd.sun { color:#dc2626; } .cal-wd.sat { color:#2563eb; }
.cal-cell { min-height:54px; border:1.5px solid #cbd5e1; border-radius:8px; padding:5px 6px; display:flex; flex-direction:column; background:#fff; }
.cal-empty { border:none; background:transparent; }
.cal-weekday { background:#ffffff; }            /* 거래일 — 또렷한 흰 박스 */
.cal-sun { background:#fef2f2; }                /* 일요일 */
.cal-sun .cal-d { color:#dc2626; font-weight:800; }
.cal-sat { background:#eff6ff; }                /* 토요일 */
.cal-sat .cal-d { color:#2563eb; font-weight:800; }
.cal-holiday { background:#f1f5f9; border-style:dashed; }   /* 평일 공휴일 = 휴장 */
.cal-holiday .cal-d { color:#94a3b8; }
.cal-hol { margin-top:auto; font-size:9px; color:#94a3b8; line-height:1.1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cal-d { font-size:12px; color:#334155; }
.cal-pnl { margin-top:auto; font-size:12px; font-weight:700; }
.cal-has { cursor:pointer; }
.cal-has.cal-weekday { background:#f8fafc; }    /* 거래 있는 거래일 */
.cal-has:hover { border-color:#2563eb; box-shadow:0 0 0 1px #93c5fd inset; }
.cal-pos .cal-pnl { color:#d32f2f; }
.cal-neg .cal-pnl { color:#1565c0; }
.cal-flat .cal-pnl { color:#94a3b8; }
.cal-today { border:2.5px solid #f59e0b; background:#fffbeb; }   /* 오늘 — 주황 강조 */
.cal-today .cal-d { color:#b45309; font-weight:800; }
.cal-sel { border-color:#2563eb; box-shadow:0 0 0 2px #2563eb inset; }

.an-flow { display:flex; align-items:stretch; gap:6px; flex-wrap:wrap; }
.an-flow-step { flex:1 1 110px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:10px; padding:10px 12px; display:flex; flex-direction:column; gap:3px; }
.an-flow-step small { font-size:11px; color:#64748b; }
.an-flow-step b { font-size:15px; color:#0f172a; }
.an-flow-budget { background:#eff6ff; border-color:#bfdbfe; }
.an-flow-remain { background:#f0fdf4; border-color:#bbf7d0; }
.an-flow-arrow { display:flex; align-items:center; color:#94a3b8; font-size:18px; }
.an-flow-sub { margin-top:8px; font-size:13px; color:#475569; }
.an-daycard { background:#eff6ff; border:1.5px solid #2563eb; border-radius:12px; padding:14px 16px; margin-bottom:14px; }
.an-daycard-h { font-size:13px; color:#1d4ed8; font-weight:700; margin-bottom:8px; }
.an-daycard-main { display:flex; align-items:baseline; gap:10px; margin-bottom:10px; flex-wrap:wrap; }
.an-daycard-main span { font-size:13px; color:#64748b; }
.an-daycard-main b { font-size:26px; }
.an-daycard-main small { font-size:13px; color:#475569; }
.an-daycard .an-rcard-grid { grid-template-columns:repeat(4,1fr); }
.an-daycard .an-metric { background:#fff; }
.an-money-sub { font-size:12px; font-weight:700; color:#334155; margin:12px 0 6px; }
.an-money-sub:first-child { margin-top:0; }
.an-table.an-money { font-size:12px; }
.an-table.an-money th, .an-table.an-money td { padding:6px 8px; }

@media (max-width:760px){
  .cal-cell { min-height:44px; padding:3px 4px; }
  .cal-pnl { font-size:10px; }
  .an-flow-arrow { display:none; }
}
.an-byr-wrap { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:12px; }
.an-byr { background:#f8fafc; border:1px solid #e2e8f0; border-radius:10px; padding:10px 13px; }
.an-byr-h { font-weight:700; font-size:13px; color:#0f172a; margin-bottom:6px; }
.an-byr ul { margin:0; padding-left:16px; }
.an-byr li { font-size:12px; color:#475569; margin:3px 0; }

@media (max-width: 760px) {
  .an-layout { grid-template-columns:1fr; }
  .an-sidebar { flex-direction:row; flex-wrap:wrap; position:static; }
  .an-nav { flex:1 1 auto; text-align:center; padding:9px 10px; font-size:13px; }
  .an-hero, .an-round-mini { grid-template-columns:1fr; }
  .an-rcard-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 760px) {
  .dt-command { grid-template-columns: 1fr; align-items: start; padding: 9px 11px; margin-bottom: 9px; }
  .dt-command-side { align-items: flex-start; }
  .dt-title { font-size: 19px; }
  .dt-subtitle { display: none; }
  .sw-command { grid-template-columns: 1fr; align-items: start; padding: 9px 11px; margin-bottom: 9px; }
  .sw-command-side { align-items: flex-start; }
  .sw-title { font-size: 19px; }
  .sw-subtitle { display: none; }
  .sw-board-section { padding: 0; margin-bottom: 8px; border-radius: 0; }
  .sw-board-head { min-height: 38px; margin-bottom: 6px; padding: 7px 8px; }
  .sw-board-head h2 { font-size: 14px; }
  .sw-board-head span { font-size: 11px; }
  .sw-kiwoom-grid,
  .sw-oper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .sw-metric-card { min-height: 54px; padding: 6px 8px; border-radius: 8px; }
  .sw-metric-card strong { font-size: 13px; }
  .sw-flow {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
    scroll-snap-type: x mandatory;
  }
  .sw-flow-node {
    min-width: 178px;
    min-height: 104px;
    padding: 9px;
    scroll-snap-align: start;
  }
  .sw-flow-node p { min-height: 30px; margin: 8px 0 7px; }
  .sw-engine-grid { grid-template-columns: 1fr; gap: 8px; }
  .sw-card-summary-list { grid-template-columns: 1fr; gap: 8px; }
  .sw-card-summary { padding: 8px; }
  .sw-pipeline-grid { grid-template-columns: 1fr; gap: 8px; }
  .sw-work-list { max-height: 260px; }
  .sw-engine-body dl div { grid-template-columns: 82px 1fr; gap: 8px; }
  .sw-account-grid { grid-template-columns: 1fr; gap: 9px; margin-bottom: 12px; }
  .sw-account-card { min-height: 92px; padding: 11px 12px; }
  .sw-account-card strong { font-size: 17px; }
  .sw-account-primary strong { font-size: 19px; }
  .dt-live-board { grid-template-columns: 1fr; }
  .dt-engine { grid-template-columns: 1fr; gap: 9px; }
  .dt-engine-card { padding: 11px 12px; cursor: pointer; }
  .dt-engine-card-head b { font-size: 16px; }
  .dt-engine-copy { margin: 7px 0 0; }
  .dt-engine-detail { display: none; margin-top: 8px; }
  .dt-engine-expanded .dt-engine-detail { display: block; }
  .dt-engine-expanded .dt-engine-card-head i { transform: rotate(180deg); }
  .dt-edit-fields { grid-template-columns: 1fr; }
  .dt-edit-head { flex-direction: column; }
  .dt-edit-chks { grid-template-columns: 1fr; }
  .dt-edit-actions { justify-content: stretch; }
  .dt-edit-actions .btn-quick { flex: 1; }
  .dt-edit-actions-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .dt-edit-actions-three .btn-quick {
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 12px;
    white-space: nowrap;
  }
  .dt-result-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dt-two-col { grid-template-columns: 1fr; }
  .dt-hero, .sw-hero { grid-template-columns: 1fr; }
  .dt-control-rounds { grid-template-columns: 1fr; }
  .dt-control-summary { padding: 8px 10px; }
  .dt-control-actions .btn-quick { flex: 1 1 120px; }
  .dt-sched { grid-template-columns: 1fr; }
  .dt-round-board {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .dt-round-board-card {
    min-height: 0;
    padding: 9px 10px 9px 12px;
    gap: 6px;
  }
  .dt-round-board-open {
    min-height: 0;
  }
  .dt-round-board-line {
    gap: 1px 10px;
    font-size: 10.5px;
  }
  .dt-round-board-line b {
    font-size: 11px;
  }
  .dt-round-board-card .dt-sched-time {
    font-size: 12.5px;
    font-weight: 800;
    margin-top: 0;
  }
  .dt-round-close-tag {
    margin-left: 5px;
    font-size: 9.5px;
  }
  .dt-round-actions-two {
    gap: 5px;
  }
  .dt-edit-top-actions {
    width: 100%;
  }
  .dt-edit-top-actions .dt-allok,
  .dt-edit-top-actions .dt-allstop {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 8px;
  }
  .dt-sched-card { padding: 11px 13px 10px; cursor: pointer; }
  .dt-sched-card::before { width: 4px; }
  .dt-sched-top { align-items: center; }
  .dt-sched-no { font-size: 18px; }
  .dt-sched-name { margin-top: 7px; font-size: 15px; }
  .dt-sched-time { margin-top: 3px; }
  .dt-round-chevron { display: inline-flex; align-items: center; justify-content: center; }
  .dt-round-compact { display: block; }
  .dt-round-detail { display: none; }
  .dt-round-expanded .dt-round-detail { display: block; }
  .dt-round-expanded .dt-round-compact { display: none; }
  .dt-round-expanded .dt-round-chevron { transform: rotate(180deg); }
  .dt-sched-copy { min-height: 0; margin-top: 10px; }
  .dt-round-metrics { grid-template-columns: 1fr 64px; }
  .dt-round-metrics span:last-child { grid-column: 1 / -1; }
  .dt-round-compact-demo { padding: 8px 10px 8px 12px; }
  .dt-round-compact-demo .dt-sched-top { grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px; margin-bottom: 2px; }
  .dt-round-compact-demo .dt-sched-no { font-size: 16px; line-height: 1.1; }
  .dt-round-compact-demo .dt-sched-no em { font-size: 12px; margin-left: 4px; }
  .dt-sched-status-wrap { gap: 4px; }
  .dt-sched-inline-status { padding: 1px 6px; font-size: 10px; }
  .dt-round-cancel { padding: 1px 6px; font-size: 10px; }
  .dt-round-compact-demo .dt-sched-badge { font-size: 10px; padding: 1px 6px; }
  .dt-round-compact-demo .dt-round-headline { align-items: flex-start; gap: 6px; }
  .dt-round-compact-demo .dt-sched-time { margin-top: 0; font-size: 11px; font-weight: 800; }
  .dt-round-compact-demo .dt-round-compact,
  .dt-round-expanded.dt-round-compact-demo .dt-round-compact { display: block; margin-top: 4px; font-size: 11px; line-height: 1.25; }
  .dt-round-compact-demo .dt-round-detail { margin-top: 5px; }
  .dt-round-compact-demo .dt-sched-copy { display: none; }
  .dt-round-compact-demo .dt-round-metrics {
    grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1.2fr);
    gap: 4px;
    margin-top: 5px;
  }
  .dt-round-compact-demo .dt-round-metrics span { padding: 5px 6px; border-radius: 7px; }
  .dt-round-compact-demo .dt-round-metrics span:last-child { grid-column: auto; }
  .dt-round-compact-demo .dt-round-metrics b { font-size: 11px; }
  .dt-round-compact-demo .dt-round-metrics small { font-size: 9px; margin-top: 1px; }
  .dt-round-compact-demo .dt-round-settlement { margin-top: 5px; padding-top: 5px; }
  .dt-round-compact-demo .dt-round-settlement b { font-size: 13px; }
  .dt-round-compact-demo .dt-round-settlement small { font-size: 10px; }
  .dt-round-compact-demo .dt-round-actions { margin-top: 5px; gap: 5px; }
  .dt-round-compact-demo .dt-round-actions.dt-round-actions-three {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dt-round-actions-two .dt-edit-btn {
    min-height: 30px;
    padding: 5px 4px;
    font-size: 11px;
  }
  .dt-round-compact-demo .dt-round-actions .dt-edit-btn {
    min-height: 28px;
    padding: 4px 3px;
    font-size: 11px;
    line-height: 1.15;
  }
  .dt-round-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; }
  .dt-round-summary div { padding: 6px 8px; }
  .dt-summary-title,
  .dt-round-summary div:last-child { grid-column: 1 / -1; }
  .dt-round-summary b { font-size: 13px; }
  .dt-fp-rounds { grid-template-columns: 1fr; }
  .dt-stage-summary { grid-template-columns: 1fr; }
  .dt-stage-total { justify-content: stretch; }
  .dash-hero { grid-template-columns: 1fr; }
  .dt-hero-num, .dash-hero-num, .sw-hero-num { font-size: 18px; }
  .dt-hero-main .dt-hero-num { font-size: 20px; }
  .sw-hero-main .sw-hero-num { font-size: 20px; }
  .dt-hero-item, .dash-hero-item, .sw-hero-item { padding: 8px 10px; }
}
@media (prefers-color-scheme: dark) {
  .dt-command { background: #0f172a; border-color: #334155; }
  .dt-title { color: #f8fafc; }
  .dt-subtitle { color: #cbd5e1; }
  .dt-state-pill { background: #0f172a; border-color: #475569; color: #cbd5e1; }
  .dt-live-card { background: #0f172a; border-color: #334155; }
  .dt-live-card strong { color: #f8fafc; }
  .dt-live-card p { color: #cbd5e1; }
  .dt-live-good { background: #052e16; border-color: #166534; }
  .dt-live-warn { background: #431407; border-color: #9a3412; }
  .dt-engine-card { background: #0f172a; border-color: #334155; }
  .dt-engine-card-head b { color: #f8fafc; }
  .dt-engine-card-head span, .dt-engine-card-head i { color: #94a3b8; }
  .dt-engine-copy { color: #cbd5e1; }
  .dt-edit { background: #0f172a; border-color: #334155; }
  .dt-edit-card-summary { background: #111827; color: #f8fafc; border-color: transparent; }
  .dt-edit-card-summary small { color: #94a3b8; }
  .dt-edit-card-summary em { background: #172554; border-color: #60a5fa; color: #dbeafe; }
  .dt-edit-card[open] > .dt-edit-card-summary { border-bottom-color: #334155; }
  .dt-result-panel { background: #0f172a; border-color: #14532d; }
  .dt-edit-head { border-color: #334155; }
  .dt-edit-head b { color: #f8fafc; }
  .dt-edit-field { background: #1e293b; border-color: #334155; }
  .dt-edit-field span { color: #cbd5e1; }
  .dt-edit-field input, .dt-edit-field select { background: #020617; border-color: #475569; color: #f8fafc; }
  .dt-edit-help { background: #1e293b; border-color: #475569; color: #cbd5e1; }
  .dt-edit-label { color: #f8fafc; }
  .dt-pick-summary { background: #052e16; border-color: #166534; color: #bbf7d0; }
  .dt-pick-summary span { color: #bbf7d0; }
  .dt-formula-picker { background: #0f172a; border-color: #334155; }
  .dt-formula-picker summary { color: #f8fafc; }
  .dt-formula-summary-title small { color: #bbf7d0; }
  .dt-formula-refresh { background: #172554; border-color: #60a5fa; color: #dbeafe; }
  .dt-formula-picker[open] summary { background: #1e293b; border-bottom-color: #334155; }
  .dt-edit-chk { background: #1e293b; border-color: #334155; color: #cbd5e1; }
  .dt-edit-chk b { color: #f8fafc; }
  .dt-edit-chk small { color: #94a3b8; }
  .dt-edit-chk:hover { background: #172554; border-color: #2563eb; }
  .dt-result-summary span { background: #1e293b; border-color: #334155; }
  .dt-result-summary b { color: #f8fafc; }
  .dt-edit-history { background: #0f172a; border-color: #334155; }
  .dt-edit-history-head { background: #1e293b; border-color: #334155; }
  .dt-fold { background: #0f172a; border-color: #334155; }
  .dt-fold summary span { color: #f8fafc; }
  .dt-fold summary b { color: #93c5fd; }
  .dt-fold[open] summary { border-color: #334155; }
  .dt-signal-panel { border-color: #2563eb; }
  .dt-signal-panel .dt-edit-history-head { background: #172554; }
  .dt-snapshot { background: #0f172a; }
  .dt-snapshot[open] > .dt-snapshot-summary { border-color: #334155; }
  .dt-snapshot-title b { color: #f8fafc; }
  .dt-snapshot-badge { background: #1e293b; color: #cbd5e1; }
  .dt-snapshot-note { color: #94a3b8; }
  .dt-snapshot-note b { color: #cbd5e1; }
  .dt-snapshot-note em { color: #93c5fd; }
  .dt-stage-card, .dt-stage-total span, .dt-stage-total b { background: #1e293b; border-color: #334155; }
  .dt-stage-card b { color: #f8fafc; }
  .dt-stage-card span, .dt-stage-card small, .dt-stage-total { color: #cbd5e1; }
  .dt-edit-history-head b { color: #f8fafc; }
  .dt-history-table th { background: #0f172a; color: #94a3b8; }
  .dt-history-table th, .dt-history-table td { border-color: #334155; }
  .dt-history-table td:last-child { color: #f8fafc; }
  .sw-command { background: #0f172a; border-color: #334155; }
  .sw-title { color: #f8fafc; }
  .sw-subtitle { color: #cbd5e1; }
  .sw-state-pill { background: #0f172a; border-color: #475569; color: #cbd5e1; }
  .sw-board-section { background: transparent; border-color: transparent; }
  .sw-board-head { background: #0f172a; border-color: #334155; }
  .sw-board-head h2 { color: #f8fafc; }
  .sw-board-head span { color: #cbd5e1; }
  .sw-metric-card { background: #111827; border-color: #334155; }
  .sw-metric-card span { color: #94a3b8; }
  .sw-metric-card strong { color: #f8fafc; }
  .sw-flow-node,
  .sw-engine-panel,
  .sw-work-panel,
  .sw-card-summary { background: #111827; border-color: #334155; }
  .sw-flow-node b,
  .sw-engine-head h2,
  .sw-card-summary-top b { color: #f8fafc; }
  .sw-flow-node p,
  .sw-engine-body dd { color: #cbd5e1; }
  .sw-flow-step,
  .sw-engine-head span,
  .sw-engine-body dt,
  .sw-card-summary-top span { color: #94a3b8; }
  .sw-engine-head { border-color: #334155; }
  .sw-engine-body dl div { border-color: #1e293b; }
  .sw-work-row { border-color: #1e293b; }
  .sw-work-row b,
  .sw-work-row strong { color: #f8fafc; }
  .sw-work-row span,
  .sw-work-row p { color: #cbd5e1; }
  .sw-card-summary-stats span { background: #1e293b; color: #cbd5e1; }
  .sw-card-stock-tags span { background: #172554; color: #bfdbfe; }
  .sw-card-stock-tags b { color: #94a3b8; }
  .sw-row-actions button { background: #1e293b; border-color: #475569; color: #cbd5e1; }
  .sw-row-actions button:hover { background: #172554; border-color: #60a5fa; color: #dbeafe; }
  .sw-account-card { background: #0f172a; border-color: #334155; }
  .sw-account-card strong { color: #f8fafc; }
  .sw-account-card p { color: #cbd5e1; }
  .sw-account-primary { background: #020617; border-color: #1e293b; }
  .sw-card-profit { background: #450a0a; border-color: #7f1d1d; }
  .sw-card-loss { background: #172554; border-color: #1d4ed8; }
  .dash-hero-item { background: #1e293b; border-color: #334155; }
  .dash-hero-main { background: #020617; border-color: #1e293b; }
  .dash-hero-num { color: #f1f5f9; }
}

@media (prefers-color-scheme: dark) {
  .dt-row { border-color: #334155; }
  .dt-k { color: #94a3b8; }
  .dt-v { color: #f1f5f9; }
  .dt-controls { border-color: #334155; }
  .dt-chip { background: #1e293b; color: #cbd5e1; border-color: #475569; }
  .dt-chip-on { background: #14532d; color: #bbf7d0; border-color: #16a34a; }
  .dt-reng-sw { border-color: #475569; }
  .dt-reng { background: #1e293b; color: #cbd5e1; border-left-color: #334155; }
  .dt-reng.on.engine { background: #2563eb; color: #fff; }
  .dt-reng.on.ha { background: #14b8a6; color: #04201c; }
  .dt-status { background: #1e293b; color: #cbd5e1; }
  .sw-hero-item { background: #1e293b; border-color: #334155; }
  .sw-hero-main { background: #020617; border-color: #1e293b; }
  .sw-hero-num { color: #f1f5f9; }
  .dt-hero-item { background: #1e293b; border-color: #334155; }
  .dt-hero-main { background: #020617; border-color: #1e293b; }
  .dt-hero-num { color: #f1f5f9; }
  .dt-cta-on { background: #422006; border-color: #854d0e; color: #fde68a; }
  .dt-sched-card { background: #1e293b; border-color: #334155; }
  .dt-sched-no { color: #f1f5f9; }
  .dt-sched-name { color: #cbd5e1; }
  .dt-round-board-active { border-color: #60a5fa; box-shadow: 0 0 0 2px #1e40af inset; }
  .dt-round-board-line { color: #94a3b8; }
  .dt-round-board-line b { color: #f1f5f9; }
  .dt-round-close-tag { color: #64748b; }
  .dt-round-metrics span { background: #0f172a; border-color: #334155; }
  .dt-round-metrics b { color: #f8fafc; }
  .dt-sched-pnl { border-color: #334155; }
  .dt-round-summary div { background: #1e293b; border-color: #334155; }
  .dt-round-summary b { color: #f8fafc; }
  .dt-round-summary b.pnl-pos { color: #f87171; }
  .dt-round-summary b.pnl-neg { color: #60a5fa; }
  .dt-summary-title { background: #0f172a !important; }
  .dt-summary-title span { color: #e2e8f0; }
  .dt-summary-title b { color: #94a3b8; }
  .dt-st-done { background: #334155; color: #cbd5e1; }
  .dt-st-closed { background: #7f1d1d; color: #fecaca; }
}
.agm-legend-flow { color: #2563eb; font-weight: 600; }

@media (prefers-color-scheme: dark) {
  .agm-edge { opacity: .3; }
  .agm-body { fill: #0f172a; stroke: #475569; }
  .agm-label { fill: #cbd5e1; }
  .agm-caption { background: #0f172a; border-color: #334155; color: #cbd5e1; }
  .agm-caption b { color: #f1f5f9; }
  .agm-cap-hop { color: #60a5fa; }
  .agm-ceo .agm-body { fill: #78350f; stroke: #f59e0b; }
  .agm-state-live .agm-body    { fill: #14532d; stroke: #22c55e; }
  .agm-state-partial .agm-body { fill: #713f12; stroke: #f59e0b; }
  .agm-state-idle .agm-body    { fill: #1e3a8a; stroke: #60a5fa; }
  .agm-state-stub .agm-body    { fill: #1e293b; stroke: #475569; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 2 — 단타 분석 페이지 신규 시각화
   휴장 배너 / 깔때기 / 페어 비교 / 캐치 시각 산점도
   ════════════════════════════════════════════════════════════════════ */

/* 휴장 배너 */
.an-market-closed {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px; margin: 0 0 16px;
  background: linear-gradient(90deg, #fef3c7, #fde68a);
  border: 1px solid #fbbf24; border-radius: 10px;
  color: #78350f;
}
.an-market-closed b { font-size: 15px; flex-shrink: 0; }
.an-market-closed span { color: #92400e; font-weight: 600; }
.an-market-closed small { margin-left: auto; color: #78350f; opacity: .8; }

/* 깔때기 */
.an-funnel {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px; background: #f8fafc; border-radius: 8px;
  margin-bottom: 12px;
}
.an-funnel-row {
  display: grid; grid-template-columns: 100px 1fr 160px;
  align-items: center; gap: 10px;
}
.an-funnel-label { font-weight: 600; color: #334155; font-size: 13px; }
.an-funnel-track {
  height: 24px; background: #e2e8f0; border-radius: 4px;
  overflow: hidden; position: relative;
}
.an-funnel-bar {
  height: 100%; transition: width .3s;
  background: linear-gradient(90deg, #94a3b8, #64748b);
}
.an-funnel-catch         .an-funnel-bar,
.an-funnel-bar.an-funnel-catch         { background: linear-gradient(90deg, #93c5fd, #3b82f6); }
.an-funnel-bar.an-funnel-evaluated     { background: linear-gradient(90deg, #c4b5fd, #8b5cf6); }
.an-funnel-bar.an-funnel-buy_requested { background: linear-gradient(90deg, #fcd34d, #f59e0b); }
.an-funnel-bar.an-funnel-buy_filled    { background: linear-gradient(90deg, #fdba74, #f97316); }
.an-funnel-bar.an-funnel-sell_filled   { background: linear-gradient(90deg, #86efac, #22c55e); }
.an-funnel-count { font-size: 13px; color: #475569; text-align: right; }

.an-funnel-trans-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 14px;
}
.an-funnel-trans {
  padding: 8px 10px; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 6px; text-align: center;
}
.an-funnel-trans span { font-size: 11px; color: #64748b; display: block; }
.an-funnel-trans b { font-size: 16px; color: #0f172a; }
.an-funnel-trans small { display: block; font-size: 10px; color: #b91c1c; margin-top: 2px; }
.an-funnel-trans.an-bottleneck {
  background: #fef2f2; border-color: #fca5a5;
}
.an-funnel-sub { font-size: 12px; color: #64748b; margin: 12px 0 6px; }
.an-funnel-formulas td:first-child { white-space: nowrap; }

/* 페어 비교 */
.an-pair-hint { font-size: 12px; color: #64748b; margin-bottom: 10px; }
.an-pair-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 768px) { .an-pair-grid { grid-template-columns: 1fr; } }
.an-pair-h2 { font-weight: 700; margin-bottom: 8px; color: #334155; }
.an-pair {
  padding: 10px 12px; margin-bottom: 10px;
  background: #fff; border-radius: 8px;
  border-left: 4px solid #94a3b8;
}
.an-pair-win  { border-left-color: #22c55e; background: #f0fdf4; }
.an-pair-loss { border-left-color: #ef4444; background: #fef2f2; }
.an-pair-h {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.an-pair-h b { font-size: 14px; color: #0f172a; }
.an-pair-seq { font-size: 11px; color: #64748b; }
.an-pair-h small { margin-left: auto; color: #94a3b8; font-size: 11px; }
.an-pair-tl {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center; gap: 6px; font-size: 11px; color: #475569;
  text-align: center; padding: 8px 0;
  border-top: 1px dashed #e2e8f0; border-bottom: 1px dashed #e2e8f0;
}
.an-pair-tl b { display: block; font-size: 13px; color: #0f172a; }
.an-pair-pnl {
  display: flex; align-items: baseline; gap: 8px; margin-top: 8px;
}
.an-pair-pnl span { font-size: 12px; color: #64748b; }
.an-pair-pnl b { font-size: 18px; }
.an-pair-pnl small { color: #64748b; }

/* 캐치 시각 산점도 */
.an-scatter {
  position: relative; height: 80px; margin: 12px 0;
  background: linear-gradient(to bottom, #f8fafc, #fff);
  border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 8px 0 24px;
}
.an-band {
  position: absolute; top: 0; bottom: 24px;
  background: rgba(59, 130, 246, .08);
  border-left: 1px dashed #3b82f6; border-right: 1px dashed #3b82f6;
}
.an-dot {
  position: absolute; top: 50%;
  width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1);
  cursor: pointer;
}
.an-dot:hover { transform: translate(-50%, -50%) scale(1.5); z-index: 5; }
.an-dot-win        { background: #22c55e; }
.an-dot-loss       { background: #ef4444; }
.an-dot-even       { background: #94a3b8; }
.an-dot-holding    { background: #f59e0b; }
.an-dot-buying     { background: #3b82f6; }
.an-dot-rejected   { background: #cbd5e1; border-color: #94a3b8; }
.an-dot-catch_only { background: #475569; }

.an-axis {
  position: absolute; left: 0; right: 0; bottom: 0; height: 18px;
  border-top: 1px solid #e2e8f0;
}
.an-tick {
  position: absolute; transform: translateX(-50%);
  font-size: 10px; color: #64748b; top: 2px;
}
.an-leg-row {
  display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px;
  color: #475569; margin-top: 6px;
}
.an-leg {
  display: inline-flex; align-items: center; gap: 4px;
}
.an-leg .an-dot {
  position: static; transform: none; width: 8px; height: 8px;
  display: inline-block;
}
.an-scatter-sum { font-size: 12px; color: #64748b; margin-top: 4px; }

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .an-market-closed {
    background: linear-gradient(90deg, #422006, #78350f);
    border-color: #b45309; color: #fde68a;
  }
  .an-market-closed span { color: #fcd34d; }
  .an-market-closed small { color: #fde68a; }

  .an-funnel { background: #1e293b; }
  .an-funnel-label { color: #cbd5e1; }
  .an-funnel-track { background: #334155; }
  .an-funnel-count { color: #94a3b8; }
  .an-funnel-trans { background: #1e293b; border-color: #334155; }
  .an-funnel-trans span { color: #94a3b8; }
  .an-funnel-trans b { color: #f1f5f9; }
  .an-funnel-trans.an-bottleneck { background: #450a0a; border-color: #b91c1c; }
  .an-funnel-sub { color: #94a3b8; }

  .an-pair { background: #1e293b; }
  .an-pair-win  { background: #052e16; border-left-color: #22c55e; }
  .an-pair-loss { background: #450a0a; border-left-color: #ef4444; }
  .an-pair-h b { color: #f1f5f9; }
  .an-pair-tl { color: #cbd5e1; border-color: #334155; }
  .an-pair-tl b { color: #f8fafc; }
  .an-pair-hint { color: #94a3b8; }

  .an-scatter {
    background: linear-gradient(to bottom, #1e293b, #0f172a);
    border-color: #334155;
  }
  .an-band { background: rgba(96, 165, 250, .12); border-color: #60a5fa; }
  .an-dot { border-color: #1e293b; }
  .an-tick { color: #94a3b8; }
  .an-leg-row, .an-scatter-sum { color: #cbd5e1; }
  .an-axis { border-color: #334155; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 3 — 종합 분석 실시간 누적 시각화
   ════════════════════════════════════════════════════════════════════ */

/* 오늘 회차 카드 (가로 3개) */
.an-today-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
@media (max-width: 900px) { .an-today-cards { grid-template-columns: 1fr; } }

.an-today-card {
  padding: 12px 14px; background: #fff; border-radius: 10px;
  border: 1px solid #e2e8f0;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .15s, box-shadow .15s;
}
.an-today-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.06); }
.an-today-pending { background: #f8fafc; opacity: .85; }
.an-today-active  { background: linear-gradient(180deg, #fef3c7, #fff); border-color: #fbbf24; }
.an-today-done    { background: linear-gradient(180deg, #f0fdf4, #fff); border-color: #86efac; }
.an-today-closed  { background: #f1f5f9; opacity: .7; }

.an-today-h {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  border-bottom: 1px dashed #e2e8f0; padding-bottom: 6px;
}
.an-today-h b { font-size: 14px; color: #0f172a; }
.an-today-h span { font-size: 11px; color: #64748b; }
.an-today-st { margin-left: auto; font-size: 11px; font-weight: 600; }

.an-today-pnl {
  font-size: 22px; font-weight: 700; padding: 6px 0;
  display: flex; align-items: baseline; gap: 8px;
}
.an-today-pnl small { font-size: 11px; color: #64748b; font-weight: 500; }

.an-today-funnel {
  display: flex; flex-direction: column; gap: 4px;
  background: #f8fafc; padding: 8px 10px; border-radius: 6px;
}
.an-tfn-row {
  display: flex; justify-content: space-between; font-size: 12px;
}
.an-tfn-row span { color: #64748b; }
.an-tfn-row b { color: #0f172a; }
.an-tfn-final { color: #16a34a !important; }

.an-today-meta { font-size: 11px; color: #64748b; text-align: center; }

/* 라인 차트 박스 */
.an-chart-wrap {
  position: relative; height: 280px; padding: 8px;
  background: #fff; border-radius: 8px; border: 1px solid #e2e8f0;
}
.an-chart-empty {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  color: #94a3b8; font-size: 14px;
  pointer-events: none;
}

/* 엑셀형 표 — 합계 행 강조 */
.an-today-table .an-row-total {
  background: #f1f5f9; font-weight: 700;
  border-top: 2px solid #0f172a;
}
.an-today-table .an-row-total td { padding-top: 8px; padding-bottom: 8px; }

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .an-today-card { background: #1e293b; border-color: #334155; }
  .an-today-pending { background: #0f172a; }
  .an-today-active  { background: linear-gradient(180deg, #422006, #1e293b); border-color: #b45309; }
  .an-today-done    { background: linear-gradient(180deg, #052e16, #1e293b); border-color: #15803d; }
  .an-today-closed  { background: #0f172a; }
  .an-today-h { border-color: #334155; }
  .an-today-h b { color: #f1f5f9; }
  .an-today-h span { color: #94a3b8; }
  .an-today-funnel { background: #0f172a; }
  .an-tfn-row span { color: #94a3b8; }
  .an-tfn-row b { color: #f1f5f9; }
  .an-tfn-final { color: #4ade80 !important; }
  .an-today-meta { color: #94a3b8; }
  .an-chart-wrap { background: #1e293b; border-color: #334155; }
  .an-chart-empty { color: #64748b; }
  .an-today-table .an-row-total { background: #0f172a; border-color: #cbd5e1; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 4 — 광역 분석 (1주~1년 8개 메뉴)
   ════════════════════════════════════════════════════════════════════ */

/* 사이드바 구분선 */
.an-nav-sep {
  margin: 12px 0 6px;
  padding: 4px 8px;
  font-size: 11px; font-weight: 700;
  color: #94a3b8; text-transform: uppercase; letter-spacing: 1px;
  border-top: 1px dashed #cbd5e1;
}

/* 기간 메타 카드 4개 */
.an-period-meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .an-period-meta { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .an-period-meta { grid-template-columns: 1fr; } }

.an-pmeta-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 10px 14px; display: flex; flex-direction: column; gap: 4px;
}
.an-pmeta-card span { font-size: 11px; color: #64748b; }
.an-pmeta-card b { font-size: 20px; color: #0f172a; font-weight: 700; }
.an-pmeta-card b small { font-size: 12px; color: #94a3b8; font-weight: 500; }
.an-pmeta-card small { font-size: 11px; color: #64748b; }

.an-pmeta-progress {
  height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden;
  margin-top: 6px;
}
.an-pmeta-progress div {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  transition: width .4s;
}

.an-suff-good        { border-left: 3px solid #22c55e; }
.an-suff-ok          { border-left: 3px solid #3b82f6; }
.an-suff-low         { border-left: 3px solid #f59e0b; background: #fffbeb; }
.an-suff-insufficient{ border-left: 3px solid #ef4444; background: #fef2f2; }

/* 데이터 부족 placeholder */
.an-insufficient {
  text-align: center; padding: 50px 24px;
  background: #f8fafc; border-radius: 12px;
  border: 2px dashed #cbd5e1;
}
.an-insuf-icon { font-size: 48px; margin-bottom: 12px; }
.an-insufficient h3 { color: #475569; margin: 8px 0; }
.an-insufficient p { color: #64748b; margin: 6px 0; }
.an-insufficient b { color: #0f172a; }
.an-insuf-tip {
  margin-top: 16px !important; padding: 10px 16px;
  background: #fef3c7; border-radius: 6px; display: inline-block;
  color: #78350f !important; font-size: 13px;
}

/* 순위 변동 표 */
.an-rank-table th, .an-rank-table td { text-align: center; padding: 6px 8px; }
.an-rank-table td:first-child { text-align: left; white-space: nowrap; }
.an-rank-cell { vertical-align: middle; }
.an-rank-cell b { display: block; font-size: 16px; }
.an-rank-cell small { display: block; font-size: 10px; color: #64748b; }
.an-rank-empty { color: #cbd5e1; font-size: 12px; }
.an-rank-up   { color: #16a34a; font-weight: 700; }
.an-rank-down { color: #dc2626; font-weight: 700; }
.an-rank-flat { color: #94a3b8; }

/* 안정성 매트릭스 */
.an-stab-summary {
  font-size: 12px; color: #475569; margin-bottom: 10px;
  padding: 8px 12px; background: #f1f5f9; border-radius: 6px;
}
.an-quad-good {
  background: #dcfce7; color: #15803d; padding: 1px 6px; border-radius: 3px;
  font-weight: 600;
}
.an-quad-bad {
  background: #fee2e2; color: #b91c1c; padding: 1px 6px; border-radius: 3px;
  font-weight: 600;
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .an-nav-sep { color: #64748b; border-color: #334155; }
  .an-pmeta-card { background: #1e293b; border-color: #334155; }
  .an-pmeta-card span { color: #94a3b8; }
  .an-pmeta-card b { color: #f1f5f9; }
  .an-pmeta-card b small { color: #64748b; }
  .an-pmeta-card small { color: #94a3b8; }
  .an-pmeta-progress { background: #334155; }
  .an-suff-low         { background: #422006; }
  .an-suff-insufficient{ background: #450a0a; }
  .an-insufficient { background: #1e293b; border-color: #334155; }
  .an-insufficient h3 { color: #cbd5e1; }
  .an-insufficient p { color: #94a3b8; }
  .an-insufficient b { color: #f1f5f9; }
  .an-insuf-tip { background: #422006; color: #fde68a !important; }
  .an-rank-empty { color: #475569; }
  .an-stab-summary { background: #0f172a; color: #cbd5e1; }
  .an-quad-good { background: #052e16; color: #4ade80; }
  .an-quad-bad  { background: #450a0a; color: #fca5a5; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 5 — 자금 배분 추천 (의사결정 화면)
   ════════════════════════════════════════════════════════════════════ */

.an-nav-action {
  background: linear-gradient(180deg, #fde68a, #fbbf24) !important;
  color: #78350f !important; font-weight: 700 !important;
  border-color: #f59e0b !important;
}
.an-nav-action.on, .an-nav-action:hover {
  background: linear-gradient(180deg, #fbbf24, #f59e0b) !important;
}

/* 입력 컨트롤 */
.an-alloc-controls {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  padding: 12px 14px; background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; margin-bottom: 14px;
}
.an-alloc-input {
  display: flex; flex-direction: column; gap: 4px;
}
.an-alloc-input label { font-size: 11px; color: #475569; font-weight: 600; }
.an-alloc-input input, .an-alloc-input select {
  padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 6px;
  font-size: 14px; min-width: 100px;
}
.an-alloc-input span { font-size: 11px; color: #64748b; }
#al-total { min-width: 140px; }
#al-recalc { padding: 8px 18px; font-weight: 700; }

/* 경고 */
.an-alloc-warns {
  margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px;
}
.an-warn {
  padding: 8px 12px; background: #fef3c7; border-left: 3px solid #f59e0b;
  border-radius: 4px; color: #78350f; font-size: 13px;
}

/* Hero — 배분 요약 */
.an-alloc-hero {
  display: grid; grid-template-columns: 2fr 1fr; gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 700px) { .an-alloc-hero { grid-template-columns: 1fr; } }

.an-alloc-pie {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 14px 18px;
}
.an-pie-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0; border-bottom: 1px dashed #e2e8f0;
}
.an-pie-row:last-child { border-bottom: none; }
.an-pie-row span { color: #64748b; font-size: 13px; }
.an-pie-row b { color: #0f172a; font-size: 16px; font-weight: 700; }
.an-pie-used b { color: #16a34a; }
.an-pie-unalloc b { color: #dc2626; }

.an-alloc-meta {
  background: #1e293b; color: #f1f5f9; border-radius: 10px;
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 12px;
  justify-content: center;
}
.an-alloc-meta div { display: flex; flex-direction: column; gap: 2px; }
.an-alloc-meta span { font-size: 11px; color: #94a3b8; }
.an-alloc-meta b { font-size: 18px; color: #fbbf24; font-weight: 700; }

/* 회차 카드 그리드 */
.an-alloc-rounds {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
@media (max-width: 900px) { .an-alloc-rounds { grid-template-columns: 1fr; } }

.an-alloc-rcard {
  background: linear-gradient(180deg, #f0fdf4, #fff);
  border: 1px solid #86efac; border-radius: 10px;
  padding: 14px 16px;
}
.an-rcard-h {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px; padding-bottom: 6px;
  border-bottom: 1px dashed #d1fae5;
}
.an-rcard-h b { font-size: 15px; color: #0f172a; }
.an-rcard-h span { font-size: 11px; color: #16a34a; font-weight: 600; }
.an-rcard-amt {
  font-size: 24px; font-weight: 800; color: #15803d;
  margin: 8px 0 14px;
}
.an-rcard-items {
  display: flex; flex-direction: column; gap: 8px;
}
.an-alloc-item {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 8px; align-items: baseline;
  padding: 6px 10px; background: rgba(255,255,255,.7);
  border-radius: 6px; font-size: 12px;
}
.an-ai-name { color: #475569; }
.an-ai-krw { color: #0f172a; font-size: 13px; font-weight: 700; }
.an-ai-pct { color: #16a34a; font-weight: 600; }

/* 면책 */
.an-alloc-disclaimer {
  margin-top: 18px; padding: 12px 16px;
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 8px; color: #7f1d1d; font-size: 12px; line-height: 1.6;
}
.an-alloc-disclaimer b { color: #b91c1c; }

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .an-alloc-controls { background: #1e293b; border-color: #334155; }
  .an-alloc-input label { color: #cbd5e1; }
  .an-alloc-input input, .an-alloc-input select {
    background: #0f172a; border-color: #334155; color: #f1f5f9;
  }
  .an-alloc-input span { color: #94a3b8; }
  .an-warn { background: #422006; color: #fde68a; border-color: #b45309; }
  .an-alloc-pie { background: #1e293b; border-color: #334155; }
  .an-pie-row { border-color: #334155; }
  .an-pie-row span { color: #94a3b8; }
  .an-pie-row b { color: #f1f5f9; }
  .an-pie-used b { color: #4ade80; }
  .an-pie-unalloc b { color: #f87171; }
  .an-alloc-rcard {
    background: linear-gradient(180deg, #052e16, #1e293b);
    border-color: #15803d;
  }
  .an-rcard-h { border-color: #064e3b; }
  .an-rcard-h b { color: #f1f5f9; }
  .an-rcard-h span { color: #4ade80; }
  .an-rcard-amt { color: #4ade80; }
  .an-alloc-item { background: rgba(15, 23, 42, .5); }
  .an-ai-name { color: #cbd5e1; }
  .an-ai-krw { color: #f1f5f9; }
  .an-ai-pct { color: #4ade80; }
  .an-alloc-disclaimer {
    background: #450a0a; border-color: #b91c1c; color: #fecaca;
  }
  .an-alloc-disclaimer b { color: #fca5a5; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 6 — 샌키 / 레이더 / 히트맵
   ════════════════════════════════════════════════════════════════════ */

/* 샌키 */
.an-sankey-wrap {
  padding: 8px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 8px;
}
.an-sankey {
  width: 100%; height: auto; max-height: 420px;
  color: #0f172a;
}
.an-sankey path { transition: opacity .2s; cursor: pointer; }
.an-sankey path:hover { opacity: .85 !important; }
.an-sankey-legend {
  display: flex; gap: 16px; padding: 8px 4px;
  font-size: 12px; color: #475569;
}
.an-sankey-legend span { display: inline-flex; align-items: center; gap: 4px; }
.an-sankey-legend i {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
}

/* 히트맵 */
.an-heatmap {
  display: grid; gap: 2px;
  background: #fff; padding: 8px; border: 1px solid #e2e8f0; border-radius: 8px;
}
.hm-corner { background: transparent; }
.hm-th, .hm-rh {
  font-size: 10px; color: #64748b;
  display: flex; align-items: center; justify-content: center;
  padding: 2px 0;
}
.hm-rh { font-weight: 700; color: #475569; }
.hm-cell {
  height: 28px; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #0f172a;
  cursor: pointer; transition: transform .1s;
}
.hm-cell:hover { transform: scale(1.1); z-index: 2; position: relative;
                 box-shadow: 0 0 0 2px #fbbf24; }
.hm-cell span { color: #0f172a; }

.hm-legend {
  display: flex; gap: 14px; padding: 8px 4px; font-size: 11px; color: #64748b;
  align-items: center; flex-wrap: wrap;
}
.hm-legend span { display: inline-flex; align-items: center; gap: 4px; }
.hm-legend i {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px;
  border: 1px solid #cbd5e1;
}
.hm-legend small { color: #94a3b8; }

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .an-sankey-wrap { background: #1e293b; border-color: #334155; }
  .an-sankey { color: #f1f5f9; }
  .an-sankey-legend { color: #cbd5e1; }
  .an-heatmap { background: #1e293b; border-color: #334155; }
  .hm-th, .hm-rh { color: #cbd5e1; }
  .hm-rh { color: #f1f5f9; }
  .hm-cell { color: #f1f5f9; }
  .hm-cell span { color: #f1f5f9; }
  .hm-legend { color: #cbd5e1; }
  .hm-legend i { border-color: #475569; }
  .hm-legend small { color: #64748b; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 7 — UI 재구조화 (종합/오늘/중장기 분리)
   ════════════════════════════════════════════════════════════════════ */

/* "오늘 분석" 메뉴 강조 */
.an-nav-today {
  background: linear-gradient(180deg, #dbeafe, #93c5fd) !important;
  color: #1e3a8a !important; font-weight: 700 !important;
  border-color: #3b82f6 !important;
}
.an-nav-today.on, .an-nav-today:hover {
  background: linear-gradient(180deg, #93c5fd, #3b82f6) !important;
  color: #fff !important;
}

/* 종합 분석 — Hero 4카드 크게 */
.an-hero-big {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .an-hero-big { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .an-hero-big { grid-template-columns: 1fr; } }
.an-hero-big .an-card {
  padding: 14px 18px; min-height: 100px;
}
.an-hero-big .an-card-b,
.an-hero-big .an-card-b b { font-size: clamp(20px, 2.1vw, 26px) !important; font-weight: 800; }

/* 종합 분석 — 안내 한 줄 */
.an-overview-summary {
  background: linear-gradient(90deg, #f0f9ff, #e0f2fe);
  border-left: 4px solid #0284c7; border-radius: 6px;
  padding: 10px 16px; margin-bottom: 14px;
  color: #075985; font-size: 13px;
}
.an-overview-summary b { color: #0c4a6e; font-size: 14px; display: block; margin-bottom: 2px; }
.an-overview-summary small { color: #0369a1; font-size: 12px; }

/* 오늘 분석 — 완성도 바 */
.an-today-completion {
  display: grid; grid-template-columns: 1fr auto; gap: 14px;
  align-items: center; padding: 12px 16px;
  background: linear-gradient(90deg, #f0f9ff, #fff);
  border: 1px solid #93c5fd; border-radius: 10px;
  margin-bottom: 14px;
}
.an-tc-bar {
  height: 10px; background: #dbeafe; border-radius: 5px; overflow: hidden;
  grid-column: 1 / -1;
}
.an-tc-bar div {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  transition: width .4s;
}
.an-tc-label {
  font-size: 13px; color: #075985;
}
.an-tc-label b { color: #0c4a6e; font-size: 18px; }
.an-tc-label small { color: #0369a1; font-size: 11px; margin-left: 6px; }
.an-tc-done {
  font-size: 14px; font-weight: 700; color: #15803d;
  background: #dcfce7; padding: 6px 12px; border-radius: 6px;
  grid-column: 1 / -1;
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .an-nav-today {
    background: linear-gradient(180deg, #1e3a8a, #1e40af) !important;
    color: #dbeafe !important; border-color: #3b82f6 !important;
  }
  .an-nav-today.on, .an-nav-today:hover {
    background: linear-gradient(180deg, #2563eb, #1d4ed8) !important;
  }
  .an-overview-summary {
    background: linear-gradient(90deg, #0c4a6e, #1e293b);
    border-color: #0ea5e9; color: #bae6fd;
  }
  .an-overview-summary b { color: #e0f2fe; }
  .an-overview-summary small { color: #7dd3fc; }
  .an-today-completion {
    background: linear-gradient(90deg, #0c4a6e, #1e293b);
    border-color: #0284c7;
  }
  .an-tc-bar { background: #1e3a8a; }
  .an-tc-label { color: #bae6fd; }
  .an-tc-label b { color: #e0f2fe; }
  .an-tc-label small { color: #7dd3fc; }
  .an-tc-done { background: #052e16; color: #86efac; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 8 — 탭 통합 (종합/오늘/중장기 ▼) + 자금 흐름 강조
   ════════════════════════════════════════════════════════════════════ */

/* 탭 바 */
.an-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 12px; margin-bottom: 14px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  align-items: center;
}
.an-tab {
  padding: 8px 16px; font-size: 14px; font-weight: 600;
  border: 1px solid #cbd5e1; background: #fff; border-radius: 6px;
  color: #475569; cursor: pointer; transition: all .15s;
}
.an-tab:hover { background: #f1f5f9; }
.an-tab.on {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff; border-color: #1d4ed8;
}
.an-tab-mid-trigger { margin-left: auto; }

/* 중장기 펼침 줄 */
.an-tab-mid-row {
  flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px;
  padding: 8px 0 0; border-top: 1px dashed #e2e8f0; margin-top: 4px;
}
.an-tab-mid {
  padding: 4px 12px; font-size: 12px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 4px;
  color: #64748b; cursor: pointer;
}
.an-tab-mid:hover { background: #eff6ff; color: #1d4ed8; border-color: #93c5fd; }
.an-tab-mid-on {
  background: #dbeafe; color: #1e3a8a; border-color: #3b82f6;
  font-weight: 700;
}

/* 종합 분석 — 페이지 스코프 라인 */
.an-period-scope {
  font-size: 12px; color: #64748b; padding: 6px 0 10px;
}

/* Hero 로딩 상태 */
.an-hero-loading .an-card-b b { color: #cbd5e1; }

/* 회차 카드 단일 (회차별 분석 오늘 탭 — 카드 1개만) */
.an-today-cards-single {
  grid-template-columns: minmax(280px, 480px) !important;
  justify-content: start;
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .an-tabs { background: #1e293b; border-color: #334155; }
  .an-tab { background: #0f172a; border-color: #334155; color: #cbd5e1; }
  .an-tab:hover { background: #1e293b; }
  .an-tab.on {
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    border-color: #3b82f6;
  }
  .an-tab-mid-row { border-color: #334155; }
  .an-tab-mid { background: #0f172a; border-color: #334155; color: #94a3b8; }
  .an-tab-mid:hover { background: #1e3a8a; color: #dbeafe; border-color: #3b82f6; }
  .an-tab-mid-on {
    background: #1e3a8a; color: #dbeafe; border-color: #3b82f6;
  }
  .an-period-scope { color: #94a3b8; }
  .an-hero-loading .an-card-b b { color: #475569; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 8b — 평탄 탭 (한 줄) + 모바일 가로 스크롤 + 가독성
   ════════════════════════════════════════════════════════════════════ */

/* 탭 바 — 한 줄 평탄, 모바일 가로 스크롤 */
.an-tabs-flat {
  display: flex; gap: 6px; padding: 8px 10px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  margin-bottom: 14px;
  overflow-x: auto;          /* 모바일 가로 스크롤 */
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.an-tabs-flat::-webkit-scrollbar { height: 6px; }
.an-tabs-flat::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.an-tabs-flat .an-tab {
  flex: 0 0 auto;
  padding: 8px 14px; font-size: 13px; font-weight: 600;
  border: 1px solid #cbd5e1; background: #fff; border-radius: 6px;
  color: #475569; cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.an-tabs-flat .an-tab:hover { background: #eff6ff; color: #1d4ed8; border-color: #93c5fd; }
.an-tabs-flat .an-tab.on {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff; border-color: #1d4ed8;
  box-shadow: 0 2px 6px rgba(37,99,235,.3);
}

/* 모바일 — 더 좁은 탭, 폰트 작게 */
@media (max-width: 700px) {
  .an-tabs-flat { padding: 6px; gap: 4px; }
  .an-tabs-flat .an-tab { padding: 6px 10px; font-size: 12px; }
  /* Hero 카드 — 2열 */
  .an-hero-big { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .an-hero-big .an-card { padding: 10px 12px; min-height: 80px; }
  .an-hero-big .an-card-b b { font-size: 18px !important; }
  /* 사이드바 — 가로 스크롤로 */
  .an-sidebar {
    display: flex; flex-direction: row; overflow-x: auto;
    gap: 6px; padding: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .an-sidebar .an-nav {
    flex: 0 0 auto; padding: 6px 10px; font-size: 12px;
    white-space: nowrap;
  }
  .an-nav-sep { display: none; }
}
@media (max-width: 480px) {
  .an-hero-big { grid-template-columns: 1fr !important; }
}

/* 모바일 — 차트 높이 줄임 */
@media (max-width: 700px) {
  .an-chart-wrap { height: 220px !important; }
  .an-chart-wrap canvas { height: 200px !important; }
}

/* 모바일 — 표 가로 스크롤 */
@media (max-width: 700px) {
  .an-block { overflow-x: auto; }
  .an-table { font-size: 12px; }
  .an-table th, .an-table td { padding: 4px 6px; }
}

/* 모바일 — 회차 카드 1열 */
@media (max-width: 700px) {
  .an-today-cards { grid-template-columns: 1fr; }
  .an-alloc-rounds { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 9 — 대시보드 신규 (헬스·보유·시장·추이)
   ════════════════════════════════════════════════════════════════════ */

/* 시스템 헬스 */
.dash-health-sec { margin-top: 8px; margin-bottom: 16px; }
.dash-health {
  display: grid; grid-template-columns: minmax(180px, 220px) 1fr; gap: 16px;
  padding: 14px 18px; background: #fff; border-radius: 12px;
  border: 1px solid #e2e8f0;
  align-items: center;
}
.dh-loading { grid-column: 1 / -1; text-align: center; color: #94a3b8; padding: 12px; }

.dh-score {
  text-align: center; padding: 10px 8px; border-radius: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.dh-score.dh-good { background: linear-gradient(180deg, #dcfce7, #bbf7d0); }
.dh-score.dh-warn { background: linear-gradient(180deg, #fef3c7, #fde68a); }
.dh-score.dh-bad  { background: linear-gradient(180deg, #fee2e2, #fecaca); }
.dh-num { font-size: 30px; font-weight: 800; color: #0f172a; line-height: 1; }
.dh-label { font-size: 13px; font-weight: 700; color: #0f172a; }
.dh-ratio { font-size: 11px; color: #475569; }

.dh-components {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.dhc {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 14px; font-size: 12px; font-weight: 600;
  cursor: help;
}
.dhc-ok   { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }
.dhc-down { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }

/* 현재 보유 */
.src-pill {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 700;
}
.src-danta { background: #dbeafe; color: #1e3a8a; }
.src-swing { background: #fae8ff; color: #6b21a8; }
.table-holdings small { font-size: 10px; }

/* 시장 핫이슈 */
.dash-market-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.dash-market-col { padding: 12px; }
.dm-h { margin: 0 0 8px; font-size: 14px; color: #475569; }
.table-market th, .table-market td { padding: 4px 6px; font-size: 12px; }
.table-market small { font-size: 10px; }

@media (max-width: 700px) {
  .dash-market-grid { grid-template-columns: 1fr; }
  .dash-health { grid-template-columns: 1fr; }
  .dh-score { padding: 8px; }
  .dh-num { font-size: 24px; }
}

/* 14일 손익 추이 차트 */
.dash-pnl-history { position: relative; padding: 12px; }
.dph-chart-wrap { height: 240px; position: relative; }
.dph-empty {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  color: #94a3b8; font-size: 14px;
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .dash-health { background: #1e293b; border-color: #334155; }
  .dh-score.dh-good { background: linear-gradient(180deg, #052e16, #14532d); }
  .dh-score.dh-warn { background: linear-gradient(180deg, #422006, #78350f); }
  .dh-score.dh-bad  { background: linear-gradient(180deg, #450a0a, #7f1d1d); }
  .dh-num, .dh-label { color: #f1f5f9; }
  .dh-ratio { color: #cbd5e1; }
  .dhc-ok   { background: #052e16; color: #4ade80; border-color: #15803d; }
  .dhc-down { background: #450a0a; color: #fca5a5; border-color: #b91c1c; }
  .src-danta { background: #1e3a8a; color: #dbeafe; }
  .src-swing { background: #581c87; color: #f5d0fe; }
  .dm-h { color: #cbd5e1; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 10 — 모바일 우선 디자인 강화
   햄버거 메뉴 / 드로어 / safe-area / 터치 친화 / 테이블 카드형
   ════════════════════════════════════════════════════════════════════ */

/* iOS 노치 안전영역 */
.topnav { padding-top: env(safe-area-inset-top); }
.footer { padding-bottom: env(safe-area-inset-bottom); }
.container { padding-left: max(16px, env(safe-area-inset-left));
             padding-right: max(16px, env(safe-area-inset-right)); }

/* 햄버거 버튼 (기본 숨김 — 모바일에서만 표시) */
.nav-hamburger {
  display: none;
  flex-direction: column; justify-content: space-between;
  width: 32px; height: 28px; padding: 4px;
  background: transparent; border: none; cursor: pointer;
  align-self: center; margin-right: 8px;
  -webkit-tap-highlight-color: transparent;
}
.nav-hamburger span {
  display: block; height: 3px; width: 100%;
  background: #f1f5f9; border-radius: 2px;
  transition: transform .25s, opacity .2s;
  transform-origin: center;
}
.nav-hamburger.on span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-hamburger.on span:nth-child(2) { opacity: 0; }
.nav-hamburger.on span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* 백드롭 (모바일 드로어 열린 동안 본문 흐림) */
.nav-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 90;
}
.nav-backdrop.on { display: block; }
body.nav-open { overflow: hidden; }

/* 데스크톱 — 기존 가로 nav 유지 */
@media (min-width: 901px) {
  .nav-hamburger, .nav-backdrop { display: none !important; }
}

/* 모바일 — footer 고정 해제 (하단 클릭 가림 방지) */
@media (max-width: 900px) {
  .footer { position: static; }
}

/* 모바일 (≤900px) — 햄버거·드로어 폐기, 상단 가로 스크롤 메뉴 (폰 버그 회피) */
@media (max-width: 900px) {
  .nav-hamburger { display: none !important; }  /* 햄버거 안 씀 */
  .nav-backdrop { display: none !important; }
  .topnav-inner {
    display: flex; align-items: center;
    padding: 8px 12px; gap: 8px; flex-wrap: wrap;
  }
  .brand { font-size: 16px; margin-right: auto; }
  /* 우측 사용자 영역 — 이름 숨김, 아이콘만 */
  .user-name { display: none; }
  .role-badge { display: none; }
  .profile-hint { display: none; }
  .user-icon { font-size: 18px; }
  .nav-right { gap: 6px; }
  .btn-logout { padding: 6px 10px; font-size: 12px; min-height: 36px; }
  /* 메인 nav — 둘째 줄에 가로 스크롤 칩 (드로어 X) */
  .nav-links {
    position: static;
    transform: none; visibility: visible; pointer-events: auto;
    order: 3; flex: 1 1 100%;
    display: flex; flex-direction: row; flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px; margin-top: 4px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .nav-links::-webkit-scrollbar { height: 4px; }
  .nav-links::-webkit-scrollbar-thumb { background: #475569; border-radius: 2px; }
  .nav-links a {
    flex: 0 0 auto; white-space: nowrap;
    padding: 8px 14px; font-size: 13px; font-weight: 600;
    background: rgba(255, 255, 255, 0.06); border-radius: 16px;
    color: #e2e8f0; min-height: 36px;
    display: flex; align-items: center;
  }
  .nav-links a:active, .nav-links a:hover {
    background: rgba(59, 130, 246, 0.25); color: #fff;
  }
  .container { padding-top: 12px; }
  .page-title { font-size: 18px; margin: 8px 0; }
}

/* 모바일 (≤700px) — 더 좁은 환경 */
@media (max-width: 700px) {
  /* 표 폰트 더 작게 */
  .table { font-size: 11px; }
  .table th, .table td { padding: 6px 4px; }
  /* 카드 패딩 줄임 */
  .card { padding: 12px; }
  .section { margin-bottom: 16px; }
  /* Hero 단순화 */
  .dash-hero { display: grid !important; grid-template-columns: 1fr; gap: 8px; }
  .dash-hero-num { font-size: 22px; }
  /* 전략 카드 2열 */
  .grid-cards { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  /* 컨테이너 양옆 좁게 */
  .container { padding-left: max(10px, env(safe-area-inset-left));
               padding-right: max(10px, env(safe-area-inset-right)); }
  /* footer 작게 */
  .footer { font-size: 11px; padding: 8px 12px; }
  .footer-sep { display: none; }
  .footer { flex-wrap: wrap; gap: 4px; }
}

/* 모바일 ≤500px — 표를 카드형으로 (보유종목·라운드) */
@media (max-width: 500px) {
  /* 표 가로 스크롤 안내 */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
  }
  .table-wrap::after {
    content: '→ 좌우 스와이프';
    display: block; text-align: center;
    font-size: 10px; color: #94a3b8;
    padding: 4px 0;
  }
  /* 거래대금/등락 표만 한 줄 슬림 */
  .table-market { font-size: 10px; }
  /* 헬스 컴포넌트 줄바꿈 잘 되게 */
  .dhc { font-size: 10px; padding: 3px 8px; }
}

/* 터치 친화 — 모든 버튼 최소 44px (iOS HIG) */
@media (max-width: 900px) and (pointer: coarse) {
  button, .btn, .btn-primary, .btn-logout,
  .an-tab, .an-tab-mid, .an-nav {
    min-height: 40px;
  }
  /* 입력 폼 폰트 16px (iOS 자동 줌 방지) */
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* 가로 스크롤 표시 — 사용자가 더 컬럼 있다는 것 알게 */
.table-wrap { scrollbar-width: thin; }
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* footer 모바일 */
.footer {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: center; gap: 8px;
  padding: 12px 16px; font-size: 12px;
  background: #f8fafc; border-top: 1px solid #e2e8f0;
}
@media (prefers-color-scheme: dark) {
  .footer { background: #0f172a; border-color: #1e293b; color: #94a3b8; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 11 — 대시보드 명확성·근거·날짜·여백 축소
   ════════════════════════════════════════════════════════════════════ */

/* 페이지 헤드 — 제목 옆 날짜·휴장 상태 */
.page-head {
  display: flex; align-items: baseline; gap: 12px;
  margin: 8px 0 12px; flex-wrap: wrap;
}
.page-head .page-title { margin: 0; }
.page-head-meta {
  display: inline-flex; gap: 8px; align-items: center;
  font-size: 13px; color: #64748b;
  padding: 4px 10px; background: #f1f5f9; border-radius: 14px;
}
.page-head-sep { color: #cbd5e1; }
.market-day.is-trading { color: #16a34a; font-weight: 700; }
.market-day.is-closed  { color: #b45309; font-weight: 700; }

/* 섹션 메타 — 모든 카드 위 출처/시점 한 줄 */
.section-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 11px; color: #64748b;
  margin: -6px 0 8px;
  padding: 4px 12px;
}
.src-line { white-space: nowrap; }
.src-note {
  background: #fef3c7; color: #78350f; padding: 2px 8px; border-radius: 4px;
  white-space: normal;
}

/* ─── 시스템 헬스 재설계 ─── */
.dash-health {
  /* 기존 grid 2열 덮어쓰기 */
  display: block !important;
  padding: 0 !important;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

/* 헤더 — 큰 상태 + 시각 */
.dh-header {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.dh-header.dh-good { background: linear-gradient(90deg, #dcfce7, #fff); }
.dh-header.dh-warn { background: linear-gradient(90deg, #fef3c7, #fff); }
.dh-header.dh-bad  { background: linear-gradient(90deg, #fee2e2, #fff); }

.dh-hdr-l { display: flex; flex-direction: column; gap: 4px; }
.dh-hdr-title {
  font-size: 20px; font-weight: 800; color: #0f172a;
  line-height: 1.2;
}
.dh-hdr-explain {
  font-size: 13px; color: #475569;
}
.dh-hdr-r {
  text-align: right;
  display: flex; flex-direction: column; gap: 2px;
  align-items: flex-end;
}
.dh-hdr-asof {
  font-size: 12px; color: #0f172a; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dh-hdr-src {
  font-size: 10px; color: #94a3b8;
  max-width: 100%; word-break: keep-all;
}

/* 다운된 항목 — 강조 박스 */
.dh-issues {
  padding: 12px 18px;
  background: #fef2f2;
  border-bottom: 1px solid #fecaca;
}
.dh-issues-title {
  font-size: 13px; font-weight: 700; color: #b91c1c;
  margin-bottom: 8px;
}
.dh-issue {
  display: grid; grid-template-columns: 140px 1fr;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px dashed #fecaca;
  font-size: 12px;
}
.dh-issue:last-child { border-bottom: none; }
.dh-issue-name {
  font-weight: 700; color: #0f172a; font-size: 13px;
  grid-row: span 3;
  align-self: start;
  padding-top: 2px;
}
.dh-issue-role,
.dh-issue-reason,
.dh-issue-fix {
  color: #475569;
}
.dh-issue-fix code {
  background: #fff; border: 1px solid #fecaca;
  padding: 2px 6px; border-radius: 4px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px; color: #b91c1c;
  word-break: break-all;
}

/* 정상 항목 — 한 줄 작게 */
.dh-oks {
  padding: 8px 18px;
  font-size: 11px; color: #64748b;
  background: #f8fafc;
}
.dh-oks-label { font-weight: 700; color: #475569; margin-right: 4px; }
.dh-ok-chip {
  display: inline-block;
  padding: 1px 8px; margin: 2px 3px;
  background: #fff; border: 1px solid #cbd5e1;
  border-radius: 10px; color: #475569;
  cursor: help;
}

/* 모바일 */
@media (max-width: 700px) {
  .page-head { gap: 6px; }
  .page-head-meta { font-size: 11px; padding: 3px 8px; }
  #sw-today-label, #sw-market-label { white-space: nowrap; }
  .sw-mode { width: auto; margin-left: auto; }
  .sw-mode-btn { flex: 1 1 0; text-align: center; padding: 8px 6px; font-size: 13px; }
  .swm-title { flex-wrap: wrap; row-gap: 2px; }
  .swm-title > span { white-space: nowrap; flex: 0 0 auto; }
  .swm-title-toggle small { flex: 1 1 100%; text-align: left; margin-top: 2px; }
  /* 시장현황 — 모바일: 글꼴 축소 + 숫자 칸 내용폭(고정폭 해제) → 종목명 공간 확보(최소 3글자) */
  .sw-mkt2-row { gap: 7px; padding: 8px 10px; }
  .sw-mkt2-row .smr-rank { min-width: 14px; font-size: 11px; }
  .sw-mkt2-row .smr-name { font-size: 13px; min-width: 3.2em; }
  .sw-mkt2-row .smr-price { font-size: 12px; min-width: 0; }
  .sw-mkt2-row .sm2-chg { font-size: 12px; }
  .sw-mkt2-row .smr-chgamt { min-width: 0; }
  .sw-mkt2-row .smr-chgrate { min-width: 0; }
  .sw-mkt2-row .sm2-score { font-size: 11px; padding: 2px 7px; }
  /* 추천주 표 — 모바일: 글꼴 축소 + 비핵심 칸(테마3·판정7·추천카드8) 숨김(상세는 행 클릭) */
  #sw-rec-table { font-size: 12px; }
  #sw-rec-table th, #sw-rec-table td { padding: 6px 5px; }
  #sw-rec-table th:nth-child(3), #sw-rec-table td:nth-child(3),
  #sw-rec-table th:nth-child(7), #sw-rec-table td:nth-child(7),
  #sw-rec-table th:nth-child(8), #sw-rec-table td:nth-child(8) { display: none; }
  .dh-header { padding: 10px 12px; flex-direction: column; gap: 6px; }
  .dh-hdr-r { text-align: left; align-items: flex-start; }
  .dh-hdr-title { font-size: 16px; }
  .dh-hdr-explain { font-size: 12px; }
  .dh-hdr-src { font-size: 9px; }
  .dh-issues { padding: 10px 12px; }
  .dh-issue { grid-template-columns: 1fr; gap: 2px 8px; }
  .dh-issue-name { grid-row: auto; padding: 0 0 4px; }
  .dh-oks { padding: 8px 12px; }
  .section-meta { padding: 4px 8px; gap: 8px; font-size: 10px; }
}

/* 여백 축소 — 카드 전반 */
.card { padding: 12px 14px; }
.section { margin-bottom: 14px; }
.section-head { margin-bottom: 6px; }

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .page-head-meta { background: #0f172a; color: #cbd5e1; }
  .page-head-sep { color: #475569; }
  .market-day.is-trading { color: #4ade80; }
  .market-day.is-closed { color: #fbbf24; }
  .section-meta { color: #94a3b8; }
  .src-note { background: #422006; color: #fde68a; }
  .dash-health { background: #1e293b; border-color: #334155; }
  .dh-header { border-color: #334155; }
  .dh-header.dh-good { background: linear-gradient(90deg, #052e16, #1e293b); }
  .dh-header.dh-warn { background: linear-gradient(90deg, #422006, #1e293b); }
  .dh-header.dh-bad  { background: linear-gradient(90deg, #450a0a, #1e293b); }
  .dh-hdr-title { color: #f1f5f9; }
  .dh-hdr-explain { color: #cbd5e1; }
  .dh-hdr-asof { color: #f1f5f9; }
  .dh-hdr-src { color: #64748b; }
  .dh-issues { background: #450a0a; border-color: #b91c1c; }
  .dh-issues-title { color: #fca5a5; }
  .dh-issue-name { color: #f1f5f9; }
  .dh-issue-role, .dh-issue-reason, .dh-issue-fix { color: #cbd5e1; }
  .dh-issue-fix code { background: #1e293b; border-color: #b91c1c; color: #fca5a5; }
  .dh-issue { border-color: #7f1d1d; }
  .dh-oks { background: #0f172a; color: #94a3b8; }
  .dh-oks-label { color: #cbd5e1; }
  .dh-ok-chip { background: #1e293b; border-color: #334155; color: #cbd5e1; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 12 — 대시보드 우선순위 재배치
   1) 오늘 한눈에 (최상단·임팩트) · 2) 시스템 · 3) 통계
   ════════════════════════════════════════════════════════════════════ */

/* 우선순위 1 — 오늘 한눈에 (가장 임팩트) */
.sec-priority-1 {
  margin-bottom: 18px;
}
.sec-priority-1 .section-head { margin-bottom: 8px; }
.sec-priority-1 .section-head h2 {
  font-size: 18px; font-weight: 800; color: #0f172a;
}

.today-fallback-note {
  padding: 8px 14px; margin-bottom: 10px;
  background: linear-gradient(90deg, #fef3c7, #fde68a);
  border-left: 4px solid #f59e0b; border-radius: 6px;
  color: #78350f; font-size: 13px;
}

/* Hero: 손익 + 통계 (가로 2단) */
.today-hero {
  display: grid; grid-template-columns: 1.2fr 2fr;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-radius: 14px; color: #f1f5f9;
  margin-bottom: 10px;
}
.th-pnl-block {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  padding-right: 14px;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.th-label { font-size: 11px; color: #94a3b8; letter-spacing: 0.5px; text-transform: uppercase; }
.th-pnl {
  font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.th-pnl.pnl-pos { color: #f87171; }  /* 이익=빨강 (한국 증시) */
.th-pnl.pnl-neg { color: #60a5fa; }  /* 손실=파랑 (한국 증시) */
.th-pnl.pnl-flat { color: #94a3b8; }
.th-roi { font-size: 13px; color: #cbd5e1; font-weight: 600; }

.th-stats-block {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.th-stat {
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(255,255,255,0.06); padding: 8px 10px;
  border-radius: 8px;
}
.th-stat span { font-size: 10px; color: #94a3b8; letter-spacing: 0.4px; text-transform: uppercase; }
.th-stat b { font-size: 18px; color: #f1f5f9; font-variant-numeric: tabular-nums; }
.th-stat small { font-size: 10px; color: #94a3b8; }

/* 회차 진행 strip */
.today-rounds-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 10px;
}
.trs-card {
  padding: 10px 12px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 8px;
  display: flex; flex-direction: column; gap: 4px;
  /* 딥링크 클릭(a 태그) — 링크 스타일 리셋 + 터치 친화 */
  text-decoration: none; color: inherit; cursor: pointer;
  position: relative; -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, box-shadow .12s ease;
}
.trs-card:active { transform: scale(0.98); }
.trs-card:hover { box-shadow: 0 2px 8px rgba(15,23,42,.12); }
.trs-go {
  font-size: 10px; font-weight: 700; color: #2563eb;
  align-self: flex-end; margin-top: 2px;
}
.trs-pending { background: #f8fafc; opacity: 0.85; }
.trs-active  { background: linear-gradient(180deg, #fef3c7, #fff); border-color: #fbbf24; }
.trs-done    { background: linear-gradient(180deg, #f0fdf4, #fff); border-color: #86efac; }
.trs-closed  { background: #f1f5f9; opacity: 0.7; }

.trs-h { display: flex; justify-content: space-between; align-items: center; }
.trs-no { font-weight: 800; font-size: 13px; color: #0f172a; }
.trs-status { font-size: 10px; color: #475569; font-weight: 600; }
.trs-time { font-size: 10px; color: #64748b; }
.trs-pnl {
  font-size: 18px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.trs-pnl small { font-size: 10px; font-weight: 500; color: #94a3b8; margin-left: 2px; }
.trs-sub { font-size: 10px; color: #64748b; }

/* 시장 한 줄 */
.today-market-line {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 8px 12px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}
.tml-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 0;
}
.tml-icon { font-size: 14px; }
.tml-item b { color: #0f172a; }
.tml-item small { color: #64748b; font-size: 11px; }
.tml-empty, .tml-loading { color: #94a3b8; font-size: 12px; }

/* 빠른 이동 */
.today-quick-links {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.today-quick-links a {
  padding: 6px 12px; background: #eff6ff; border: 1px solid #93c5fd;
  border-radius: 14px; font-size: 12px; font-weight: 600;
  color: #1d4ed8; text-decoration: none;
}
.today-quick-links a:hover { background: #dbeafe; }

/* 우선순위 2 — 시스템 (압축) */
.sec-priority-2 { margin-bottom: 18px; }

/* 우선순위 3 — 통계·이력 구분선 */
.sec-3-divider {
  font-size: 14px; font-weight: 700;
  color: #64748b; text-transform: uppercase; letter-spacing: 1.5px;
  margin: 20px 0 10px; padding: 6px 0;
  border-top: 1px solid #e2e8f0;
}

/* 누적 자산 카드 (가로 3분할) */
.capital-card { padding: 12px 16px; }
.cap-row {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px;
}
.cap-item { display: flex; flex-direction: column; gap: 2px; }
.cap-item span { font-size: 11px; color: #64748b; }
.cap-item b { font-size: 18px; color: #0f172a; font-variant-numeric: tabular-nums; }
.cap-item:first-child b { font-size: 22px; color: #0f172a; }

/* 모바일 — 첫 화면 최적화 */
@media (max-width: 700px) {
  .sec-priority-1 .section-head h2 { font-size: 16px; }
  .today-hero {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 10px;
  }
  .th-pnl-block {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-right: 0; padding-bottom: 10px;
    align-items: center; text-align: center;
  }
  .th-pnl { font-size: 32px; }
  .th-stats-block { grid-template-columns: repeat(3, 1fr); }
  .th-stat b { font-size: 15px; }
  .trs-card { padding: 8px 10px; }
  .trs-pnl { font-size: 16px; }
  .cap-row { grid-template-columns: 1fr; gap: 6px; }
  .cap-item { flex-direction: row; justify-content: space-between; align-items: baseline; }
  .cap-item:first-child b { font-size: 18px; }
  .today-quick-links a { padding: 8px 12px; }
}

@media (max-width: 480px) {
  .today-rounds-strip { grid-template-columns: 1fr; }
  .trs-card { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; }
  .trs-h { flex-direction: column; align-items: flex-start; gap: 0; min-width: 50px; }
  .trs-time { display: none; }
  .trs-pnl { font-size: 18px; margin-left: auto; }
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .sec-priority-1 .section-head h2 { color: #f1f5f9; }
  .today-fallback-note {
    background: linear-gradient(90deg, #422006, #78350f);
    border-color: #b45309; color: #fde68a;
  }
  .trs-card { background: #1e293b; border-color: #334155; }
  .trs-pending { background: #0f172a; }
  .trs-active { background: linear-gradient(180deg, #422006, #1e293b); border-color: #b45309; }
  .trs-done { background: linear-gradient(180deg, #052e16, #1e293b); border-color: #15803d; }
  .trs-closed { background: #0f172a; }
  .trs-no { color: #f1f5f9; }
  .trs-status, .trs-time, .trs-sub { color: #94a3b8; }
  .today-market-line { background: #1e293b; border-color: #334155; }
  .tml-item b { color: #f1f5f9; }
  .tml-item small { color: #94a3b8; }
  .today-quick-links a { background: #1e3a8a; border-color: #3b82f6; color: #dbeafe; }
  .today-quick-links a:hover { background: #1d4ed8; }
  .sec-3-divider { color: #94a3b8; border-color: #334155; }
  .cap-item span { color: #94a3b8; }
  .cap-item b { color: #f1f5f9; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 13 — 단타 엔진 상태 카드 (옵션 B)
   ════════════════════════════════════════════════════════════════════ */

.danta-engine-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.de-loading { padding: 14px 18px; text-align: center; color: #94a3b8; }

.de-header {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.de-good { background: linear-gradient(90deg, #dcfce7, #fff); }
.de-warn { background: linear-gradient(90deg, #fef3c7, #fff); }
.de-bad  { background: linear-gradient(90deg, #fee2e2, #fff); }
.de-hdr-title { font-size: 15px; font-weight: 800; color: #0f172a; }
.de-hdr-explain { font-size: 12px; color: #475569; margin-top: 2px; }
.de-hdr-asof { font-size: 11px; color: #64748b; font-variant-numeric: tabular-nums; }

.de-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 12px;
}
.de-card {
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  border-left-width: 4px;
}
.de-c-ok   { border-left-color: #22c55e; background: #f0fdf4; }
.de-c-down { border-left-color: #ef4444; background: #fef2f2; }
.de-card-h {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 4px;
}
.de-card-icon { font-size: 13px; }
.de-card-label { font-size: 13px; color: #0f172a; }
.de-card-value {
  font-size: 18px; font-weight: 700; color: #0f172a;
  margin: 2px 0;
}
.de-card-reason {
  font-size: 11px; color: #475569;
  line-height: 1.4;
}
.de-card-fix {
  font-size: 11px; color: #b91c1c;
  background: #fff; padding: 4px 8px;
  border-radius: 4px; margin-top: 6px;
  border: 1px dashed #fca5a5;
}
.de-card-src {
  font-size: 10px; color: #94a3b8; margin-top: 6px;
  word-break: break-all;
}

/* 모바일 — 카드 1열 */
@media (max-width: 700px) {
  .de-grid { grid-template-columns: 1fr; padding: 10px; gap: 8px; }
  .de-header { padding: 10px 12px; flex-direction: column; gap: 4px; }
  .de-hdr-r { text-align: left; }
  .de-hdr-title { font-size: 14px; }
  .de-card-value { font-size: 16px; }
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .danta-engine-card { background: #1e293b; border-color: #334155; }
  .de-header { border-color: #334155; }
  .de-good { background: linear-gradient(90deg, #052e16, #1e293b); }
  .de-warn { background: linear-gradient(90deg, #422006, #1e293b); }
  .de-bad  { background: linear-gradient(90deg, #450a0a, #1e293b); }
  .de-hdr-title { color: #f1f5f9; }
  .de-hdr-explain { color: #cbd5e1; }
  .de-hdr-asof { color: #94a3b8; }
  .de-card { background: #0f172a; border-color: #334155; }
  .de-c-ok   { background: #052e16; }
  .de-c-down { background: #450a0a; }
  .de-card-label { color: #f1f5f9; }
  .de-card-value { color: #f1f5f9; }
  .de-card-reason { color: #cbd5e1; }
  .de-card-fix { background: #1e293b; border-color: #b91c1c; color: #fca5a5; }
  .de-card-src { color: #64748b; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 14 — 자산 카드 근거·정합성 경고·평가손익 분리
   ════════════════════════════════════════════════════════════════════ */

.cap-hint {
  font-size: 9px; color: #94a3b8; font-weight: 400;
  display: block; margin-top: 1px;
}
.cap-warn-flag {
  font-size: 10px; color: #b91c1c; font-weight: 700;
  background: #fee2e2; padding: 1px 5px; border-radius: 3px;
}

/* 자산 정합성 경고 박스 */
.capital-warning {
  margin-top: 10px; padding: 10px 14px;
  background: #fef2f2; border: 1px solid #fca5a5;
  border-left: 4px solid #ef4444; border-radius: 6px;
  font-size: 12px; color: #7f1d1d; line-height: 1.5;
}
.capital-warning b { color: #b91c1c; }

/* 전략 카드 출처 라인 */
.strat-src { font-size: 9px; color: #94a3b8; }
.strat-card .card-sub { line-height: 1.4; }

/* 포트폴리오 실현/평가 분리 */
.pf-split { font-size: 11px; }
.pf-split b { font-variant-numeric: tabular-nums; }

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .cap-hint { color: #64748b; }
  .cap-warn-flag { background: #450a0a; color: #fca5a5; }
  .capital-warning {
    background: #450a0a; border-color: #b91c1c; color: #fecaca;
  }
  .capital-warning b { color: #fca5a5; }
  .strat-src { color: #64748b; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 15 — 오늘 번 돈 흐름 (오늘→전체→누적)
   ════════════════════════════════════════════════════════════════════ */

.money-flow {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  overflow: hidden;
}
.mf-loading { padding: 16px; text-align: center; color: #94a3b8; }

/* 카테고리별 행 */
.mf-row {
  display: grid; grid-template-columns: 110px 1fr 120px;
  align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
}
.mf-cat { font-weight: 700; font-size: 13px; color: #0f172a; }
.mf-rounds { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mf-round-chip {
  font-size: 12px; padding: 3px 8px;
  background: #f1f5f9; border-radius: 12px; color: #475569;
}
.mf-round-chip b { font-variant-numeric: tabular-nums; }
.mf-empty-chip { font-size: 11px; color: #94a3b8; }
.mf-note { font-size: 11px; color: #94a3b8; }
.mf-pf { font-size: 12px; color: #475569; }
.mf-pf b { font-variant-numeric: tabular-nums; }
.mf-sub-total {
  text-align: right; font-size: 16px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 오늘 합계 행 (강조) */
.mf-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: #f8fafc;
  border-top: 2px solid #0f172a;
}
.mf-total-label { font-size: 15px; font-weight: 800; color: #0f172a; }
.mf-total-val {
  font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums;
}

/* 결론 (그래서 총자산 → 누적) */
.mf-conclusion {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; background: linear-gradient(90deg, #0f172a, #1e293b);
  color: #f1f5f9;
}
.mf-conc-item { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.mf-conc-item span { font-size: 11px; color: #94a3b8; }
.mf-conc-item b { font-size: 20px; font-variant-numeric: tabular-nums; color: #f1f5f9; }
.mf-conc-item b.pnl-pos { color: #f87171; }  /* 이익=빨강 */
.mf-conc-item b.pnl-neg { color: #60a5fa; }  /* 손실=파랑 */
.mf-conc-arrow { font-size: 20px; color: #64748b; }
.mf-warn { font-size: 10px; color: #fca5a5; font-weight: 700; }

/* 모바일 */
@media (max-width: 700px) {
  .mf-row { grid-template-columns: 1fr auto; gap: 6px; padding: 10px 12px; }
  .mf-rounds { grid-column: 1 / -1; order: 3; }
  .mf-cat { font-size: 13px; }
  .mf-sub-total { font-size: 15px; }
  .mf-total-val { font-size: 20px; }
  .mf-conclusion { flex-direction: column; align-items: stretch; gap: 8px; }
  .mf-conc-arrow { transform: rotate(90deg); text-align: center; }
  .mf-conc-item { flex-direction: row; justify-content: space-between; align-items: baseline; }
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .money-flow { background: #1e293b; border-color: #334155; }
  .mf-row { border-color: #0f172a; }
  .mf-cat { color: #f1f5f9; }
  .mf-round-chip { background: #0f172a; color: #cbd5e1; }
  .mf-pf { color: #cbd5e1; }
  .mf-total-row { background: #0f172a; border-color: #cbd5e1; }
  .mf-total-label { color: #f1f5f9; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 16 — 자산 카드 키움 실시간 분해 (현금/보유/평가)
   ════════════════════════════════════════════════════════════════════ */
.capital-kiwoom {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 10px; padding: 10px 14px;
  background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px;
  font-size: 13px;
}
.ckw-item { display: inline-flex; align-items: center; gap: 5px; color: #475569; }
.ckw-item b { color: #0f172a; font-variant-numeric: tabular-nums; }

@media (prefers-color-scheme: dark) {
  .capital-kiwoom { background: #0c4a6e; border-color: #0369a1; }
  .ckw-item { color: #bae6fd; }
  .ckw-item b { color: #f1f5f9; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 18 — 스윙매매 테마 그룹 UI
   ════════════════════════════════════════════════════════════════════ */

.btn-scan {
  padding: 6px 14px; font-size: 13px; font-weight: 600;
  background: #3b82f6; color: #fff; border: none; border-radius: 6px;
  cursor: pointer;
}
.btn-scan:hover { background: #2563eb; }
.btn-scan:disabled { opacity: .6; cursor: wait; }

.sw-loading, .sw-empty { padding: 20px; text-align: center; color: #94a3b8; }

/* 테마 그룹 카드 그리드 */
.sw-groups {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.sw-group-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 14px; border-left-width: 4px;
  display: flex; flex-direction: column; gap: 10px;
}
.sw-sig-strong  { border-left-color: #dc2626; }   /* 강세=빨강(한국) */
.sw-sig-neutral { border-left-color: #94a3b8; }
.sw-sig-weak    { border-left-color: #2563eb; }    /* 약세=파랑(한국) */
.sw-sig-none    { border-left-color: #cbd5e1; }

.sw-grp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.sw-grp-title { font-size: 16px; font-weight: 800; color: #0f172a; }
.sw-grp-count { font-size: 12px; color: #64748b; font-weight: 600; }
.sw-grp-signal {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px;
  white-space: nowrap;
}
.sw-grp-signal.sw-sig-strong  { background: #fee2e2; color: #b91c1c; }
.sw-grp-signal.sw-sig-neutral { background: #f1f5f9; color: #475569; }
.sw-grp-signal.sw-sig-weak    { background: #dbeafe; color: #1d4ed8; }
.sw-grp-signal.sw-sig-none    { background: #f1f5f9; color: #94a3b8; }

.sw-grp-metrics { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: #64748b; }
.sw-grp-metrics b { color: #0f172a; }

.sw-grp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.sw-chip {
  font-size: 11px; padding: 3px 8px; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 10px; color: #475569;
}
.sw-chip b { color: #0f172a; }
.sw-chip-more { background: #eff6ff; color: #1d4ed8; border-color: #93c5fd; }

.sw-grp-actions { display: flex; gap: 8px; margin-top: 2px; }
.sw-btn-detail, .sw-btn-approve {
  flex: 1; padding: 8px; font-size: 13px; font-weight: 600;
  border-radius: 6px; cursor: pointer; border: 1px solid;
}
.sw-btn-detail { background: #fff; border-color: #cbd5e1; color: #475569; }
.sw-btn-detail:hover { background: #f1f5f9; }
.sw-btn-approve { background: #16a34a; border-color: #15803d; color: #fff; }
.sw-btn-approve:hover { background: #15803d; }

.sw-mode-pill { font-size: 11px; padding: 2px 8px; background: #dbeafe; color: #1e3a8a; border-radius: 10px; }

/* 모달 */
.sw-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.sw-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.sw-modal-box {
  position: relative; background: #fff; border-radius: 12px;
  width: min(900px, 92vw); max-height: 85vh; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.sw-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid #e2e8f0;
}
.sw-modal-head h3 { margin: 0; font-size: 16px; color: #0f172a; }
.sw-modal-close {
  background: none; border: none; font-size: 20px; cursor: pointer; color: #64748b;
}
.sw-modal-body { padding: 12px 18px; overflow-y: auto; }
.sw-modal-table { font-size: 12px; }
.sw-mini-approve {
  padding: 4px 12px; font-size: 12px; font-weight: 600;
  background: #16a34a; color: #fff; border: none; border-radius: 5px; cursor: pointer;
}
.sw-mini-approve:hover { background: #15803d; }
.sw-mini-approve:disabled { opacity: .6; }

/* 스윙 엔진 카드 (단타 엔진 카드 스타일 재사용 — de-* 클래스) */
.sw-engine-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden;
}

/* 모바일 */
@media (max-width: 700px) {
  .sw-groups { grid-template-columns: 1fr; }
  .sw-grp-title { font-size: 15px; }
  .sw-modal-body { padding: 8px 10px; }
  .sw-auto-bar { gap: 8px; }
  .sw-budget-cond { flex-basis: 100%; }
  .sw-budget-cond input { width: 120px; }
  .sw-budget-presets { flex-basis: 100%; }
  .sw-budget-presets button { flex: 1; padding: 6px 8px; }
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .sw-group-card { background: #1e293b; border-color: #334155; }
  .sw-grp-title { color: #f1f5f9; }
  .sw-grp-metrics b { color: #f1f5f9; }
  .sw-chip { background: #0f172a; border-color: #334155; color: #cbd5e1; }
  .sw-chip b { color: #f1f5f9; }
  .sw-btn-detail { background: #0f172a; border-color: #334155; color: #cbd5e1; }
  .sw-grp-signal.sw-sig-strong  { background: #450a0a; color: #fca5a5; }
  .sw-grp-signal.sw-sig-weak    { background: #1e3a8a; color: #bfdbfe; }
  .sw-modal-box { background: #1e293b; }
  .sw-modal-head { border-color: #334155; }
  .sw-modal-head h3 { color: #f1f5f9; }
  .sw-engine-card { background: #1e293b; border-color: #334155; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 19 — 스윙 금액 우선 + 테마 압축 리스트 (모바일 친화)
   ════════════════════════════════════════════════════════════════════ */

/* 💰 자금 요약 (최상단) */
.sw-money {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-radius: 14px; padding: 16px 18px; color: #f1f5f9;
}
.sw-money-grid {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px;
}
.sw-money-item {
  display: flex; flex-direction: column; gap: 3px;
  padding-right: 14px; border-right: 1px solid rgba(255,255,255,.1);
}
.sw-money-item:last-child { border-right: none; }
.sw-money-item span { font-size: 11px; color: #94a3b8; }
.sw-money-item b { font-size: 20px; font-variant-numeric: tabular-nums; color: #f1f5f9; }
.sw-money-item small { font-size: 11px; color: #94a3b8; }
.sw-money-main b { font-size: 28px; }
.sw-money-main b.pnl-pos { color: #f87171; }  /* 이익=빨강 */
.sw-money-main b.pnl-neg { color: #60a5fa; }  /* 손실=파랑 */
.sw-money .section-meta { margin-top: 10px; padding: 0; color: #64748b; }

/* 🎯 테마 압축 리스트 (한 줄씩) */
.sw-theme-list { display: flex; flex-direction: column; gap: 6px; }
.sw-theme-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center; gap: 10px;
  padding: 10px 14px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 8px;
  border-left-width: 4px; cursor: pointer;
  transition: background .12s;
}
.sw-theme-row:hover { background: #f8fafc; }
.sw-theme-row.sw-sig-strong  { border-left-color: #dc2626; }
.sw-theme-row.sw-sig-neutral { border-left-color: #94a3b8; }
.sw-theme-row.sw-sig-weak    { border-left-color: #2563eb; }
.sw-theme-row.sw-sig-none    { border-left-color: #cbd5e1; }

.sw-tr-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sw-tr-icon { font-size: 18px; flex-shrink: 0; }
.sw-tr-name { font-weight: 700; color: #0f172a; font-size: 14px; }
.sw-tr-count { font-size: 12px; color: #64748b; flex-shrink: 0; }
.sw-tr-signal {
  font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 10px;
  white-space: nowrap;
}
.sw-tr-signal.sw-sig-strong  { background: #fee2e2; color: #b91c1c; }
.sw-tr-signal.sw-sig-neutral { background: #f1f5f9; color: #475569; }
.sw-tr-signal.sw-sig-weak    { background: #dbeafe; color: #1d4ed8; }
.sw-tr-signal.sw-sig-none    { background: #f1f5f9; color: #94a3b8; }
.sw-tr-amount {
  font-size: 14px; font-weight: 700; color: #0f172a;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sw-tr-actions { display: flex; gap: 4px; align-items: center; }
.sw-row-detail, .sw-row-approve {
  width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
  border: 1px solid; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sw-row-detail { background: #fff; border-color: #cbd5e1; color: #64748b; }
.sw-row-detail:hover { background: #f1f5f9; }
.sw-row-approve { background: #16a34a; border-color: #15803d; color: #fff; font-size: 13px; }
.sw-row-approve:hover { background: #15803d; }

/* 모바일 — 테마 행 2단 적층 */
@media (max-width: 600px) {
  .sw-money-grid { grid-template-columns: 1fr; gap: 8px; }
  .sw-money-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,.1); padding: 0 0 8px; }
  .sw-money-item:last-child { border-bottom: none; padding-bottom: 0; }
  .sw-money-main b { font-size: 24px; }
  .sw-theme-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "main actions" "meta meta";
    gap: 6px 10px;
  }
  .sw-tr-main { grid-area: main; }
  .sw-tr-actions { grid-area: actions; }
  .sw-tr-signal, .sw-tr-amount { grid-area: meta; display: inline-block; margin-right: 10px; }
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .sw-theme-row { background: #1e293b; border-color: #334155; }
  .sw-theme-row:hover { background: #0f172a; }
  .sw-tr-name { color: #f1f5f9; }
  .sw-tr-count { color: #94a3b8; }
  .sw-tr-amount { color: #f1f5f9; }
  .sw-tr-signal.sw-sig-strong { background: #450a0a; color: #fca5a5; }
  .sw-tr-signal.sw-sig-weak { background: #1e3a8a; color: #bfdbfe; }
  .sw-row-detail { background: #0f172a; border-color: #334155; color: #cbd5e1; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 20 — 스윙 키움 계좌판 (단타와 통일)
   ════════════════════════════════════════════════════════════════════ */
.sw-acct-title {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.sw-acct-title span { font-size: 15px; font-weight: 800; color: #f1f5f9; }
.sw-acct-title small { font-size: 11px; color: #94a3b8; }

.sw-acct-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px;
  background: rgba(255,255,255,.08); border-radius: 8px; overflow: hidden;
}
.sw-acct-item {
  background: #1e293b; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 3px;
}
.sw-acct-item span { font-size: 10px; color: #94a3b8; }
.sw-acct-item b { font-size: 15px; color: #f1f5f9; font-variant-numeric: tabular-nums; }
.sw-acct-item b.pnl-pos { color: #f87171; }  /* 이익=빨강 */
.sw-acct-item b.pnl-neg { color: #60a5fa; }  /* 손실=파랑 */
.sw-acct-item.sw-acct-total { background: #0f172a; }
.sw-acct-item.sw-acct-total b { font-size: 17px; color: #fbbf24; }

.sw-acct-pending {
  margin-top: 10px; padding: 8px 12px;
  background: rgba(59,130,246,.12); border-radius: 6px;
  font-size: 12px; color: #cbd5e1;
}
.sw-acct-pending b { color: #f1f5f9; }
.sw-money-err {
  padding: 14px; background: #450a0a; border-radius: 8px;
  color: #fca5a5; font-size: 13px;
}

/* 모바일 — 계좌판 2~3열 */
@media (max-width: 700px) {
  .sw-acct-grid { grid-template-columns: repeat(2, 1fr); }
  .sw-acct-item b { font-size: 14px; }
}
@media (max-width: 380px) {
  .sw-acct-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 22 — 스윙 자금 단타식 2단 카드 + 스윙 색상(인디고)
   ════════════════════════════════════════════════════════════════════ */
/* 외부 테두리 없음 — 단타와 동일하게 셀 그리드만. 배경색만 하늘색 틴트 */
.swm-card { background: none; border: none; padding: 0; }

/* 섹션 타이틀 — 흰색 배경 띠로 도드라지게 (잘 보이게) */
.swm-title {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 2px 0 6px;
  background: #ffffff;
  padding: 8px 12px; border-radius: 6px;
  border: 1px solid #bae6fd;
}
.swm-title span { font-size: 14px; font-weight: 800; color: #0c4a6e; }
.swm-title small { font-size: 11px; color: #0284c7; font-weight: 700; }
.swm-title-ops { margin-top: 14px; }
.swm-title-toggle { cursor: pointer; gap: 10px; }
.swm-title-toggle small { text-align: right; line-height: 1.4; }
.swm-fold { color: #1d4ed8; font-weight: 900; white-space: nowrap; }

.swm-ops-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  min-height: 54px;
  padding: 11px 14px;
  border-radius: 0;
  border: none;
  background: linear-gradient(180deg, #fb8c24 0%, #ea580c 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 3px 10px rgba(15,23,42,.12);
  -webkit-tap-highlight-color: transparent;
}
.swm-ops-bar:active,
.swm-ops-bar[aria-expanded="true"] {
  filter: saturate(1.06) brightness(.98);
}
.swm-ops-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.swm-ops-main span {
  font-size: 14px;
  font-weight: 950;
  color: #fff;
  white-space: nowrap;
}
.swm-ops-main small {
  color: rgba(255,255,255,.82);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.swm-ops-amount {
  margin-left: auto;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(0,0,0,.2);
  white-space: nowrap;
}
.swm-ops-fold {
  flex: none;
  color: #ffedd5;
  font-style: normal;
  font-size: 15px;
  font-weight: 950;
}
.swm-ops-body {
  padding: 8px 10px 10px;
  background: #fff7ed;
  border-top: 3px solid #f97316;
  border-bottom: 1px solid #fed7aa;
}

/* 카드 그리드 */
.swm-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  margin-bottom: 6px;
}
.swm-grid-ops { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.swm-cell {
  background: #e0f2fe;            /* 연한 하늘색 — 스윙 정체성 */
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 3px;
  min-width: 0;
}
.swm-cell span {
  font-size: 10px; color: #0369a1; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.swm-cell b {
  font-size: 15px; color: #0c4a6e; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.swm-cell b.pnl-pos { color: #dc2626; }  /* 이익=빨강 */
.swm-cell b.pnl-neg { color: #2563eb; }  /* 손실=파랑 */

.swm-budget-row {
  display: grid; grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center; gap: 8px;
  margin: 0 0 8px; padding: 8px 10px;
  background: #e0f2fe; border: 1px solid #bae6fd; border-radius: 8px;
}
.swm-budget-main { display: flex; align-items: center; gap: 6px; }
.swm-budget-main span {
  color: #075985; font-size: 12px; font-weight: 900; white-space: nowrap;
}
.swm-budget-main input {
  width: 132px; height: 34px; padding: 0 10px; border: 1px solid #7dd3fc;
  border-radius: 7px; text-align: right; color: #0c4a6e; font-weight: 900;
  font-size: 16px; font-variant-numeric: tabular-nums; background: #fff;
}
.swm-budget-main button {
  height: 34px; border: 1px solid #0ea5e9; background: #bae6fd; color: #075985;
  border-radius: 7px; padding: 0 12px; font-size: 12px; font-weight: 900;
  cursor: pointer;
}
.swm-budget-main button:hover { background: #7dd3fc; }
.swm-budget-row .sw-budget-presets {
  display: flex; justify-content: flex-end; gap: 5px;
}
.swm-budget-row .sw-budget-presets button {
  height: 32px; border: 1px solid #7dd3fc; background: #f0f9ff; color: #075985;
  border-radius: 999px; padding: 0 10px; font-size: 12px; font-weight: 900;
  cursor: pointer;
}
.swm-budget-row .sw-budget-presets button:hover {
  background: #bae6fd;
}

/* 총자산 강조 — 진한 하늘 */
.swm-cell.swm-total { background: #bae6fd; border-color: #7dd3fc; }
.swm-cell.swm-total b { font-size: 16px; color: #075985; }

/* 오늘 손익 강조 */
.swm-cell.swm-today { background: #bae6fd; border-color: #7dd3fc; }
.swm-cell.swm-today b { font-size: 18px; }
.swm-cell.swm-today b.pnl-pos { color: #dc2626; }
.swm-cell.swm-today b.pnl-neg { color: #2563eb; }

.swm-pending {
  margin-top: 8px; padding: 8px 12px;
  background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 6px;
  font-size: 12px; color: #075985;
}
.swm-pending b { color: #0c4a6e; }
.swm-hold-box {
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  overflow: hidden;
}
.swm-hold-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #f0f9ff;
  border-bottom: 1px solid #bae6fd;
}
.swm-hold-head span {
  font-size: 13px;
  font-weight: 900;
  color: #075985;
}
.swm-hold-head small {
  font-size: 11px;
  font-weight: 800;
  color: #0284c7;
}
.swm-hold-list {
  display: flex;
  flex-direction: column;
}
.swm-hold-row {
  display: grid;
  grid-template-columns: 24px minmax(90px, 1fr) minmax(92px, auto) minmax(88px, auto);
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #e0f2fe;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.swm-hold-row:last-child { border-bottom: 0; }
.swm-hold-row:hover { background: #f8fafc; }
.swm-hold-no {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 11px;
  font-weight: 900;
}
.swm-hold-name b,
.swm-hold-price b {
  display: block;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.swm-hold-name small,
.swm-hold-price small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}
.swm-hold-price { text-align: right; }
.swm-hold-pnl {
  text-align: right;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.swm-hold-pnl.pnl-pos { color: #dc2626; }
.swm-hold-pnl.pnl-neg { color: #2563eb; }
.swm-hold-empty,
.swm-hold-more {
  padding: 9px 10px;
  color: #64748b;
  font-size: 12px;
}
.swm-hold-more {
  border-top: 1px solid #e0f2fe;
  background: #f8fafc;
}
.swm-card .section-meta { margin-top: 6px; padding: 0; color: #94a3b8; }

/* 모바일 — 계좌 2열, 운영 2열 */
@media (max-width: 700px) {
  .swm-grid { grid-template-columns: repeat(2, 1fr); }
  .swm-grid-ops { grid-template-columns: repeat(2, 1fr); }
  .swm-cell b { font-size: 14px; }
  .swm-cell.swm-today b { font-size: 16px; }
  .swm-budget-row { grid-template-columns: 1fr; }
  .swm-budget-main { width: 100%; }
  .swm-budget-main input { flex: 1; min-width: 0; }
  .swm-budget-row .sw-budget-presets { justify-content: stretch; }
  .swm-budget-row .sw-budget-presets button { flex: 1; height: 36px; }
  .swm-hold-row {
    grid-template-columns: 22px minmax(92px, 1fr) auto;
    grid-template-areas:
      "no name pnl"
      "no price price";
    row-gap: 2px;
  }
  .swm-hold-no { grid-area: no; }
  .swm-hold-name { grid-area: name; min-width: 0; }
  .swm-hold-price { grid-area: price; text-align: left; }
  .swm-hold-pnl { grid-area: pnl; }
  .swm-hold-name b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* 다크 모드 — 어두운 하늘 톤 */
@media (prefers-color-scheme: dark) {
  .swm-title { background: #1e293b; border-color: #075985; }
  .swm-title span { color: #e0f2fe; }
  .swm-title small { color: #7dd3fc; }
  .swm-fold { color: #93c5fd; }
  .swm-ops-bar {
    background: linear-gradient(180deg, #c2410c 0%, #9a3412 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 3px 12px rgba(0,0,0,.3);
  }
  .swm-ops-body {
    background: #1f160f;
    border-top-color: #ea580c;
    border-bottom-color: #7c2d12;
  }
  .swm-cell { background: #0c4a6e; border-color: #075985; }
  .swm-cell span { color: #7dd3fc; }
  .swm-cell b { color: #e0f2fe; }
  .swm-cell b.pnl-pos { color: #f87171; }
  .swm-cell b.pnl-neg { color: #60a5fa; }
  .swm-budget-row { background: #0c4a6e; border-color: #075985; }
  .swm-budget-main span { color: #bae6fd; }
  .swm-budget-main input { background: #0f172a; border-color: #075985; color: #e0f2fe; }
  .swm-budget-main button { background: #075985; border-color: #0ea5e9; color: #e0f2fe; }
  .swm-budget-main button:hover { background: #0369a1; }
  .swm-budget-row .sw-budget-presets button { background: #0f172a; border-color: #075985; color: #bae6fd; }
  .swm-budget-row .sw-budget-presets button:hover { background: #075985; }
  .swm-cell.swm-total { background: #075985; border-color: #0ea5e9; }
  .swm-cell.swm-total b { color: #e0f2fe; }
  .swm-cell.swm-today { background: #075985; border-color: #0ea5e9; }
  .swm-cell.swm-today b.pnl-pos { color: #f87171; }
  .swm-cell.swm-today b.pnl-neg { color: #60a5fa; }
  .swm-pending { background: #0c4a6e; border-color: #075985; color: #bae6fd; }
  .swm-pending b { color: #e0f2fe; }
  .swm-hold-box { background: #0f172a; border-color: #075985; }
  .swm-hold-head { background: #0c4a6e; border-color: #075985; }
  .swm-hold-head span { color: #e0f2fe; }
  .swm-hold-head small { color: #7dd3fc; }
  .swm-hold-row { background: #0f172a; border-color: #1e293b; }
  .swm-hold-row:hover { background: #1e293b; }
  .swm-hold-no { background: #0c4a6e; color: #bae6fd; }
  .swm-hold-name b,
  .swm-hold-price b { color: #f1f5f9; }
  .swm-hold-name small,
  .swm-hold-price small,
  .swm-hold-empty,
  .swm-hold-more { color: #94a3b8; }
  .swm-hold-pnl.pnl-pos { color: #f87171; }
  .swm-hold-pnl.pnl-neg { color: #60a5fa; }
  .swm-hold-more { background: #0c4a6e; border-color: #075985; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 23 — 스윙 보유 종목 신호 배지 (급등/거래대금/AI)
   ════════════════════════════════════════════════════════════════════ */
.sw-badges { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.sw-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px;
  white-space: nowrap;
}
.sw-b-hot   { background: #fee2e2; color: #b91c1c; }   /* 급등 */
.sw-b-drop  { background: #dbeafe; color: #1d4ed8; }   /* 급락 */
.sw-b-money { background: #fef3c7; color: #92400e; }   /* 거래대금 Top */
.sw-b-ai-hi  { background: #dcfce7; color: #15803d; }  /* AI 강세 */
.sw-b-ai-mid { background: #f1f5f9; color: #475569; }  /* AI 보통 */
.sw-b-ai-lo  { background: #f3f4f6; color: #9ca3af; }  /* AI 약세 */

@media (prefers-color-scheme: dark) {
  .sw-b-hot   { background: #450a0a; color: #fca5a5; }
  .sw-b-drop  { background: #1e3a8a; color: #bfdbfe; }
  .sw-b-money { background: #422006; color: #fde68a; }
  .sw-b-ai-hi  { background: #052e16; color: #4ade80; }
  .sw-b-ai-mid { background: #334155; color: #cbd5e1; }
  .sw-b-ai-lo  { background: #1e293b; color: #64748b; }
}

/* Phase 24 — 추천주 정보 테이블 */
.sw-rec-theme {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: #f1f5f9; color: #475569; white-space: nowrap;
}
#sw-rec-table .sw-mini-approve {
  padding: 4px 10px; font-size: 12px; font-weight: 600;
  background: #16a34a; color: #fff; border: none; border-radius: 5px; cursor: pointer;
}
@media (prefers-color-scheme: dark) {
  .sw-rec-theme { background: #334155; color: #cbd5e1; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 28 — 보유 주식 키움 앱 스타일 (요약 + 현재가/평가금 토글 카드)
   ════════════════════════════════════════════════════════════════════ */

/* 토글 버튼 */
.sw-hold-toggle { display: inline-flex; background: #f1f5f9; border-radius: 16px; padding: 2px; }
.sw-tg-btn {
  padding: 5px 14px; font-size: 13px; font-weight: 600;
  border: none; background: none; border-radius: 14px; cursor: pointer;
  color: #64748b;
}
.sw-tg-btn.on { background: #fff; color: #0f172a; box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* 상단 요약 (원금/총수익/일간수익) */
.sw-hold-summary-box {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 16px 18px; margin-bottom: 10px;
}
.sw-hold-summary-box:empty { display: none; }
.sw-hs-total {
  font-size: 28px; font-weight: 800; color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.sw-hs-total small { display: block; font-size: 11px; color: #94a3b8; font-weight: 500; margin-top: 2px; }
.sw-hs-lines { margin-top: 12px; border-top: 1px solid #f1f5f9; padding-top: 10px; }
.sw-hs-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 4px 0; font-size: 14px;
}
.sw-hs-row span { color: #64748b; }
.sw-hs-row b { color: #0f172a; font-variant-numeric: tabular-nums; }
.sw-hs-row b.pnl-pos, .sw-hs-row b.pnl-pos small { color: #dc2626; }
.sw-hs-row b.pnl-neg, .sw-hs-row b.pnl-neg small { color: #2563eb; }
.sw-hs-row small { font-size: 13px; margin-left: 2px; }

/* 종목 카드 */
.sw-hold-list { display: flex; flex-direction: column; }
.sw-hc {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 4px; border-bottom: 1px solid #f1f5f9;
}
.sw-hc:last-child { border-bottom: none; }
.sw-hc-name { font-size: 16px; font-weight: 700; color: #0f172a; }
.sw-hc-badges { font-size: 0; }
.sw-hc-leftsub { font-size: 12px; color: #94a3b8; margin-top: 3px; }
.sw-hc-r { text-align: right; }
.sw-hc-price { font-size: 16px; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
.sw-hc-sub { font-size: 13px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.sw-hc-sub.pnl-pos { color: #dc2626; }
.sw-hc-sub.pnl-neg { color: #2563eb; }

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
  .sw-hold-toggle { background: #334155; }
  .sw-tg-btn { color: #94a3b8; }
  .sw-tg-btn.on { background: #1e293b; color: #f1f5f9; }
  .sw-hold-summary-box { background: #1e293b; border-color: #334155; }
  .sw-hs-total { color: #f1f5f9; }
  .sw-hs-lines { border-color: #334155; }
  .sw-hs-row span { color: #94a3b8; }
  .sw-hs-row b { color: #f1f5f9; }
  .sw-hs-row b.pnl-pos, .sw-hs-row b.pnl-pos small { color: #f87171; }
  .sw-hs-row b.pnl-neg, .sw-hs-row b.pnl-neg small { color: #60a5fa; }
  .sw-hc { border-color: #334155; }
  .sw-hc-name, .sw-hc-price { color: #f1f5f9; }
  .sw-hc-sub.pnl-pos { color: #f87171; }
  .sw-hc-sub.pnl-neg { color: #60a5fa; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 29 — 추천주 테이블 컴팩트 (번호·코드인라인·더보기·셀축소)
   ════════════════════════════════════════════════════════════════════ */
#sw-rec-table { font-size: 12px; }
#sw-rec-table th, #sw-rec-table td {
  padding: 4px 6px; line-height: 1.3; vertical-align: middle;
}
.sw-rec-no { color: #94a3b8; font-weight: 700; width: 24px; }
.sw-rec-name b { font-size: 13px; }
.sw-rec-code { font-size: 10px; color: #94a3b8; margin-left: 4px; }
/* 승인 버튼 — 글자만, 작게 */
#sw-rec-table .sw-mini-approve {
  padding: 2px 8px; font-size: 11px; font-weight: 600;
  background: none; color: #16a34a; border: 1px solid #86efac;
  border-radius: 4px; cursor: pointer;
}
#sw-rec-table .sw-mini-approve:hover { background: #f0fdf4; }
/* 더보기 행 */
.sw-rec-more-row td { text-align: center; padding: 6px !important; }
.sw-rec-more {
  background: none; border: none; color: #2563eb; font-size: 12px;
  font-weight: 600; cursor: pointer; padding: 4px 12px;
}
.sw-rec-more:hover { text-decoration: underline; }

/* 모바일 — 더 좁게, 일부 컬럼 숨김 */
@media (max-width: 700px) {
  #sw-rec-table { font-size: 11px; }
  #sw-rec-table th, #sw-rec-table td { padding: 3px 4px; }
  /* 신뢰도·수량 컬럼 숨김 (모바일 공간 절약) — 4번째(신뢰도), 7번째(수량) */
  #sw-rec-table th:nth-child(5), #sw-rec-table td:nth-child(5),
  #sw-rec-table th:nth-child(7), #sw-rec-table td:nth-child(7) { display: none; }
}

@media (prefers-color-scheme: dark) {
  .sw-rec-code { color: #64748b; }
  #sw-rec-table .sw-mini-approve { border-color: #15803d; color: #4ade80; }
  #sw-rec-table .sw-mini-approve:hover { background: #052e16; }
  .sw-rec-more { color: #60a5fa; }
}

/* Phase 30 — 추천주 수량 입력 */
.sw-rec-qty {
  width: 52px; padding: 2px 4px; font-size: 11px; text-align: right;
  border: 1px solid #cbd5e1; border-radius: 4px;
}
@media (prefers-color-scheme: dark) {
  .sw-rec-qty { background: #0f172a; border-color: #334155; color: #f1f5f9; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 31 — 추천주 신호등 + 자동매수 + 종목 상세
   ════════════════════════════════════════════════════════════════════ */
/* 신호등 */
.sw-sig-g, .sw-sig-y, .sw-sig-w { font-size: 14px; }
.sw-th-signal { text-align: center; }
.sw-stock-link { color: #2563eb; cursor: pointer; text-decoration: underline dotted; }
.sw-stock-link:hover { color: #1d4ed8; }

/* 자동매수 바 */
.sw-auto-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 8px 12px; margin-bottom: 8px;
  background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px;
  font-size: 12px;
}
.sw-auto-toggle { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.sw-auto-toggle b { color: #15803d; }
.sw-auto-cond { color: #475569; }
.sw-auto-cond input { width: 48px; padding: 2px 4px; border: 1px solid #cbd5e1; border-radius: 4px; text-align: center; }
.sw-budget-cond input { width: 92px; text-align: right; }
.sw-budget-presets { display: flex; gap: 4px; }
.sw-budget-presets button {
  border: 1px solid #bbf7d0; background: #fff; color: #15803d;
  border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 800;
  cursor: pointer;
}
.sw-budget-presets button:hover { background: #dcfce7; }
.sw-auto-state { margin-left: auto; font-weight: 700; color: #15803d; }

/* 추천주 헤더 버튼 묶음 */
.sw-head-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* 💸 매도 엔진 */
.sw-sell-help { font-size: 11px; color: #64748b; margin-bottom: 8px; line-height: 1.5; }
.sw-sell-help b { color: #dc2626; }
.sw-sell-list { display: flex; flex-direction: column; gap: 8px; }
.sw-sell-row {
  border: 1px solid #e2e8f0; border-left-width: 4px; border-radius: 8px;
  padding: 8px 12px; background: #fff;
}
.sw-sell-row.sell-full { border-left-color: #dc2626; background: #fef2f2; }
.sw-sell-row.sell-part { border-left-color: #f59e0b; background: #fffbeb; }
.sw-sell-row.sell-hold { border-left-color: #cbd5e1; }
.sw-sell-row .ss-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sw-sell-row .ss-name { font-size: 14px; color: #0f172a; }
.sw-sell-row .ss-action {
  margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
  background: #f1f5f9; color: #475569;
}
.sell-full .ss-action { background: #fee2e2; color: #b91c1c; }
.sell-part .ss-action { background: #fef3c7; color: #92400e; }
.sw-sell-row .ss-mid {
  display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: #475569; margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.sw-sell-row .ss-score { font-weight: 700; color: #dc2626; }
.sw-sell-row .ss-peak { color: #64748b; }
.sw-sell-row .ss-reasons { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.sw-sell-reason {
  font-size: 10px; padding: 1px 7px; border-radius: 8px;
  background: #f8fafc; color: #475569; border: 1px solid #e2e8f0;
}
@media (prefers-color-scheme: dark) {
  .sw-sell-help { color: #94a3b8; }
  .sw-sell-help b { color: #f87171; }
  .sw-sell-row { background: #0f172a; border-color: #334155; }
  .sw-sell-row.sell-full { background: #450a0a; border-left-color: #f87171; }
  .sw-sell-row.sell-part { background: #422006; border-left-color: #fbbf24; }
  .sw-sell-row .ss-name { color: #f1f5f9; }
  .sw-sell-row .ss-action { background: #1e293b; color: #cbd5e1; }
  .sell-full .ss-action { background: #7f1d1d; color: #fca5a5; }
  .sell-part .ss-action { background: #78350f; color: #fcd34d; }
  .sw-sell-row .ss-mid { color: #cbd5e1; }
  .sw-sell-reason { background: #1e293b; color: #cbd5e1; border-color: #334155; }
}

/* 작전세력·과열 경고 배지 */
.sw-manip-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; white-space: nowrap; cursor: help;
  vertical-align: middle;
}
.sw-manip-badge.manip-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.sw-manip-badge.manip-warn   { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.sw-manip-badge.manip-watch  { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.sw-trend-badge {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 10px; white-space: nowrap; cursor: help; vertical-align: middle;
  background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5;
}
@media (prefers-color-scheme: dark) {
  .sw-trend-badge { background: #450a0a; color: #f87171; border-color: #b91c1c; }
}
@media (prefers-color-scheme: dark) {
  .sw-manip-badge.manip-danger { background: #450a0a; color: #fca5a5; border-color: #b91c1c; }
  .sw-manip-badge.manip-warn   { background: #422006; color: #fcd34d; border-color: #92400e; }
  .sw-manip-badge.manip-watch  { background: #1e293b; color: #cbd5e1; border-color: #334155; }
}

/* 점수 비례 자금 배분 계획 */
.sw-alloc-plan { margin-bottom: 12px; }
.sw-alloc-empty {
  font-size: 12px; color: #64748b; padding: 10px 12px;
  background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px;
}
.sw-alloc-head {
  font-size: 13px; font-weight: 700; color: #0f172a;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 6px;
}
.sw-alloc-head .sa-rule { font-size: 11px; font-weight: 500; color: #64748b; }
.sw-alloc-list {
  border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: #fff;
}
.sw-alloc-row {
  display: grid;
  grid-template-columns: minmax(70px, 1.4fr) auto 1fr auto auto auto;
  align-items: center; gap: 8px; padding: 7px 12px; font-size: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.sw-alloc-row:last-child { border-bottom: none; }
.sw-alloc-row .sa-name { font-weight: 700; color: #0f172a; }
.sw-alloc-row .sa-theme {
  font-size: 10px; color: #6366f1; background: #eef2ff;
  padding: 1px 7px; border-radius: 10px; white-space: nowrap;
}
.sw-alloc-row .sa-bar {
  height: 7px; background: #f1f5f9; border-radius: 4px; overflow: hidden; min-width: 40px;
}
.sw-alloc-row .sa-bar-fill {
  display: block; height: 100%;
  background: linear-gradient(90deg, #fca5a5, #dc2626); border-radius: 4px;
}
.sw-alloc-row .sa-pct { font-weight: 700; color: #dc2626; text-align: right; font-variant-numeric: tabular-nums; }
.sw-alloc-row .sa-krw { color: #334155; text-align: right; font-variant-numeric: tabular-nums; }
.sw-alloc-row .sa-qty { color: #0f172a; font-weight: 700; text-align: right; min-width: 44px; font-variant-numeric: tabular-nums; }
.sw-alloc-foot { font-size: 11px; color: #64748b; margin-top: 6px; line-height: 1.5; }
.sw-alloc-foot b { color: #dc2626; }

/* 종목 상세 모달 */
.sw-sd-head { padding-bottom: 10px; border-bottom: 1px solid #e2e8f0; margin-bottom: 10px; }
.sw-sd-score { font-size: 15px; }
.sw-sd-score b { font-size: 22px; color: #0f172a; }
.sw-sd-meta { font-size: 12px; color: #64748b; margin-top: 4px; }
.sw-52 { font-size: 12px; color: #475569; margin-bottom: 12px; }
.sw-52 b { color: #0f172a; }
.sw-52-bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin: 4px 0; }
.sw-52-bar div { height: 100%; background: linear-gradient(90deg, #60a5fa, #f87171); }
.sw-52 small { color: #94a3b8; }
.sw-sd-section { margin-bottom: 12px; }
.sw-sd-section h4 { margin: 0 0 6px; font-size: 13px; color: #334155; }
.sw-hth-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 5px 0; font-size: 13px; align-items: baseline; }
.sw-hth-row span { color: #64748b; }
.sw-hth-row b { font-variant-numeric: tabular-nums; }
.sw-hth-row em { font-style: normal; font-weight: 700; font-size: 11px; padding: 1px 8px; border-radius: 10px; }
.sw-hth-good em { background: #dcfce7; color: #15803d; }
.sw-hth-mid em { background: #fef3c7; color: #92400e; }
.sw-hth-bad em { background: #fee2e2; color: #b91c1c; }
.sw-kv { font-size: 13px; color: #475569; }
.sw-kv b { color: #0f172a; }
.sw-risks { font-size: 12px; padding: 8px 10px; border-radius: 6px; background: #fef2f2; color: #b91c1c; margin: 8px 0; }
.sw-risk-none { background: #f0fdf4; color: #15803d; }
.sw-sd-foot { font-size: 11px; color: #94a3b8; margin-top: 10px; padding-top: 8px; border-top: 1px solid #f1f5f9; }

@media (prefers-color-scheme: dark) {
  .sw-stock-link { color: #60a5fa; }
  .sw-auto-bar { background: #052e16; border-color: #15803d; }
  .sw-auto-toggle b, .sw-auto-state { color: #4ade80; }
  .sw-auto-cond { color: #cbd5e1; }
  .sw-auto-cond input { background: #0f172a; border-color: #334155; color: #f1f5f9; }
  .sw-budget-presets button { background: #0f172a; border-color: #166534; color: #86efac; }
  .sw-budget-presets button:hover { background: #14532d; }
  .sw-alloc-empty { background: #0f172a; border-color: #334155; color: #94a3b8; }
  .sw-alloc-head { color: #f1f5f9; }
  .sw-alloc-head .sa-rule { color: #94a3b8; }
  .sw-alloc-list { background: #0f172a; border-color: #334155; }
  .sw-alloc-row { border-color: #1e293b; }
  .sw-alloc-row .sa-name { color: #f1f5f9; }
  .sw-alloc-row .sa-theme { color: #a5b4fc; background: #312e81; }
  .sw-alloc-row .sa-bar { background: #1e293b; }
  .sw-alloc-row .sa-pct { color: #f87171; }
  .sw-alloc-row .sa-krw { color: #cbd5e1; }
  .sw-alloc-row .sa-qty { color: #f1f5f9; }
  .sw-alloc-foot { color: #94a3b8; }
  .sw-alloc-foot b { color: #f87171; }
  .sw-sd-head { border-color: #334155; }
  .sw-sd-score b { color: #f1f5f9; }
  .sw-52 b, .sw-kv b, .sw-hth-row b { color: #f1f5f9; }
  .sw-52-bar { background: #334155; }
  .sw-sd-section h4 { color: #cbd5e1; }
  .sw-risks { background: #450a0a; color: #fca5a5; }
  .sw-risk-none { background: #052e16; color: #4ade80; }
}

/* Phase 32 — 종목 상세: AI소개·자금흐름·수급 */
.sw-sd-brief {
  background: #eff6ff; border-left: 3px solid #3b82f6; border-radius: 6px;
  padding: 10px 12px; margin-bottom: 12px; font-size: 13px; color: #1e3a8a;
}
.sw-sd-brief-loading { background: #f8fafc; border-color: #cbd5e1; color: #94a3b8; }
.sw-sd-hl { margin: 6px 0 4px; padding-left: 18px; }
.sw-sd-hl li { font-size: 12px; color: #475569; margin: 2px 0; }
.sw-sd-aitag { display: block; font-size: 10px; color: #94a3b8; margin-top: 4px; }
.sw-mf-bars { display: flex; gap: 6px; align-items: flex-end; margin-top: 8px; height: 56px; }
.sw-mf-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.sw-mf-bar div { width: 70%; background: #93c5fd; border-radius: 3px 3px 0 0; }
.sw-mf-bar small { font-size: 9px; color: #94a3b8; margin-top: 3px; }
.sw-flow-row { display: grid; grid-template-columns: 60px 1fr 1fr; gap: 8px; padding: 5px 0; font-size: 12px; align-items: baseline; }
.sw-flow-row span { color: #64748b; font-weight: 700; }
.sw-flow-row b { font-variant-numeric: tabular-nums; }

@media (prefers-color-scheme: dark) {
  .sw-sd-brief { background: #1e3a8a; border-color: #3b82f6; color: #dbeafe; }
  .sw-sd-brief-loading { background: #0f172a; color: #64748b; }
  .sw-sd-hl li { color: #cbd5e1; }
  .sw-mf-bar div { background: #3b82f6; }
}

/* Phase 33 — 종목 상세 지표 해설 (52주 마커·모멘텀·도움말) */
.sw-52-bar {
  position: relative; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, #60a5fa 0%, #e2e8f0 50%, #f87171 100%);
  margin: 6px 0;
}
.sw-52-marker {
  position: absolute; top: -3px; width: 4px; height: 18px;
  background: #0f172a; border-radius: 2px; transform: translateX(-50%);
  box-shadow: 0 0 0 2px #fff;
}
.sw-52-ends { display: flex; justify-content: space-between; font-size: 10px; color: #94a3b8; }
.sw-52-ends span:nth-child(2) { color: #0f172a; font-weight: 700; }
.sw-help {
  font-size: 12px; color: #475569; margin-top: 6px;
  background: #f8fafc; padding: 6px 10px; border-radius: 6px;
}
.sw-help b { color: #0f172a; }
.sw-help small { color: #94a3b8; }
.sw-help.pnl-pos { background: #fef2f2; }
.sw-help.pnl-neg { background: #eff6ff; }

.sw-mom-row {
  display: grid; grid-template-columns: 110px 60px 1fr; gap: 8px;
  padding: 5px 0; font-size: 12px; align-items: baseline;
}
.sw-mom-row span { color: #64748b; }
.sw-mom-row b { font-variant-numeric: tabular-nums; text-align: right; }
.sw-mom-row em { font-style: normal; color: #475569; font-size: 11px; }

@media (prefers-color-scheme: dark) {
  .sw-52-bar { background: linear-gradient(90deg, #2563eb 0%, #334155 50%, #dc2626 100%); }
  .sw-52-marker { background: #f1f5f9; box-shadow: 0 0 0 2px #1e293b; }
  .sw-52-ends span:nth-child(2) { color: #f1f5f9; }
  .sw-help { background: #0f172a; color: #cbd5e1; }
  .sw-help b { color: #f1f5f9; }
  .sw-help.pnl-pos { background: #450a0a; }
  .sw-help.pnl-neg { background: #1e3a8a; }
  .sw-mom-row span, .sw-mom-row em { color: #94a3b8; }
  .sw-mom-row b { color: #f1f5f9; }
}

/* Phase 34 — 시장 현황 (주도주 거래대금/급등/거래량) */
.mkt-tabs { display: inline-flex; gap: 4px; }
.mkt-tab {
  padding: 5px 12px; font-size: 12px; font-weight: 600;
  border: 1px solid #cbd5e1; background: #fff; border-radius: 14px;
  color: #64748b; cursor: pointer;
}
.mkt-tab.on { background: #1e293b; color: #fff; border-color: #1e293b; }
.sw-mkt-list { display: flex; flex-direction: column; }
.sw-mkt-row {
  display: grid; grid-template-columns: 28px 1fr auto auto auto;
  gap: 10px; align-items: baseline;
  padding: 8px 6px; border-bottom: 1px solid #f1f5f9; font-size: 13px;
}
.sw-mkt-row:last-child { border-bottom: none; }
.mkt-rank { color: #94a3b8; font-weight: 700; text-align: center; }
.mkt-name { font-weight: 700; color: #2563eb; cursor: pointer; text-decoration: underline dotted; }
.mkt-price { color: #0f172a; font-variant-numeric: tabular-nums; }
.mkt-val { color: #475569; font-size: 12px; white-space: nowrap; }
.mkt-ai { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 10px; background: #f1f5f9; color: #475569; }
.mkt-ai-none { color: #94a3b8; }

@media (max-width: 700px) {
  .sw-mkt-row { grid-template-columns: 24px 1fr auto; gap: 6px; font-size: 12px; }
  .mkt-val { grid-column: 2; font-size: 11px; }
  .mkt-ai { grid-column: 3; }
}
@media (prefers-color-scheme: dark) {
  .mkt-tab { background: #0f172a; border-color: #334155; color: #cbd5e1; }
  .mkt-tab.on { background: #2563eb; border-color: #2563eb; }
  .sw-mkt-row { border-color: #334155; }
  .mkt-name { color: #60a5fa; }
  .mkt-price { color: #f1f5f9; }
  .mkt-val { color: #94a3b8; }
  .mkt-ai { background: #334155; color: #cbd5e1; }
}

/* Phase 35 — 시장 현황 키움식 표 + 우리 예측 */
.sw-mkt-head, .sw-mkt-row2 {
  display: grid; grid-template-columns: 28px 1.4fr 0.9fr 0.9fr 0.7fr 0.9fr 1fr;
  gap: 6px; align-items: center; padding: 6px; font-size: 12px;
}
.sw-mkt-head { font-weight: 700; color: #64748b; border-bottom: 2px solid #e2e8f0; }
.sw-mkt-head .r, .sw-mkt-row2 .r { text-align: right; }
.sw-mkt-row2 { border-bottom: 1px solid #f1f5f9; }
.sw-mkt-row2 .mkt-name { font-weight: 700; color: #2563eb; cursor: pointer; }
.sw-mkt-row2 .mkt-price { font-variant-numeric: tabular-nums; color: #0f172a; }
.sw-mkt-row2 .mkt-vol { color: #475569; font-variant-numeric: tabular-nums; }
.vt-up { color: #dc2626; font-weight: 700; }
.vt-down { color: #2563eb; font-weight: 700; }
.vt-flat { color: #94a3b8; }
/* 예측 배지 */
.mkt-pred { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; cursor: help; }
.mkt-pred-up       { background: #fee2e2; color: #b91c1c; }
.mkt-pred-up-mild  { background: #fef2f2; color: #dc2626; }
.mkt-pred-down     { background: #dbeafe; color: #1d4ed8; }
.mkt-pred-down-mild{ background: #eff6ff; color: #2563eb; }
.mkt-pred-neutral  { background: #f1f5f9; color: #64748b; }

@media (max-width: 700px) {
  .sw-mkt-head { display: none; }
  .sw-mkt-row2 {
    grid-template-columns: 24px 1fr auto;
    grid-template-areas: "rank name pred" "rank price chg";
    row-gap: 2px;
  }
  .sw-mkt-row2 .mkt-rank { grid-area: rank; }
  .sw-mkt-row2 .mkt-name { grid-area: name; }
  .sw-mkt-row2 > span:nth-child(7) { grid-area: pred; text-align: right; }
  .sw-mkt-row2 .mkt-price { grid-area: price; text-align: left !important; }
  .sw-mkt-row2 > span:nth-child(5) { grid-area: chg; text-align: right; }
  .sw-mkt-row2 > span:nth-child(4), .sw-mkt-row2 > span:nth-child(6) { display: none; }
}
@media (prefers-color-scheme: dark) {
  .sw-mkt-head { color: #94a3b8; border-color: #334155; }
  .sw-mkt-row2 { border-color: #334155; }
  .sw-mkt-row2 .mkt-name { color: #60a5fa; }
  .sw-mkt-row2 .mkt-price { color: #f1f5f9; }
  .mkt-pred-up { background: #450a0a; color: #fca5a5; }
  .mkt-pred-down { background: #1e3a8a; color: #bfdbfe; }
  .mkt-pred-neutral { background: #334155; color: #cbd5e1; }
}

/* Phase 36 — 시장 현황 색상 정정 (종목명 검정, 현재가 등락색) */
.sw-mkt-row2 .mkt-name { color: #0f172a !important; }      /* 종목명 검정 */
.sw-mkt-row2 .mkt-name:hover { color: #2563eb !important; }
.sw-mkt-row2 .mkt-price.pnl-pos { color: #dc2626 !important; }  /* 현재가 상승=빨강 */
.sw-mkt-row2 .mkt-price.pnl-neg { color: #2563eb !important; }  /* 현재가 하락=파랑 */
/* 중립 예측 — 화살표 대신 글자만, 회색 */
.mkt-pred-neutral::before { content: ''; }
@media (prefers-color-scheme: dark) {
  .sw-mkt-row2 .mkt-name { color: #e2e8f0 !important; }
  .sw-mkt-row2 .mkt-name:hover { color: #60a5fa !important; }
  .sw-mkt-row2 .mkt-price.pnl-pos { color: #f87171 !important; }
  .sw-mkt-row2 .mkt-price.pnl-neg { color: #60a5fa !important; }
}

/* Phase 37 — 시장 현황: 왼쪽 압축 + 오른쪽 오늘의 특징 */
.sw-mkt-head, .sw-mkt-row2 {
  grid-template-columns: 26px 100px 80px 64px 60px 72px 1fr !important;
}
.mkt-feat-head { color: #0284c7; font-weight: 700; }
.mkt-feats { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.mkt-feat {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 9px; white-space: nowrap;
}
.feat-hot  { background: #fee2e2; color: #b91c1c; }   /* 급등/상한 */
.feat-cold { background: #dbeafe; color: #1d4ed8; }    /* 급락 */
.feat-buy  { background: #dcfce7; color: #15803d; }    /* 외인·기관 매수 */
.feat-sell { background: #fef2f2; color: #dc2626; }    /* 매도 */
.feat-warn { background: #fef3c7; color: #92400e; }    /* 경고/개인유입 */
.feat-info { background: #f1f5f9; color: #475569; }    /* 거래량 등 */
.mkt-feat-none { font-size: 10px; color: #cbd5e1; }

/* 모바일 — 특징은 종목 아래 줄로 */
@media (max-width: 700px) {
  .sw-mkt-head { display: none; }
  .sw-mkt-row2 {
    grid-template-columns: 24px 1fr auto auto !important;
    grid-template-areas:
      "rank name price chg"
      "feats feats feats feats" !important;
    row-gap: 4px; padding: 8px 6px;
  }
  .sw-mkt-row2 .mkt-rank { grid-area: rank; }
  .sw-mkt-row2 .mkt-name { grid-area: name; }
  .sw-mkt-row2 .mkt-price { grid-area: price; }
  .sw-mkt-row2 > span:nth-child(4) { grid-area: chg; }   /* 등락률 */
  .sw-mkt-row2 > span:nth-child(5),  /* 거래량 */
  .sw-mkt-row2 > span:nth-child(6) { display: none; }     /* 예측(모바일선 특징에 통합) */
  .mkt-feats { grid-area: feats; }
}
@media (prefers-color-scheme: dark) {
  .mkt-feat-head { color: #38bdf8; }
  .feat-hot { background: #450a0a; color: #fca5a5; }
  .feat-cold { background: #1e3a8a; color: #bfdbfe; }
  .feat-buy { background: #052e16; color: #4ade80; }
  .feat-sell { background: #450a0a; color: #fca5a5; }
  .feat-warn { background: #422006; color: #fde68a; }
  .feat-info { background: #334155; color: #cbd5e1; }
}

/* Phase 39 — 시장 현황 엑셀식 라인 + 컬럼 정렬 */
.sw-mkt-head, .sw-mkt-row2 {
  grid-template-columns: 28px 110px 90px 70px 90px 78px 1fr !important;
  border-left: 1px solid #e2e8f0;
}
/* 세로 구분선 (엑셀처럼) */
.sw-mkt-row2 > span, .sw-mkt-head > span {
  border-right: 1px solid #eef2f7; padding: 6px 8px;
}
.sw-mkt-head > span { border-right-color: #cbd5e1; }
.sw-mkt-row2 { border-bottom: 1px solid #e2e8f0; }
.sw-mkt-head { border-bottom: 2px solid #94a3b8; }
/* 거래량 — 숫자 우측정렬 + 화살표 분리 */
.sw-mkt-row2 .mkt-vol { font-variant-numeric: tabular-nums; }
/* 등락률 색 명확 */
.sw-mkt-row2 > span:nth-child(4) { font-variant-numeric: tabular-nums; font-weight: 600; }

@media (prefers-color-scheme: dark) {
  .sw-mkt-head, .sw-mkt-row2 { border-left-color: #334155; }
  .sw-mkt-row2 > span, .sw-mkt-head > span { border-right-color: #1e293b; }
  .sw-mkt-head > span { border-right-color: #475569; }
  .sw-mkt-row2 { border-bottom-color: #334155; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 40 — 시장 현황 2줄 카드 + 우리 점수 (기간+오늘)
   ════════════════════════════════════════════════════════════════════ */
.sw-mkt-card {
  border-bottom: 1px solid #e2e8f0; padding: 10px 6px;
}
.sw-mkt-card:last-child { border-bottom: none; }
.smc-line1 {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px;
}
.smc-rank { color: #94a3b8; font-weight: 700; min-width: 20px; }
.smc-name { font-weight: 700; color: #0f172a; cursor: pointer; }
.smc-name:hover { color: #2563eb; }
.smc-price { font-variant-numeric: tabular-nums; font-weight: 700; }
.smc-chg { font-variant-numeric: tabular-nums; font-size: 12px; }
.smc-price.pnl-pos, .smc-chg.pnl-pos { color: #dc2626; }
.smc-price.pnl-neg, .smc-chg.pnl-neg { color: #2563eb; }
.smc-vol { font-size: 12px; color: #64748b; font-variant-numeric: tabular-nums; }
/* 우리 점수 배지 — 오른쪽 끝 */
.mkt-oscore {
  margin-left: auto; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 12px; cursor: pointer; white-space: nowrap;
}
.os-strong { background: #fee2e2; color: #b91c1c; }
.os-good   { background: #dcfce7; color: #15803d; }
.os-mid    { background: #fef3c7; color: #92400e; }
.os-weak   { background: #f1f5f9; color: #94a3b8; }
.mkt-oscore:hover { filter: brightness(0.95); }
/* 2줄: 실시간 현황 */
.smc-line2 {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  margin-top: 6px; padding-left: 30px;
}
.smc-live { font-size: 11px; color: #94a3b8; font-weight: 700; margin-right: 2px; }

/* 점수 분해 모달 */
.os-bd-head { font-size: 12px; color: #64748b; margin-bottom: 10px; }
.os-bd-sec { margin-bottom: 12px; }
.os-bd-sec h4 { margin: 0 0 6px; font-size: 13px; color: #334155; }
.os-bd-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 4px 0; font-size: 13px; align-items: baseline; }
.os-bd-row span { color: #64748b; }
.os-bd-row em { font-style: normal; color: #0f172a; font-variant-numeric: tabular-nums; }
.os-bd-row b { color: #2563eb; font-variant-numeric: tabular-nums; min-width: 50px; text-align: right; }
.os-bd-total { text-align: center; padding: 10px; background: #f8fafc; border-radius: 8px; font-size: 15px; }
.os-bd-total b { font-size: 20px; color: #0f172a; }

@media (max-width: 700px) {
  .smc-line1 { gap: 6px; }
  .smc-vol { width: 100%; order: 5; padding-left: 30px; }
  .mkt-oscore { order: 4; }
  .smc-line2 { padding-left: 0; }
}
@media (prefers-color-scheme: dark) {
  .sw-mkt-card { border-color: #334155; }
  .smc-name { color: #f1f5f9; }
  .smc-price.pnl-pos, .smc-chg.pnl-pos { color: #f87171; }
  .smc-price.pnl-neg, .smc-chg.pnl-neg { color: #60a5fa; }
  .smc-vol { color: #94a3b8; }
  .os-strong { background: #450a0a; color: #fca5a5; }
  .os-good { background: #052e16; color: #4ade80; }
  .os-mid { background: #422006; color: #fde68a; }
  .os-weak { background: #334155; color: #94a3b8; }
  .os-bd-sec h4 { color: #cbd5e1; }
  .os-bd-row em { color: #f1f5f9; }
  .os-bd-row b { color: #60a5fa; }
  .os-bd-total { background: #0f172a; }
  .os-bd-total b { color: #f1f5f9; }
}

/* ════════════════════════════════════════════════════════════════════
   안 2 — 스윙 시장현황 풀폭 카드 (S25 Ultra 모바일 최적화)
   ════════════════════════════════════════════════════════════════════ */
.sw-mkt2-list { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.sw-mkt2-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 14px 15px; box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
  transition: box-shadow .12s, transform .08s;
}
.sw-mkt2-card:active { transform: scale(0.995); box-shadow: 0 2px 8px rgba(15, 23, 42, .08); }
.sm2-hidden { display: none; }

/* 헤더 한 줄: 카테고리 칩 + 순위 + 점수 */
.sm2-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sm2-cat {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 6px;
  letter-spacing: .02em; white-space: nowrap;
}
.sm2-cat-money { color: #2563eb; background: #eff6ff; }
.sm2-cat-hot   { color: #dc2626; background: #fef2f2; }
.sm2-cat-vol   { color: #7c3aed; background: #faf5ff; }
.sm2-rank { font-size: 11px; color: #94a3b8; font-weight: 600; }
.sm2-score {
  margin-left: auto; padding: 3px 10px; border-radius: 6px;
  font-weight: 800; font-size: 12px; cursor: pointer;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.sm2-score-strong { background: #fee2e2; color: #b91c1c; }
.sm2-score-good   { background: #dcfce7; color: #15803d; }
.sm2-score-mid    { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
.sm2-score-weak   { background: #f1f5f9; color: #94a3b8; }
.sm2-score:hover { filter: brightness(0.96); }

/* 종목명 — 크게 (S25 Ultra 글씨 시원하게) */
.sm2-name {
  font-size: 19px; font-weight: 800; color: #0f172a; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
.sm2-name:hover { color: #2563eb; }

/* 가격 + 변동 줄 */
.sm2-pricerow { display: flex; align-items: baseline; gap: 12px; margin-top: 4px; }
.sm2-price { font-size: 17px; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
.sm2-chg { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sm2-chg.pnl-pos { color: #dc2626; }
.sm2-chg.pnl-neg { color: #2563eb; }

/* 시장현황 — 한 줄 압축 행 (번호·종목명·등락률·점수). 가격·태그 등은 자세히보기. */
.sw-mkt2-row {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 9px 14px; cursor: pointer; transition: background .1s;
}
.sw-mkt2-row:hover { background: #f8fafc; }
.sw-mkt2-row:active { transform: scale(0.997); }
.smr-rank {
  font-size: 12px; font-weight: 500; color: #94a3b8; flex: 0 0 auto;
  min-width: 22px; text-align: center; font-variant-numeric: tabular-nums;
}
.smr-name {
  font-size: 15px; font-weight: 500; color: #0f172a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1 1 auto; min-width: 0;
}
.sw-mkt2-row:hover .smr-name { color: #2563eb; }
.smr-price {
  font-size: 14px; font-weight: 400; color: #0f172a; flex: 0 0 auto;
  text-align: right; min-width: 96px; font-variant-numeric: tabular-nums;
}
.sw-mkt2-row .sm2-chg {
  font-size: 14px; font-weight: 400; flex: 0 0 auto;
  text-align: right; font-variant-numeric: tabular-nums;
}
.smr-chgamt { min-width: 80px; }
.smr-chgrate { min-width: 72px; }
.sw-mkt2-row .sm2-score { margin-left: 0; flex: 0 0 auto; }

/* 수익매매 모드 선택 — 수동 / 오토 / 정지 (상단 날짜 옆) */
.sw-mode { display: inline-flex; margin-left: auto; align-self: center; vertical-align: middle;
  border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.sw-mode-btn { border: none; border-left: 1px solid #e2e8f0; background: #fff;
  color: #64748b; font-size: 12px; font-weight: 700; padding: 5px 11px;
  cursor: pointer; line-height: 1.2; white-space: nowrap; }
.sw-mode-btn:first-child { border-left: none; }
.sw-mode-btn:hover { background: #f1f5f9; }
.sw-mode-btn.on { color: #fff; }
.sw-mode-btn[data-mode="manual"].on { background: #2563eb; }
.sw-mode-btn[data-mode="auto"].on { background: #16a34a; }
.sw-mode-btn[data-mode="off"].on { background: #dc2626; }

/* 추천주 표 — 현재가 '원' 줄바꿈 방지 */
.sw-rec-price { white-space: nowrap; }

/* 메타 태그들 */
.sm2-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.sm2-tag {
  background: #f1f5f9; color: #475569;
  padding: 3px 8px; border-radius: 5px; font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.sm2-tag-money { background: #eff6ff; color: #2563eb; font-weight: 700; }
.sm2-tag-hot   { background: #fef2f2; color: #dc2626; }
.sm2-tag-cold  { background: #eff6ff; color: #2563eb; }
.sm2-tag-buy   { background: #ecfdf5; color: #059669; }
.sm2-tag-sell  { background: #fef2f2; color: #b91c1c; }
.sm2-tag-warn  { background: #fff7ed; color: #c2410c; }
.sm2-tag-info  { background: #f5f3ff; color: #6d28d9; }

/* 더 보기 버튼 */
.sw-mkt2-more {
  width: 100%; margin-top: 10px; padding: 12px;
  background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px;
  color: #475569; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .12s;
}
.sw-mkt2-more:active { background: #e2e8f0; }
.sw-mkt2-more:hover { background: #f1f5f9; }

@media (prefers-color-scheme: dark) {
  .sw-mkt2-card { background: #1e293b; border-color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
  .sw-mkt2-row { background: #1e293b; border-color: #334155; }
  .sw-mkt2-row:hover { background: #334155; }
  .sw-mkt2-row .smr-name { color: #f1f5f9; }
  .sw-mode { border-color: #475569; }
  .sw-mode-btn { background: #1e293b; border-color: #475569; color: #94a3b8; }
  .sw-mode-btn:hover { background: #334155; }
  .sw-mkt2-row .smr-price { color: #f1f5f9; }
  .sm2-name { color: #f1f5f9; }
  .sm2-price { color: #f1f5f9; }
  .sm2-chg.pnl-pos { color: #f87171; }
  .sm2-chg.pnl-neg { color: #60a5fa; }
  .sm2-cat-money { color: #93c5fd; background: #1e3a8a; }
  .sm2-cat-hot   { color: #fca5a5; background: #450a0a; }
  .sm2-cat-vol   { color: #c4b5fd; background: #3b0764; }
  .sm2-tag { background: #334155; color: #cbd5e1; }
  .sm2-tag-money { background: #1e3a8a; color: #93c5fd; }
  .sm2-tag-hot   { background: #450a0a; color: #fca5a5; }
  .sm2-tag-cold  { background: #1e3a8a; color: #93c5fd; }
  .sm2-tag-buy   { background: #052e16; color: #4ade80; }
  .sm2-tag-sell  { background: #450a0a; color: #fca5a5; }
  .sm2-tag-warn  { background: #422006; color: #fde68a; }
  .sm2-tag-info  { background: #2e1065; color: #c4b5fd; }
  .sm2-score-strong { background: #450a0a; color: #fca5a5; }
  .sm2-score-good   { background: #052e16; color: #4ade80; }
  .sm2-score-mid    { background: #422006; color: #fde68a; }
  .sm2-score-weak   { background: #334155; color: #94a3b8; }
  .sw-mkt2-more { background: #1e293b; border-color: #475569; color: #cbd5e1; }
  .sw-mkt2-more:active { background: #334155; }
}

/* Phase 41 — 추천주 엔진 종합점수·판정 */
.rec-score { font-weight: 700; padding: 2px 8px; border-radius: 10px; cursor: pointer; font-size: 12px; }
.rec-score-loading { color: #94a3b8; font-size: 11px; }
.rec-judge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.judge-auto { background: #fee2e2; color: #b91c1c; }
.judge-manual { background: #dcfce7; color: #15803d; }
.judge-hold { background: #f1f5f9; color: #94a3b8; }
.judge-block { background: #1e293b; color: #fca5a5; }
@media (prefers-color-scheme: dark) {
  .judge-auto { background: #450a0a; color: #fca5a5; }
  .judge-manual { background: #052e16; color: #4ade80; }
  .judge-hold { background: #334155; color: #cbd5e1; }
}

/* Phase 42 — 자동매수 실행 버튼 */
.sw-auto-runbtn {
  padding: 4px 12px; font-size: 12px; font-weight: 700;
  background: #16a34a; color: #fff; border: none; border-radius: 6px; cursor: pointer;
}
.sw-auto-runbtn:hover { background: #15803d; }
.sw-auto-runbtn:disabled { opacity: .6; cursor: wait; }

/* ═══ 미니멀 대시보드 (재구축) ═══ */
/* 오늘 총손익 — 키움 총자산과 같은 접이식 바 */
.todaypnl {
  margin: 0;
  background: #fff;
  border-bottom: 1px solid #cbded9;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .1);
}
.kw-acct + script + .todaypnl,
.kw-acct + .todaypnl {
  margin-top: 0 !important;
}
.tp-bar {
  margin: 0;
  width: 100%; max-width: 100%; display: flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 11px 16px; border: none; cursor: pointer; font: inherit;
  background: linear-gradient(180deg, #14a89b 0%, #0f766e 100%); color: #fff;
  border-bottom: 1px solid #0b5f59;
  -webkit-tap-highlight-color: transparent; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32);
}
.tp-bar:active { background: linear-gradient(180deg, #0f8f84 0%, #0d665f 100%); }
.tp-label { font-size: 13px; font-weight: 800; color: #e6fffb; white-space: nowrap; }
.tp-total {
  margin-left: auto; font-size: 18px; font-weight: 900;
  font-variant-numeric: tabular-nums; color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tp-total.pnl-pos { color: #ffd7d7; }
.tp-total.pnl-neg { color: #d9ebff; }
.tp-caret { font-size: 13px; color: #d8fffb; padding-left: 4px; flex: none; }
.tp-body {
  background: #eef7f5;
  border-top: 3px solid #0f766e;
  border-bottom: 1px solid #cbded9;
  padding: 8px 14px 10px;
}
.tp-body[hidden] { display: none !important; }
.tp-row {
  display: grid; grid-template-columns: minmax(72px, .9fr) minmax(96px, 1fr) minmax(84px, auto);
  align-items: center; gap: 10px;
  padding: 8px 2px; border-bottom: 1px dotted #c9ded9; font-size: 13px;
}
.tp-row:last-child { border-bottom: none; }
.tp-row span { color: #31524e; font-weight: 800; }
.tp-row small { color: #64748b; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tp-row b { color: #334155; font-weight: 900; font-variant-numeric: tabular-nums; }
.tp-row b.pnl-pos { color: #dc2626; }
.tp-row b.pnl-neg { color: #2563eb; }
.dantafund {
  margin: 0;
  background: #fff;
  border-bottom: 1px solid #c9d7f0;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .1);
}
.swingfund {
  margin: 0;
  background: #fff;
  border-bottom: 1px solid #fed7aa;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .1);
}
.dtf-bar {
  margin: 0;
  width: 100%; max-width: 100%; display: flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 11px 16px; border: none; cursor: pointer; font: inherit;
  background: linear-gradient(180deg, #16a34a 0%, #047857 100%); color: #fff;
  border-bottom: 1px solid #065f46;
  -webkit-tap-highlight-color: transparent; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32);
}
.swf-bar {
  margin: 0;
  width: 100%; max-width: 100%; display: flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 11px 16px; border: none; cursor: pointer; font: inherit;
  background: #1e293b; color: #f1f5f9;
  border-bottom: 1px solid #0f172a; border-left: 5px solid #f97316;
  -webkit-tap-highlight-color: transparent; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 3px 10px rgba(15,23,42,.18);
}
/* 통일 아이콘 배지 (전략카드 배지와 동일 톤) */
.swf-badge {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #7c2d12; color: #fdba74; font-size: 11px; font-weight: 900;
}
.dtf-bar:active,
.dtf-bar[aria-expanded="true"] {
  filter: saturate(1.08) brightness(.96);
}
.swf-bar:active,
.swf-bar[aria-expanded="true"] {
  filter: saturate(1.08) brightness(.96);
}
.dtf-label { font-size: 13px; font-weight: 900; color: #ecfdf5; white-space: nowrap; }
.swf-label { font-size: 13px; font-weight: 900; color: #fff7ed; white-space: nowrap; }
.dtf-sub {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; font-weight: 800; color: rgba(255,255,255,.76);
}
.swf-sub {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; font-weight: 800; color: rgba(255,255,255,.78);
}
.dtf-total {
  margin-left: auto; font-size: 18px; font-weight: 950;
  font-variant-numeric: tabular-nums; color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.swf-total {
  margin-left: auto; font-size: 18px; font-weight: 950;
  font-variant-numeric: tabular-nums; color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dtf-caret { font-size: 13px; color: #d1fae5; padding-left: 4px; flex: none; }
.swf-caret { font-size: 13px; color: #ffedd5; padding-left: 4px; flex: none; }
.dtf-body {
  background: #ecfdf5;
  border-top: 3px solid #059669;
  border-bottom: 1px solid #bbf7d0;
  padding: 8px 14px 10px;
}
.dtf-body[hidden] { display: none !important; }
.swf-body {
  background: #fff7ed;
  border-top: 3px solid #f97316;
  border-bottom: 1px solid #fed7aa;
  padding: 8px 14px 10px;
}
.swf-body[hidden] { display: none !important; }
.swf-budget-edit {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 7px 2px 9px;
  border-bottom: 1px dotted #fed7aa;
}
.swf-budget-edit span {
  color: #9a3412;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}
.swf-budget-edit input {
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #fdba74;
  border-radius: 7px;
  background: #fff;
  color: #7c2d12;
  text-align: right;
  font-size: 16px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}
.swf-budget-edit button,
.swf-presets button {
  min-height: 32px;
  border: 1px solid #fb923c;
  border-radius: 7px;
  background: #ffedd5;
  color: #9a3412;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}
.swf-budget-edit button { padding: 0 12px; }
.swf-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 2px;
  border-bottom: 1px dotted #fed7aa;
}
.swf-presets button:active,
.swf-budget-edit button:active {
  background: #fed7aa;
}
.dtf-row {
  display: grid; grid-template-columns: minmax(90px, 1fr) minmax(104px, auto);
  align-items: center; gap: 10px;
  padding: 8px 2px; border-bottom: 1px dotted #bbf7d0; font-size: 13px;
}
.dtf-row:last-child { border-bottom: none; }
.dtf-row span { color: #065f46; font-weight: 900; }
.dtf-row b { color: #0f172a; font-weight: 950; font-variant-numeric: tabular-nums; text-align: right; }
.dtf-row b.pnl-pos { color: #dc2626; }
.dtf-row b.pnl-neg { color: #2563eb; }
.swf-row {
  display: grid; grid-template-columns: minmax(90px, 1fr) minmax(104px, auto);
  align-items: center; gap: 10px;
  padding: 8px 2px; border-bottom: 1px dotted #fed7aa; font-size: 13px;
}
.swf-row:last-child { border-bottom: none; }
.swf-row span { color: #9a3412; font-weight: 900; }
.swf-row b { color: #0f172a; font-weight: 950; font-variant-numeric: tabular-nums; text-align: right; }
.swf-row b.pnl-pos { color: #dc2626; }
.swf-row b.pnl-neg { color: #2563eb; }
.swf-limit-box {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #fdba74;
  border-radius: 8px;
  background: #fff;
}
.swf-limit-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.swf-limit-title b {
  color: #7c2d12;
  font-size: 13px;
  font-weight: 950;
}
.swf-limit-title small {
  min-width: 0;
  color: #9a3412;
  font-size: 10.5px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.swf-fund-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
}
.swf-fund-actions input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #fdba74;
  border-radius: 7px;
  background: #fff7ed;
  color: #7c2d12;
  text-align: right;
  font-size: 13px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}
.swf-fund-actions button {
  min-height: 34px;
  border: 1px solid #fb923c;
  border-radius: 7px;
  background: #ffedd5;
  color: #9a3412;
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
  white-space: nowrap;
}
.swf-fund-actions button.primary {
  background: #fb8c24;
  border-color: #ea580c;
  color: #fff;
}
.swf-fund-actions small {
  grid-column: 1 / -1;
  min-width: 0;
  color: #9a3412;
  font-size: 10.5px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.swf-limit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.swf-limit-grid label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.swf-limit-grid span {
  color: #9a3412;
  font-size: 10.5px;
  font-weight: 900;
}
.swf-limit-grid input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 7px;
  border: 1px solid #fdba74;
  border-radius: 7px;
  background: #fff7ed;
  color: #7c2d12;
  text-align: right;
  font-size: 13px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}
.swf-limit-save {
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  border: 1px solid #ea580c;
  border-radius: 7px;
  background: #fb8c24;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}
.swf-limit-save:active { background: #ea580c; }
@media (max-width: 520px) {
  .swf-limit-title {
    flex-direction: column;
    gap: 2px;
  }
  .swf-limit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .swf-fund-actions {
    grid-template-columns: minmax(0, 1fr) repeat(3, auto);
    gap: 4px;
  }
  .swf-fund-actions button {
    padding: 0 7px;
    font-size: 10px;
  }
}
@media (prefers-color-scheme: dark) {
  .todaypnl {
    background: #101923;
    border-bottom-color: #334155;
    box-shadow: 0 3px 12px rgba(0,0,0,.3);
  }
  .tp-bar { background: linear-gradient(180deg, #12877e 0%, #0d5f59 100%); border-bottom-color: #134e4a; }
  .tp-label { color: #ccfbf1; }
  .tp-body { background: #10201f; border-top-color: #0f766e; border-bottom-color: #334155; }
  .tp-row { border-bottom-color: #334155; }
  .tp-row span { color: #99f6e4; }
  .tp-row small { color: #94a3b8; }
  .tp-row b { color: #f1f5f9; }
  .tp-row b.pnl-pos { color: #f87171; }
  .tp-row b.pnl-neg { color: #60a5fa; }
  .dantafund {
    background: #101923;
    border-bottom-color: #334155;
    box-shadow: 0 3px 12px rgba(0,0,0,.3);
  }
  .dtf-bar { background: linear-gradient(180deg, #15803d 0%, #065f46 100%); border-bottom-color: #047857; }
  .dtf-body { background: #0f241b; border-top-color: #059669; border-bottom-color: #334155; }
  .dtf-row { border-bottom-color: #334155; }
  .dtf-row span { color: #bbf7d0; }
  .dtf-row b { color: #f8fafc; }
  .dtf-row b.pnl-pos { color: #f87171; }
  .dtf-row b.pnl-neg { color: #60a5fa; }
  .swingfund {
    background: #101923;
    border-bottom-color: #334155;
    box-shadow: 0 3px 12px rgba(0,0,0,.3);
  }
  .swf-bar { background: #1e293b; border-bottom-color: #0f172a; border-left: 5px solid #f97316; }
  .swf-body { background: #1f160f; border-top-color: #ea580c; border-bottom-color: #334155; }
  .swf-budget-edit,
  .swf-presets,
  .swf-row { border-bottom-color: #7c2d12; }
  .swf-budget-edit span,
  .swf-row span { color: #fed7aa; }
  .swf-budget-edit input { background: #0f172a; border-color: #9a3412; color: #fff7ed; }
  .swf-budget-edit button,
  .swf-presets button { background: #2a170d; border-color: #9a3412; color: #fed7aa; }
  .swf-budget-edit button:active,
  .swf-presets button:active { background: #7c2d12; }
  .swf-row b { color: #f8fafc; }
  .swf-row b.pnl-pos { color: #f87171; }
  .swf-row b.pnl-neg { color: #60a5fa; }
  .swf-limit-box { background: #15100d; border-color: #9a3412; }
  .swf-limit-title b,
  .swf-limit-grid span { color: #fed7aa; }
  .swf-limit-title small { color: #fdba74; }
  .swf-limit-grid input { background: #0f172a; border-color: #9a3412; color: #fff7ed; }
  .swf-limit-save { background: #c2410c; border-color: #ea580c; }
  .swf-fund-actions input { background: #0f172a; border-color: #9a3412; color: #fff7ed; }
  .swf-fund-actions button { background: #2a170d; border-color: #9a3412; color: #fed7aa; }
  .swf-fund-actions button.primary { background: #c2410c; border-color: #ea580c; color: #fff; }
  .swf-fund-actions small { color: #fdba74; }
}
.daybar {
  width: 100vw;
  margin: 0 calc(50% - 50vw);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: nowrap;
  padding: 16px 18px 15px;
  font-size: 14px;
  color: #475569;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.db-clock {
  flex: 0 0 auto;
  min-width: 132px;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  color: #020617;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
}
.db-date {
  flex: 0 0 auto;
  font-weight: 850;
  color: #334155;
  font-size: 17px;
  white-space: nowrap;
}
.db-dot { flex: 0 0 auto; font-size: 14px; }
.db-market {
  min-width: 0;
  font-weight: 900;
  color: #0f766e;
  font-size: 17px;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .daybar {
    gap: 8px;
    padding: 14px 14px 13px;
  }
  .db-clock {
    min-width: 118px;
    font-size: 29px;
  }
  .db-date,
  .db-market {
    font-size: 14px;
  }
  .db-dot { font-size: 12px; }
}

.home-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100vw;
  margin: 10px calc(50% - 50vw) 12px;
  padding: 0 14px;
}
.home-quick-btn {
  min-width: 0;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  -webkit-tap-highlight-color: transparent;
}
.home-quick-btn:hover { text-decoration: none; border-color: #94a3b8; }
.home-quick-btn:active { transform: translateY(1px); }
.home-quick-btn b {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.15;
}
.home-quick-btn small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}
.home-quick-btn.hq-danta { border-left: 4px solid #16a34a; }
.home-quick-btn.hq-swing { border-left: 4px solid #0f766e; }
.home-quick-btn.hq-portfolio { border-left: 4px solid #f97316; }
.home-quick-btn.hq-agents { border-left: 4px solid #6366f1; }
@media (prefers-color-scheme: dark) {
  .home-quick-btn {
    background: #111827;
    border-color: #334155;
    color: #f8fafc;
    box-shadow: none;
  }
  .home-quick-btn:hover { border-color: #64748b; }
  .home-quick-btn small { color: #94a3b8; }
}
@media (max-width: 760px) {
  .home-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 8px;
    margin-bottom: 10px;
  }
  .home-quick-btn {
    min-height: 54px;
    padding: 9px 10px;
    border-radius: 9px;
  }
  .home-quick-btn b { font-size: 13.5px; }
  .home-quick-btn small { font-size: 10.5px; }
}
@media (max-width: 340px) {
  .home-quick { grid-template-columns: 1fr; }
}

.sa-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100vw;
  margin: 4px calc(50% - 50vw) 14px;
}
.sa {
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}
.sa + .sa {
  border-top: 1px solid rgba(255,255,255,.22);
}
.sa-bar {
  width: 100%; max-width: 100%; display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 12px 16px; border: none; cursor: pointer; font: inherit;
  background: linear-gradient(180deg, #ffffff 0%, #f2f6fa 100%);
  border-bottom: 1px solid rgba(15,23,42,.18);
  -webkit-tap-highlight-color: transparent; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 2px 8px rgba(15,23,42,.08);
}
.sa-bar:active { background: linear-gradient(180deg, #edf3f8 0%, #e7eef5 100%); }
.sa-bar[aria-expanded="true"] { background: linear-gradient(180deg, #f9fbfd 0%, #edf3f8 100%); }
.sa-bar[data-sa="danta"] {
  background: linear-gradient(180deg, #16a34a 0%, #047857 100%);
  border-bottom-color: #065f46;
}
.sa-bar[data-sa="swing"] {
  background: linear-gradient(180deg, #fb8c24 0%, #ea580c 100%);
  border-bottom-color: #c2410c;
}
.sa-bar[data-sa="pf"] {
  background: linear-gradient(180deg, #8b5cf6 0%, #6d28d9 100%);
  border-bottom-color: #5b21b6;
}
.sa-bar[data-sa="system"] {
  background: linear-gradient(180deg, #d99a0b 0%, #a16207 100%);
  border-bottom-color: #854d0e;
}
.sa-bar[data-sa="hot"] {
  background: linear-gradient(180deg, #e11d48 0%, #be123c 100%);
  border-bottom-color: #9f1239;
}
.sa-bar[data-sa]:active,
.sa-bar[data-sa][aria-expanded="true"] {
  filter: saturate(1.08) brightness(.97);
}
.sa-name { font-size: 15px; font-weight: 800; color: #0f172a; flex: none; }
.sa-sub { font-size: 11px; color: #64748b; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.sa-pnl { margin-left: auto; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; flex: none; white-space: nowrap; }
.sa-pnl-stack {
  display: inline-flex; flex-direction: column; align-items: flex-end; justify-content: center;
  gap: 1px; line-height: 1.05;
}
.sa-pnl-amt { display: block; }
.sa-action-note {
  display: block; max-width: 122px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: rgba(255,255,255,.82); font-size: 10.5px; font-weight: 850; letter-spacing: 0;
}
.sa-action-note.on { color: #dcfce7; }
.sa-action-note.off { color: rgba(255,255,255,.72); }
.sa-action-note.busy { color: #fef3c7; }
.sa-action-note.stop,
.sa-action-note.error { color: #fecaca; }
.sa-action-note.holiday { color: #fde68a; }
.sa-state { margin-left: auto; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; flex: none; color: #334155; white-space: nowrap; }
.sa-caret { color: #64748b; font-size: 13px; flex: none; }
.sa-bar[data-sa] .sa-name,
.sa-bar[data-sa] .sa-pnl,
.sa-bar[data-sa] .sa-state,
.sa-bar[data-sa] .sa-caret { color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.2); }
.sa-bar[data-sa] .sa-sub { color: rgba(255,255,255,.76); }
.sa-bar[data-sa] .sa-pnl.pnl-pos { color: #ffd2d2; }
.sa-bar[data-sa] .sa-pnl.pnl-neg { color: #d7e8ff; }
.sa-body { padding: 8px 16px 12px; border-top: 1px solid #edf2f7; background: #f8fafc; }
.sa-bar[data-sa="danta"] + .sa-body {
  background: linear-gradient(180deg, #ecfdf5 0%, #f6fff9 100%);
  border-top-color: #86efac;
}
.sa-empty { font-size: 12px; color: #94a3b8; text-align: center; padding: 10px; }
/* 회차 행 (단타 1/2/3차) */
.rr { display: flex; align-items: center; gap: 8px; padding: 11px 8px;
  border-bottom: 1px dotted #e2e8f0; text-decoration: none; color: inherit;
  -webkit-tap-highlight-color: transparent; }
.rr:active { background: #eef2f7; }
.rr-action-row { padding: 0; gap: 0; }
.rr-main {
  min-width: 0; flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 11px 8px; color: inherit; text-decoration: none;
}
.rr-edit {
  flex: none; width: 38px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center;
  color: #065f46; text-decoration: none; font-size: 18px; font-weight: 950;
  border-left: 1px dotted #bbf7d0; background: rgba(255,255,255,.52);
}
.rr-edit:active { background: #d1fae5; }
.rr-no { font-weight: 800; color: #0f172a; font-size: 14px; flex: none; width: 34px; }
.rr-st { font-size: 11px; color: #475569; flex: none; }
.rr-st.rr-approved {
  padding: 3px 7px; border-radius: 999px; background: #dcfce7; color: #15803d;
  font-weight: 950;
}
.rr-st.rr-stopped {
  padding: 3px 7px; border-radius: 999px; background: #fee2e2; color: #b91c1c;
  font-weight: 950;
}
.rr-st.rr-holiday {
  padding: 3px 7px; border-radius: 999px; background: #fef3c7; color: #92400e;
  font-weight: 950;
}
.rr-st.rr-active {
  padding: 3px 7px; border-radius: 999px; background: #fee2e2; color: #dc2626;
  font-weight: 950;
}
.rr-time { font-size: 11px; color: #94a3b8; flex: none; }
.rr-trade { font-size: 11px; color: #64748b; margin-left: auto; flex: none; }
.rr-pnl { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; flex: none; min-width: 78px; text-align: right; }
.rr-go { color: #94a3b8; flex: none; }
.dash-danta-actions {
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap;
  padding: 10px 2px 2px; border-top: 1px solid #bbf7d0;
}
.dda-btn {
  flex: 1 1 0; min-width: 0; min-height: 32px; display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 10px; border: 1px solid #86efac; border-radius: 7px;
  background: #fff; color: #065f46; text-decoration: none; cursor: pointer;
  font-size: 12px; font-weight: 900; font-family: inherit;
  white-space: nowrap;
}
.dda-btn:active { background: #dcfce7; }
.dda-btn:disabled { opacity: .55; cursor: wait; }
.dda-ok { background: #16a34a; border-color: #15803d; color: #fff; }
.dda-stop { background: #ef4444; border-color: #dc2626; color: #fff; }
.dda-auto-on { background: #0f766e; border-color: #0f766e; color: #fff; }
.dda-auto-off { background: #fff; border-color: #86efac; color: #065f46; }
.dda-msg {
  margin-left: auto; color: #64748b; font-size: 11px; font-weight: 800;
  min-width: 72px; text-align: right;
}
@media (max-width: 520px) {
  .sa-bar { gap: 7px; padding-left: 10px; padding-right: 10px; }
  .sa-name { font-size: 14px; }
  .sa-sub { font-size: 10px; }
  .sa-pnl { font-size: 14px; }
  .sa-action-note { max-width: 96px; font-size: 9.5px; }
  .dash-danta-actions { gap: 4px; padding-top: 8px; }
  .dda-btn { min-height: 31px; padding: 6px 5px; border-radius: 6px; font-size: 11px; }
}
/* 스윙/PF 상세 키밸류 */
.kv2 { display: flex; justify-content: space-between; padding: 7px 6px;
  border-bottom: 1px dotted #e2e8f0; font-size: 13px; }
.kv2 span { color: #64748b; }
.kv2 b { color: #0f172a; font-variant-numeric: tabular-nums; }
/* 현재까지 수익 — 강조 행 */
.kv2-strong { padding: 9px 8px; margin-bottom: 2px; border-radius: 8px;
  border-bottom: none; background: #f1f5f9; font-size: 14px; }
.kv2-strong span { color: #334155; font-weight: 700; }
.kv2-strong b { font-weight: 800; }
/* 손익 색은 한국식(상승 빨강·하락 파랑) — 다크모드 .kv2 b 보다 우선 */
.kv2 b.pnl-pos { color: #dc2626; }
.kv2 b.pnl-neg { color: #2563eb; }
.sa-more { display: block; text-align: center; padding: 10px; margin-top: 6px;
  font-size: 13px; font-weight: 700; color: #2563eb; }

/* 시스템 점검 */
.sys-ok { color: #16a34a; } .sys-warn { color: #d97706; }
.sys-ok-line { color: #16a34a; font-weight: 600; }
.sys-issue { padding: 5px 0; color: #b45309; }
.sys-meta { margin-top: 8px; font-size: 11px; color: #94a3b8; }

/* 핫 종목 */
.hot-ts { margin-left: auto; font-size: 11px; color: #94a3b8; font-weight: 500; }
.hot-body { padding: 8px 12px 12px; }
.sa-bar[data-sa="hot"] + .sa-body {
  background: linear-gradient(180deg, #fff1f2 0%, #fff7f8 100%);
  border-top-color: #fb7185;
}
.hot-market-strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  margin: 2px 0 8px;
}
.hot-index {
  min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 9px; border: 1px solid #fecdd3; background: #fff; border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}
.hot-index em { font-style: normal; font-size: 11px; font-weight: 900; color: #7f1d1d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-index b { font-size: 12px; font-weight: 950; color: #64748b; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hot-index.pnl-pos b { color: #dc2626; }
.hot-index.pnl-neg b { color: #2563eb; }
.hot-sub { display: flex; justify-content: space-between; gap: 8px;
  font-size: 11px; color: #7f1d1d; margin: 4px 2px 6px; font-weight: 900; }
.hot-sub span { color: #94a3b8; font-weight: 800; }
.hot-row {
  display: grid; grid-template-columns: 24px minmax(88px, 1fr) minmax(62px, auto) minmax(46px, auto) minmax(56px, auto);
  align-items: center; gap: 7px; padding: 8px 6px;
  border-bottom: 1px dotted #fecdd3; font-size: 13px;
}
.hot-rk { text-align: center; font-weight: 900; color: #be123c; }
.hot-nm { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.hot-nm b { font-size: 13px; font-weight: 900; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-nm small { font-size: 10px; color: #94a3b8; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-pr, .hot-chg, .hot-val { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.hot-pr { font-size: 12px; color: #64748b; }
.hot-chg { font-size: 12px; color: #94a3b8; font-weight: 900; }
.hot-chg.pnl-pos { color: #dc2626; }
.hot-chg.pnl-neg { color: #2563eb; }
.hot-val { color: #be123c; font-weight: 950; }
.hot-mode-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 9px;
  scrollbar-width: none;
}
.hot-mode-tabs::-webkit-scrollbar { display: none; }
.hot-tab {
  flex: 0 0 auto; border: 1px solid #fecdd3; border-radius: 8px;
  background: #fff; color: #7f1d1d; padding: 7px 12px;
  font-size: 12px; font-weight: 900;
}
.hot-tab.on {
  background: #1e293b; border-color: #1e293b; color: #fff;
  box-shadow: 0 2px 8px rgba(15,23,42,.14);
}
.hot-rank-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 2px 7px; color: #64748b; font-size: 12px; font-weight: 800;
}
.hot-rank-head b { color: #0f172a; font-size: 13px; }
.hot-rank-list { display: flex; flex-direction: column; background: #fff; border-radius: 8px; overflow: hidden; }
.hot-rank-row {
  display: grid;
  grid-template-columns: 18px 24px 34px minmax(96px, 1fr) minmax(70px, auto) minmax(56px, auto) minmax(52px, auto);
  align-items: center; gap: 8px; min-height: 58px; padding: 8px 8px;
  border-bottom: 1px solid #f1d7dc;
}
.hot-rank-row:last-child { border-bottom: 0; }
.hot-fav { color: #94a3b8; font-size: 14px; line-height: 1; }
.hot-rank-no { text-align: center; color: #334155; font-weight: 800; font-variant-numeric: tabular-nums; }
.hot-logo {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; background: #eef2f7; color: #1e293b;
  font-size: 13px; font-weight: 950;
}
.hot-rank-name { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.hot-rank-name b {
  color: #1e293b; font-size: 14px; font-weight: 900; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.hot-rank-name small {
  color: #94a3b8; font-size: 10px; font-weight: 800; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.hot-rank-price,
.hot-rank-chg,
.hot-rank-metric {
  text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.hot-rank-price { color: #334155; font-size: 13px; font-weight: 800; }
.hot-rank-chg { color: #94a3b8; font-size: 13px; font-weight: 900; }
.hot-rank-chg.pnl-pos { color: #f43f5e; }
.hot-rank-chg.pnl-neg { color: #2563eb; }
.hot-rank-metric { color: #1e293b; font-size: 13px; font-weight: 900; }
.hot-source { color: #94a3b8; font-size: 11px; font-weight: 700; padding: 8px 2px 0; }
@media (max-width: 520px) {
  .hot-market-strip { gap: 4px; }
  .hot-index { padding: 7px 6px; flex-direction: column; align-items: flex-start; gap: 2px; }
  .hot-row { grid-template-columns: 22px minmax(72px, 1fr) minmax(54px, auto) minmax(42px, auto) minmax(48px, auto); gap: 5px; padding: 8px 4px; }
  .hot-pr, .hot-chg, .hot-val { font-size: 11px; }
  .hot-rank-row {
    grid-template-columns: 16px 20px 30px minmax(88px, 1fr) minmax(58px, auto) minmax(48px, auto);
    gap: 6px; min-height: 55px; padding: 8px 6px;
  }
  .hot-logo { width: 28px; height: 28px; font-size: 12px; }
  .hot-rank-name b { font-size: 13px; }
  .hot-rank-price, .hot-rank-chg { font-size: 12px; }
  .hot-rank-metric { display: none; }
}
@media (prefers-color-scheme: dark) {
  .sa-name, .kv2 b, .hot-nm { color: #f1f5f9; }
  .kv2-strong { background: #233044; }
  .kv2-strong span { color: #cbd5e1; }
  .kv2 b.pnl-pos { color: #f87171; }
  .kv2 b.pnl-neg { color: #60a5fa; }
  .sa { background: #1e293b; border-color: #334155; box-shadow: 0 7px 18px rgba(0,0,0,.3); }
  .sa-bar { background: linear-gradient(180deg, #233044 0%, #1a2636 100%); border-bottom-color: #334155; }
  .sa-bar:active,
  .sa-bar[aria-expanded="true"] { background: linear-gradient(180deg, #29384f 0%, #1f2d40 100%); }
  .sa-state { color: #cbd5e1; }
  .sa-body { background: #0f172a; border-top-color: #334155; }
  .sa-bar[data-sa="danta"] + .sa-body { background: #0f241b; border-top-color: #059669; }
  .sa-bar[data-sa="hot"] + .sa-body { background: #1f1118; border-top-color: #be123c; }
  .hot-index { background: #2a1620; border-color: #7f1d1d; }
  .hot-index em { color: #fecdd3; }
  .hot-sub { color: #fecdd3; }
  .hot-row { border-bottom-color: #7f1d1d; }
  .hot-rk, .hot-val { color: #fb7185; }
  .hot-nm b { color: #f8fafc; }
  .hot-tab { background: #2a1620; border-color: #7f1d1d; color: #fecdd3; }
  .hot-tab.on { background: #f43f5e; border-color: #f43f5e; color: #fff; }
  .hot-rank-head b { color: #f8fafc; }
  .hot-rank-list { background: #111827; }
  .hot-rank-row { border-bottom-color: #334155; }
  .hot-logo { background: #334155; color: #f8fafc; }
  .hot-rank-name b, .hot-rank-price, .hot-rank-metric { color: #f8fafc; }
  .rr:active { background: #273344; }
  .rr-edit { background: rgba(15,23,42,.55); border-left-color: #14532d; color: #bbf7d0; }
  .rr-edit:active { background: #14532d; }
  .dash-danta-actions { border-top-color: #14532d; }
  .dda-btn { background: #10251b; border-color: #166534; color: #bbf7d0; }
  .dda-btn:active { background: #14532d; }
  .dda-ok { background: #15803d; border-color: #16a34a; color: #fff; }
  .dda-stop { background: #b91c1c; border-color: #dc2626; color: #fff; }
  .dda-auto-on { background: #0f766e; border-color: #14b8a6; color: #fff; }
  .dda-auto-off { background: #10251b; border-color: #166534; color: #bbf7d0; }
  .dda-msg { color: #94a3b8; }
  .rr-st.rr-approved { background: #052e16; color: #86efac; }
  .rr-st.rr-stopped { background: #450a0a; color: #fca5a5; }
  .rr-st.rr-holiday { background: #422006; color: #fde68a; }
}

/* ═══ 키움 실계좌 — 전 페이지 공통 접이식 바 (모바일 우선) ═══ */
.kw-acct { position: sticky; top: 0; z-index: 40; margin: 0; }
.kw-acct-bar {
  margin: 0;
  width: 100%; max-width: 100%; display: flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 11px 16px; border: none; cursor: pointer;
  background: #1e293b; color: #f1f5f9;
  border-bottom: 1px solid #0f172a; border-left: 5px solid #3b82f6; font: inherit;
  -webkit-tap-highlight-color: transparent; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 3px 10px rgba(15, 23, 42, .18);
}
.kw-acct-bar:active { background: #172033; }
/* 통일 아이콘 배지 (전략카드 배지와 동일 톤) */
.kw-bar-badge {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #1e3a8a; color: #93c5fd; font-size: 11px; font-weight: 900;
}
.kw-bar-main { min-width: 0; }
.kw-bar-total { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.kw-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; flex: none; }
.kw-dot.on { background: #4ade80; box-shadow: 0 0 6px #4ade80; }
.kw-dot.off { background: #f87171; }
.kw-bar-main { display: flex; flex-direction: column; line-height: 1.1; align-items: flex-start; }
.kw-bar-label { font-size: 10px; color: #dbeafe; }
.kw-bar-total { font-size: 17px; font-weight: 900; color: #fff; }
.kw-bar-pnl {
  margin-left: auto; font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums;
  color: #eef6ff; text-shadow: 0 1px 0 rgba(0,0,0,.18);
  white-space: nowrap;
}
.kw-bar-pnl.pnl-pos { color: #ffd4d4; }
.kw-bar-pnl.pnl-neg { color: #d7e7ff; }
.kw-bar-hold { font-size: 11px; color: #dbeafe; padding-left: 8px; white-space: nowrap; }
.kw-caret { font-size: 13px; color: #fff; padding-left: 4px; }
/* 펼친 계좌 칸 — 밝은 회색 배경 + 파란 상단선으로 바와 완전 분리 */
.kw-acct-body { background: #eef2f7; border-top: 3px solid #2563eb;
  border-bottom: 1px solid #cbd5e1; padding: 12px 14px 14px; }
.kw-acct-body[hidden] { display: none !important; padding: 0 !important; border: 0 !important; }
.kw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px 14px;
  align-items: start;
}
.kw-kv { display: flex; flex-direction: column; line-height: 1.2; }
.kw-kv span { font-size: 11px; color: #64748b; font-weight: 800; }
.kw-kv b { font-size: 15px; color: #0f172a; font-weight: 900; font-variant-numeric: tabular-nums; word-break: keep-all; }
.kw-holds { margin-top: 10px; display: flex; flex-direction: column; gap: 3px; }
.kw-hold-row { display: flex; align-items: center; gap: 8px; font-size: 12px;
  padding: 5px 8px; background: #f8fafc; border-radius: 6px; }
.kw-hn { font-weight: 600; color: #0f172a; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-owner { display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 7px;
  border-radius: 999px; background: #e0f2fe; color: #075985; border: 1px solid #bae6fd;
  font-size: 10px; font-style: normal; font-weight: 800; vertical-align: 1px; }
.kw-hq { color: #64748b; font-variant-numeric: tabular-nums; }
.kw-hp { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }
.kw-empty { font-size: 12px; color: #94a3b8; text-align: center; padding: 8px; }
.kw-foot { margin-top: 10px; font-size: 11px; color: #64748b; text-align: right; font-weight: 700; }
@media (max-width: 760px) {
  .kw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
  .kw-kv span { font-size: 10px; }
  .kw-kv b { font-size: 14px; }
  .kw-foot { font-size: 10px; text-align: left; }
}
/* 다크모드여도 계좌 칸은 밝은 회색 유지 → 어두운 페이지와 확실히 분리 */
@media (prefers-color-scheme: dark) {
  .kw-acct-body { background: #e8edf3; border-bottom-color: #94a3b8; }
  .kw-kv span { color: #475569; }
  .kw-kv b { color: #0f172a; }
  .kw-hold-row { background: #f8fafc; }
  .kw-hn { color: #0f172a; }
  .kw-hq { color: #475569; }
  .kw-foot { color: #64748b; }
}
/* ═══ 오늘 손익 (글랜스) — 키움 바 바로 아래 동일 디자인 풀폭 바, 접이식 ═══ */
.glance { background: #fff; }   /* 풀폭 — 키움 총자산 바 바로 밑에 붙음 */
.glance-bar { width: 100%; max-width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border: none; cursor: pointer; font: inherit;
  background: linear-gradient(180deg, #0d9488, #0f766e); color: #fff;
  border-bottom: 2px solid #5eead4; overflow: hidden;
  -webkit-tap-highlight-color: transparent; }
.glance-bar:active { background: #0f766e; }
.glance-title { font-size: 13px; font-weight: 700; }
.glance-total { margin-left: auto; font-size: 16px; font-weight: 800;
  font-variant-numeric: tabular-nums; background: #fff; border-radius: 6px;
  padding: 2px 9px; color: #475569; }
.glance-total.pnl-pos { color: #dc2626; }
.glance-total.pnl-neg { color: #2563eb; }
.glance-caret { font-size: 13px; color: #cbd5e1; padding-left: 6px; }
.glance-body { display: flex; flex-direction: column; }
.glance-row { display: flex; align-items: center; gap: 8px; padding: 13px 14px;
  border-top: 1px solid #f1f5f9; text-decoration: none; color: inherit;
  -webkit-tap-highlight-color: transparent; }
.glance-row:active { background: #f8fafc; }
.gr-name { font-size: 14px; font-weight: 700; color: #0f172a; min-width: 92px; }
.gr-in { font-size: 12px; color: #64748b; }
.gr-in b { color: #334155; font-variant-numeric: tabular-nums; font-weight: 700; }
.gr-pnl { margin-left: auto; font-size: 16px; font-weight: 800;
  font-variant-numeric: tabular-nums; }
.gr-go { color: #94a3b8; font-size: 15px; padding-left: 2px; }
/* .pnl-pos(빨강)/.pnl-neg(파랑)는 기존 전역 정의 사용 — 재정의 안 함 */
@media (prefers-color-scheme: dark) {
  .glance { background: #1e293b; border-color: #334155; }
  .glance-row { border-top-color: #334155; }
  .glance-row:active { background: #273344; }
  .gr-name { color: #f1f5f9; }
  .gr-in { color: #94a3b8; }
  .gr-in b { color: #cbd5e1; }
}

/* ═══ 스윙매매 — S25 세로 기준 전략 카드 UI ═══ */
.sw-strategy-board {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 4px 14px rgba(15,23,42,.07);
}
.sw-board-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.sw-board-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}
.sw-board-head p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}
.sw-board-mode {
  flex: none;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}
.sw-board-mode.mode-auto { background: #fee2e2; color: #b91c1c; }
.sw-board-mode.mode-off { background: #e2e8f0; color: #475569; }
.sw-flow-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}
.sw-flow-card {
  min-width: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.sw-flow-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 950;
}
.sw-flow-card b {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-flow-card small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.25;
  min-height: 27px;
}
.sw-flow-final {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}
.sw-flow-final span { background: #ffedd5; color: #ea580c; }
.sw-exec-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 9px;
}
.sw-exec-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}
.sw-exec-card b {
  display: block;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}
.sw-exec-card span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.3;
}
.sw-exec-manual { border-left: 4px solid #2563eb; }
.sw-exec-auto { border-left: 4px solid #dc2626; }

.sw-method-board {
  background: #fff;
  border: 1px solid #d7e3f3;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 4px 14px rgba(15,23,42,.06);
}
.sw-method-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.sw-method-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}
.sw-method-head p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}
.sw-method-count {
  flex: none;
  padding: 5px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #334155;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.sw-method-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 1px 0 9px;
  margin: 0 -2px;
}
.sw-method-tabs::-webkit-scrollbar { display: none; }
.sw-method-tab {
  flex: 0 0 auto;
  border: 1px solid #dbe4ef;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}
.sw-method-tab.on {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.sw-method-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 8px;
}
.sw-method-card {
  --tone: #2563eb;
  --soft: #eff6ff;
  overflow: hidden;
  border: 1px solid #dbe4ef;
  border-left: 5px solid var(--tone);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 9px rgba(15,23,42,.04);
}
.sw-method-card.is-hidden { display: none; }
.sw-method-card.tone-teal { --tone: #0f766e; --soft: #ccfbf1; }
.sw-method-card.tone-blue { --tone: #2563eb; --soft: #dbeafe; }
.sw-method-card.tone-red { --tone: #dc2626; --soft: #fee2e2; }
.sw-method-card.tone-amber { --tone: #d97706; --soft: #fef3c7; }
.sw-method-card.tone-purple { --tone: #7c3aed; --soft: #ede9fe; }
.sw-method-card.tone-green { --tone: #16a34a; --soft: #dcfce7; }
.sw-method-card.tone-slate { --tone: #475569; --soft: #e2e8f0; }
.sw-method-summary {
  width: 100%;
  min-height: 62px;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.sw-method-mark {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  color: var(--tone);
  font-size: 11px;
  font-weight: 950;
}
.sw-method-name { min-width: 0; }
.sw-method-name b {
  display: block;
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-method-name small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-method-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  white-space: nowrap;
}
.sw-method-metrics b {
  color: #0f172a;
  font-size: 12px;
  font-weight: 950;
}
.sw-method-metrics small {
  color: var(--tone);
  font-size: 10px;
  font-weight: 900;
}
.sw-method-caret {
  color: #94a3b8;
  font-size: 13px;
  text-align: right;
}
.sw-method-card.is-open .sw-method-caret { color: var(--tone); }
.sw-method-detail {
  border-top: 1px solid #edf2f7;
  padding: 8px 10px 10px;
  background: linear-gradient(180deg, #fbfdff 0%, #fff 100%);
}
.sw-method-detail div:not(.sw-method-actions) {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 5px 0;
}
.sw-method-detail span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}
.sw-method-detail b {
  color: #0f172a;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}
.sw-method-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding-top: 8px;
}
.sw-method-actions button {
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
}
.sw-method-actions button.on {
  border-color: var(--tone);
  background: var(--tone);
  color: #fff;
}
.sw-method-actions .sw-method-config {
  border-color: #0f172a;
  background: #0f172a;
  color: #fff;
}
/* ── 펼친 카드 통일 내용 (후보 종목 / 빠른 설정 / 자동매매 토글) ── */
.smd-sec-t { font-size: 12px; font-weight: 900; color: var(--tone); margin: 11px 0 6px; }
.smd-sec-t:first-child { margin-top: 2px; }
.smd-cands { display: flex; flex-direction: column; gap: 6px; }
.smd-empty { font-size: 12px; color: #94a3b8; padding: 11px; text-align: center;
  background: #f1f5f9; border-radius: 9px; }
.smd-cand { display: grid; grid-template-columns: 1fr auto auto 50px; gap: 8px;
  align-items: center; padding: 9px 11px; background: #f8fafc; border-radius: 9px; font-size: 12px; }
.smd-cand .nm { font-weight: 800; color: #0f172a; }
.smd-cand .rt { font-weight: 800; color: #16a34a; }
.smd-cand .sc { color: #64748b; }
.smd-cand .buy { background: var(--tone); color: #fff; border: 0; border-radius: 8px;
  padding: 5px 0; font-size: 11px; font-weight: 900; cursor: pointer; }
.smd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.smd-chip { font-size: 11px; font-weight: 800; padding: 5px 11px; border-radius: 999px;
  background: #f1f5f9; border: 1px solid #cbd5e1; color: #475569; }
.smd-tg { display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; font-size: 12.5px; font-weight: 700; color: #334155; }
.smd-tg input[type=checkbox] { appearance: none; -webkit-appearance: none;
  width: 40px; height: 22px; border-radius: 11px; background: #cbd5e1; position: relative;
  cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.smd-tg input[type=checkbox]:checked { background: var(--tone); }
.smd-tg input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.smd-tg input[type=checkbox]:checked::after { left: 20px; }
.smd-auto { width: 100%; margin-top: 12px; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--tone); background: var(--soft); color: var(--tone);
  font-size: 13px; font-weight: 900; cursor: pointer; }
.sw-sheet[hidden] { display: none !important; }
body.sw-sheet-open { overflow: hidden; }
.sw-sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
}
.sw-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .48);
}
.sw-sheet-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(100%, 620px);
  max-height: min(86vh, 720px);
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #dbe4ef;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -12px 32px rgba(15,23,42,.25);
  overflow: auto;
}
.sw-sheet-handle {
  width: 46px;
  height: 4px;
  margin: 9px auto 5px;
  border-radius: 999px;
  background: #cbd5e1;
}
.sw-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 16px 10px;
  border-bottom: 1px solid #edf2f7;
}
.sw-sheet-head small {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}
.sw-sheet-head h3 {
  margin: 2px 0 0;
  color: #0f172a;
  font-size: 19px;
  font-weight: 950;
}
.sw-sheet-close {
  width: 34px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-weight: 950;
  cursor: pointer;
}
.sw-sheet-body { padding: 12px 16px; }
.sw-sheet-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid #f1f5f9;
}
.sw-sheet-switch b {
  display: block;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}
.sw-sheet-switch small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.3;
}
.sw-sheet-switch input {
  width: 22px;
  height: 22px;
  flex: none;
}
.sw-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.sw-sheet-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sw-sheet-grid span {
  color: #475569;
  font-size: 11px;
  font-weight: 900;
}
.sw-sheet-grid input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 850;
}
.sw-sheet-note {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}
.sw-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 8px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #edf2f7;
}
.sw-sheet-actions button {
  min-height: 42px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 950;
  cursor: pointer;
}
.sw-sheet-cancel {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
}
.sw-sheet-apply {
  border: 1px solid #0f172a;
  background: #0f172a;
  color: #fff;
}
@media (max-width: 760px) {
  .sw-method-board {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 12px 12px 13px;
  }
  .sw-method-head {
    align-items: flex-start;
    margin-bottom: 8px;
  }
  .sw-method-head h2 { font-size: 17px; }
  .sw-method-head p { display: none; }
  .sw-method-tabs {
    padding-bottom: 8px;
    scroll-padding-left: 12px;
  }
  .sw-method-tab {
    padding: 8px 10px;
    font-size: 12px;
  }
  .sw-method-list {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .sw-method-summary {
    grid-template-columns: 38px minmax(0, 1fr) auto 16px;
    min-height: 58px;
    padding: 8px 9px;
  }
  .sw-method-mark {
    width: 33px;
    height: 33px;
    font-size: 10px;
  }
  .sw-method-name b { font-size: 13.5px; }
  .sw-method-name small { font-size: 10.5px; }
  .sw-method-metrics b { font-size: 11px; }
  .sw-method-detail { padding: 7px 9px 9px; }
  .sw-method-actions button { min-height: 33px; }
  .sw-sheet-panel {
    width: 100%;
    max-height: 88vh;
  }
}
@media (prefers-color-scheme: dark) {
  .sw-method-board,
  .sw-method-card,
  .sw-exec-card,
  .sw-flow-card {
    background: #1e293b;
    border-color: #334155;
  }
  .sw-method-head h2,
  .sw-method-name b,
  .sw-method-metrics b,
  .sw-method-detail b {
    color: #f1f5f9;
  }
  .sw-method-head p,
  .sw-method-name small,
  .sw-method-detail span {
    color: #94a3b8;
  }
  .sw-method-count,
  .sw-method-tab,
  .sw-method-actions button {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
  }
  .sw-method-tab.on,
  .sw-method-actions .sw-method-config {
    background: #f8fafc;
    border-color: #f8fafc;
    color: #0f172a;
  }
  .sw-method-detail {
    background: #0f172a;
    border-top-color: #334155;
  }
  .smd-empty { background: rgba(148,163,184,.10); color: #94a3b8; }
  .smd-cand { background: #0b1220; }
  .smd-cand .nm { color: #f1f5f9; }
  .smd-cand .sc { color: #94a3b8; }
  .smd-chip { background: #0b1220; border-color: #334155; color: #cbd5e1; }
  .smd-tg { color: #e2e8f0; }
  .smd-tg input[type=checkbox] { background: #334155; }
  .smd-auto { background: rgba(148,163,184,.10); }
  .sw-sheet-panel {
    background: #1e293b;
    border-color: #334155;
  }
  .sw-sheet-head,
  .sw-sheet-actions,
  .sw-sheet-switch {
    border-color: #334155;
  }
  .sw-sheet-head h3,
  .sw-sheet-switch b {
    color: #f1f5f9;
  }
  .sw-sheet-head small,
  .sw-sheet-switch small,
  .sw-sheet-note {
    color: #94a3b8;
  }
  .sw-sheet-grid span { color: #cbd5e1; }
  .sw-sheet-grid input {
    background: #0f172a;
    border-color: #475569;
    color: #f8fafc;
  }
  .sw-sheet-note {
    background: #0f172a;
    border-color: #475569;
  }
  .sw-sheet-cancel,
  .sw-sheet-close {
    background: #0f172a;
    border-color: #475569;
    color: #cbd5e1;
  }
}

#sw-rec-section .section-head h2 {
  color: #0f172a;
  font-size: 17px;
  font-weight: 950;
}
.sw-auto-bar {
  align-items: center;
  background: linear-gradient(180deg, #ecfdf5 0%, #f8fffb 100%);
  border-color: #bbf7d0;
}
.sw-auto-bar .sw-auto-runbtn {
  margin-left: auto;
  min-height: 31px;
}
.sw-auto-state {
  margin-left: 0;
  color: #065f46;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}
.sw-rec-mobile-list { display: none; }

.sw-candidate-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #94a3b8;
  border-radius: 8px;
  padding: 11px 12px;
  box-shadow: 0 2px 8px rgba(15,23,42,.05);
}
.sw-cand-strong { border-left-color: #dc2626; }
.sw-cand-good { border-left-color: #16a34a; }
.sw-cand-mid { border-left-color: #f59e0b; }
.sw-cand-weak { border-left-color: #94a3b8; }
.sw-cand-top {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.sw-cand-rank {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 950;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sw-cand-name {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #0f172a;
  font: inherit;
  font-size: 16px;
  font-weight: 950;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
.sw-cand-mid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: baseline;
  margin: 8px 0 6px;
  font-size: 12px;
}
.sw-cand-mid span { color: #94a3b8; font-weight: 850; }
.sw-cand-mid b { color: #334155; font-weight: 950; font-variant-numeric: tabular-nums; }
.sw-cand-mid em {
  font-style: normal;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}
.sw-cand-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.sw-cand-tags span {
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10.5px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-cand-bottom {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}
.sw-cand-bottom small {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
  text-align: right;
}
.sw-cand-approve {
  min-height: 31px;
  padding: 0 13px;
  border: 1px solid #15803d;
  border-radius: 7px;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}
.sw-cand-approve:disabled { opacity: .65; }

.sw-history-fold {
  margin-bottom: 16px;
}
.sw-history-fold > summary {
  cursor: pointer;
  list-style: none;
}
.sw-history-fold > summary::-webkit-details-marker { display: none; }
.sw-history-fold > summary::after {
  content: " 펼치기";
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.sw-history-fold[open] > summary::after { content: " 접기"; }

@media (max-width: 700px) {
  .page-head {
    align-items: stretch;
  }
  .page-head .page-title {
    font-size: 20px;
  }
  .page-head-meta {
    align-self: flex-start;
  }
  .sw-mode {
    width: auto;
    margin-left: auto;
    display: inline-flex;
  }
  .sw-mode-btn {
    min-height: 36px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 950;
  }
  .sw-strategy-board {
    margin-bottom: 10px;
    padding: 11px 10px;
    border-radius: 8px;
  }
  .sw-board-head {
    align-items: center;
  }
  .sw-board-head h2 {
    font-size: 17px;
  }
  .sw-board-head p {
    display: none;
  }
  .sw-flow-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sw-flow-final {
    grid-column: 1 / -1;
  }
  .sw-flow-card {
    padding: 8px;
  }
  .sw-flow-card small {
    min-height: 0;
  }
  .sw-exec-split {
    grid-template-columns: 1fr;
  }
  #sw-rec-section {
    margin-bottom: 12px;
  }
  #sw-rec-section .section-head {
    align-items: flex-start;
    gap: 8px;
  }
  #sw-rec-section .section-head h2 {
    font-size: 16px;
  }
  .sw-head-btns {
    justify-content: flex-end;
    gap: 5px;
  }
  .btn-scan {
    min-height: 31px;
    padding: 0 9px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 950;
  }
  .sw-auto-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    padding: 8px;
  }
  .sw-auto-cond {
    min-width: 0;
    font-size: 11px;
    font-weight: 850;
  }
  .sw-auto-cond input {
    width: 44px;
    height: 26px;
    font-weight: 950;
  }
  .sw-auto-bar .sw-auto-runbtn {
    margin-left: 0;
    padding: 0 9px;
    font-size: 11px;
    white-space: nowrap;
  }
  .sw-auto-state {
    grid-column: 1 / -1;
    padding-top: 1px;
  }
  .sw-fw-fold {
    font-size: 12px !important;
  }
  .sw-alloc-plan {
    margin-bottom: 8px;
  }
  .sw-rec-table-card {
    display: none;
  }
  .sw-rec-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .sw-candidate-card {
    padding: 10px;
  }
  .sw-cand-name {
    font-size: 15px;
  }
  .sw-cand-mid {
    gap: 7px;
  }
  .sw-cand-bottom {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .swm-title {
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
  }
  .swm-title span {
    flex: none;
  }
  .swm-title small {
    min-width: 0;
    font-size: 10.5px;
  }
  .swm-grid,
  .swm-grid-ops {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }
  .swm-cell {
    padding: 7px 8px;
  }
  .swm-cell b {
    font-size: 13px;
  }
  .swm-budget-row {
    grid-template-columns: 1fr;
  }
  .swm-budget-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .sw-hold-summary-box {
    padding: 12px;
    border-radius: 8px;
  }
  .sw-hs-total {
    font-size: 22px;
  }
  .sw-hc {
    padding: 11px 2px;
  }
  .sw-hc-name {
    font-size: 14px;
  }
  .sw-hc-price {
    font-size: 14px;
  }
  .sw-sell-help {
    display: none;
  }
  .sw-sell-row {
    padding: 9px 10px;
  }
  .sw-theme-row,
  .sw-mkt2-row {
    border-radius: 8px;
    padding: 9px 10px;
  }
  .sw-modal-box {
    width: min(440px, 96vw);
    max-height: 86vh;
    border-radius: 8px;
  }
}

@media (max-width: 430px) {
  .sw-flow-cards {
    gap: 6px;
  }
  .sw-flow-card b {
    font-size: 11.5px;
  }
  .sw-flow-card small {
    font-size: 10px;
  }
  .sw-cand-top {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 6px;
  }
  .rec-score {
    padding: 2px 6px;
    font-size: 11px;
  }
  .sw-cand-mid {
    grid-template-columns: minmax(0, 1fr) auto auto;
    font-size: 11.5px;
  }
  .sw-cand-tags span {
    font-size: 10px;
    padding: 2px 6px;
  }
  .sw-cand-bottom small {
    font-size: 10.5px;
  }
  .sw-cand-approve {
    min-height: 30px;
    padding: 0 11px;
  }
}

@media (prefers-color-scheme: dark) {
  .sw-strategy-board {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    border-color: #334155;
    box-shadow: 0 5px 16px rgba(0,0,0,.28);
  }
  .sw-board-head h2,
  .sw-flow-card b,
  .sw-exec-card b,
  .sw-cand-name,
  .sw-cand-mid b {
    color: #f8fafc;
  }
  .sw-board-head p,
  .sw-flow-card small,
  .sw-exec-card span,
  .sw-cand-mid span,
  .sw-cand-bottom small {
    color: #94a3b8;
  }
  .sw-flow-card,
  .sw-exec-card,
  .sw-candidate-card {
    background: #1e293b;
    border-color: #334155;
  }
  .sw-flow-card span {
    background: #1e3a8a;
    color: #bfdbfe;
  }
  .sw-flow-final {
    background: linear-gradient(180deg, #24170a 0%, #1e293b 100%);
    border-color: #7c2d12;
  }
  .sw-flow-final span {
    background: #7c2d12;
    color: #fed7aa;
  }
  .sw-auto-bar {
    background: #0f241b;
    border-color: #166534;
  }
  .sw-cand-tags span {
    background: #334155;
    color: #cbd5e1;
  }
  .sw-cand-approve {
    background: #15803d;
    border-color: #16a34a;
  }
  .sw-history-fold > summary::after {
    color: #94a3b8;
  }
}

/* Strategy method cards: keep this block scoped to the swing strategy menu only. */
.sw-method-board {
  background: #0b1222;
  border-color: #0b1222;
  box-shadow: none;
}
.sw-method-board .sw-method-head h2 {
  color: #f8fafc;
}
.sw-method-board .sw-method-head p {
  display: none;
}
.sw-method-count {
  display: none;
}
.sw-method-list {
  grid-template-columns: 1fr;
  gap: 8px;
}
.sw-method-card {
  --tone: #22c9b8;
  --badge: #0f5f5a;
  --ink: #f8fafc;
  --muted: #9fb0c6;
  overflow: hidden;
  background: #1f2b3d;
  border: 0;
  border-left: 5px solid var(--tone);
  border-radius: 12px;
  box-shadow: none;
}
.sw-method-card.tone-teal { --tone: #22c9b8; --badge: #0f5f5a; --soft: rgba(34, 201, 184, .16); }
.sw-method-card.tone-blue { --tone: #6c63ff; --badge: #3a3291; --soft: rgba(108, 99, 255, .16); }
.sw-method-card.tone-red { --tone: #ff4a4a; --badge: #8f2424; --soft: rgba(255, 74, 74, .16); }
.sw-method-card.tone-amber { --tone: #f59e0b; --badge: #8a4a08; --soft: rgba(245, 158, 11, .16); }
.sw-method-card.tone-purple { --tone: #8b5cf6; --badge: #4c2aa6; --soft: rgba(139, 92, 246, .16); }
.sw-method-card.tone-green { --tone: #22c55e; --badge: #126c38; --soft: rgba(34, 197, 94, .16); }
.sw-method-card.tone-slate { --tone: #718096; --badge: #334155; --soft: rgba(113, 128, 150, .16); }
.sw-method-card.is-open {
  background: #06271f;
  border: 2px solid var(--tone);
  border-left-width: 5px;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
}
.sw-method-summary {
  min-height: 76px;
  grid-template-columns: 50px minmax(0, 1fr) 74px 14px;
  gap: 10px;
  padding: 12px 14px;
  background: transparent;
}
.sw-method-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--badge);
  color: #dffcf8;
  font-size: 13px;
  font-weight: 900;
}
.sw-method-name b {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.18;
}
.sw-method-name small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}
.sw-method-metrics {
  align-items: center;
  gap: 4px;
  min-width: 66px;
}
.sw-method-metrics b {
  color: #fff;
  font-size: 15px;
  line-height: 1.1;
}
.sw-method-metrics small {
  min-width: 42px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #334155;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
}
.sw-method-caret {
  color: #8ea3bd;
  font-size: 16px;
  font-weight: 900;
}
.sw-method-card.is-open .sw-method-caret {
  color: var(--tone);
}
.sw-method-detail {
  margin: 0 14px 14px 50px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(34, 201, 184, .45);
  background: transparent;
}
.smd-sec-t {
  margin: 12px 0 8px;
  color: #bffcf4;
  font-size: 13.5px;
  font-weight: 900;
}
.smd-sec-t:first-child {
  margin-top: 0;
}
.smd-cands {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.smd-empty {
  min-height: 44px;
  padding: 12px 12px;
  border-radius: 8px;
  background: #10192d;
  color: #9fb0c6;
  font-size: 12px;
  text-align: center;
}
.smd-cand-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 46px 64px;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 7px 8px 7px 12px;
  border-radius: 8px;
  background: #10192d;
}
.smd-cand-name {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 0;
  background: transparent;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.smd-cand-name b,
.smd-cand-name small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.smd-cand-name b {
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.15;
}
.smd-cand-name small {
  color: #9fb0c6;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.1;
}
.smd-cand-rate {
  color: #24f2a2;
  font-size: 12.5px;
  font-weight: 900;
  text-align: right;
}
.smd-cand-rate.pnl-neg {
  color: #60a5fa;
}
.smd-cand-score {
  color: #aab7ca;
  font-size: 12.5px;
  font-weight: 800;
  text-align: center;
}
.smd-buy {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: #19c2b2;
  color: #06271f;
  font-size: 12.5px;
  font-weight: 900;
  cursor: pointer;
}
.smd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.smd-chip {
  min-height: 34px;
  padding: 8px 16px;
  border: 1px solid var(--tone);
  border-radius: 999px;
  background: rgba(15, 23, 42, .78);
  color: #eafcff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}
.smd-tg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  margin-top: 7px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 800;
}
.smd-tg input[type=checkbox] {
  position: relative;
  width: 44px;
  height: 26px;
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #334155;
  cursor: pointer;
}
.smd-tg input[type=checkbox]:checked {
  background: #19c2b2;
}
.smd-tg input[type=checkbox]::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s ease;
}
.smd-tg input[type=checkbox]:checked::after {
  left: 21px;
}
.smd-auto {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border: 1px solid var(--tone);
  border-radius: 12px;
  background: rgba(34, 201, 184, .30);
  color: #7fffee;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}
@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }
  .container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .sw-method-board {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    padding: 12px;
    border-radius: 0;
    overflow: hidden;
  }
  .sw-method-list {
    width: 100%;
    max-width: 100%;
    gap: 8px;
  }
  .sw-method-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border-radius: 12px;
  }
  .sw-method-summary {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 74px;
    grid-template-columns: 48px minmax(0, 1fr) 68px 12px;
    padding: 12px 12px;
  }
  .sw-method-name,
  .sw-method-metrics {
    min-width: 0;
  }
  .sw-method-name b {
    font-size: 18px;
  }
  .sw-method-name small {
    font-size: 12px;
  }
  .sw-method-detail {
    margin: 0 12px 12px 48px;
  }
  .smd-cand-row {
    grid-template-columns: minmax(0, 1fr) 52px 42px 62px;
    gap: 6px;
  }
  .smd-chip {
    flex: 1 1 92px;
    text-align: center;
  }
}

/* Strategy method open panel cleanup: override older generic detail grids. */
.sw-method-card.is-open .sw-method-detail div,
.sw-method-card.is-open .sw-method-detail span,
.sw-method-card.is-open .sw-method-detail label,
.sw-method-card.is-open .sw-method-detail button {
  box-sizing: border-box;
}
.sw-method-card.is-open .sw-method-detail .smd-sec-t {
  display: block !important;
  width: 100%;
  margin: 14px 0 9px;
  color: #cffff8;
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
}
.sw-method-card.is-open .sw-method-detail .smd-cands {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  gap: 7px;
}
.sw-method-card.is-open .sw-method-detail .smd-empty {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: #a8b5c8;
  line-height: 1.25;
  white-space: nowrap;
}
.sw-method-card.is-open .sw-method-detail .smd-cand-row {
  display: grid !important;
  width: 100%;
}
.sw-method-card.is-open .sw-method-detail .smd-chips {
  display: flex !important;
  flex-wrap: wrap;
  width: 100%;
  gap: 8px;
}
.sw-method-card.is-open .sw-method-detail .smd-chip {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: auto;
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  min-height: 36px;
  padding: 0 12px;
  color: #d9f8f5;
  line-height: 1.15;
  white-space: nowrap;
}
.sw-method-card.is-open .sw-method-detail .smd-tg {
  display: flex !important;
  width: 100%;
  gap: 12px;
  color: #dce7f3;
  line-height: 1.2;
}
.sw-method-card.is-open .sw-method-detail .smd-tg span {
  min-width: 0;
  color: #dce7f3;
  white-space: nowrap;
}
.sw-method-card.is-open .sw-method-detail .smd-auto {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .sw-method-card.is-open .sw-method-detail {
    margin: 0 12px 12px;
    padding-top: 12px;
  }
  .sw-method-card.is-open .sw-method-detail .smd-chips {
    display: flex !important;
    flex-wrap: wrap;
  }
  .sw-method-card.is-open .sw-method-detail .smd-chip {
    flex: 1 1 calc(50% - 4px);
    font-size: 12px;
    padding: 0 8px;
  }
}

/* 전략 카드 펼침 영역: 기존 공통 격자 규칙이 내부 조작부를 망가뜨리지 않게 보정 */
.sw-method-card.is-open .sw-method-detail .ha-budget {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 0;
}
.sw-method-card.is-open .sw-method-detail .ha-bud-amt {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 10px;
}
.sw-method-card.is-open .sw-method-detail .ha-bud-amt span {
  color: #155e75;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}
.sw-method-card.is-open .sw-method-detail .ha-bud-amt b {
  color: #0e7490;
  font-size: 19px;
  font-weight: 950;
  line-height: 1.1;
  white-space: nowrap;
}
.sw-method-card.is-open .sw-method-detail .ha-filter {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  width: 100%;
  column-gap: 10px;
  row-gap: 8px;
  padding: 0;
  color: #cde8e6;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}
.sw-method-card.is-open .sw-method-detail .ha-filter-prefix {
  align-self: center;
  color: #cde8e6;
  white-space: nowrap;
}
.sw-method-card.is-open .sw-method-detail .ha-price-field {
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 0;
}
.sw-method-card.is-open .sw-method-detail .ha-price-field span {
  color: #cde8e6;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}
.sw-method-card.is-open .sw-method-detail .ha-filter input {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  box-sizing: border-box;
  padding: 9px 12px;
  font-size: 16px;
  line-height: 1.2;
}
.sw-method-card.is-open .sw-method-detail .ha-filter-actions {
  display: grid !important;
  grid-template-columns: 72px 56px;
  grid-column: auto;
  width: auto;
  gap: 8px;
  padding: 0;
}
.sw-method-card.is-open .sw-method-detail .ha-filter-actions button {
  width: 100%;
  min-width: 0;
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
}
.sw-method-card.is-open .sw-method-detail .ha-srctab {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
}
.sw-method-card.is-open .sw-method-detail .ha-srcbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 46px;
  white-space: normal;
  line-height: 1.2;
}
.sw-method-card.is-open .sw-method-detail .ha-prog {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
}
.sw-method-card.is-open .sw-method-detail .ha-prog-row {
  display: grid !important;
  grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1.25fr);
  width: 100%;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
}
.sw-method-card.is-open .sw-method-detail .ha-prog-row > span {
  color: #475569;
  font-size: 12.5px;
  font-weight: 950;
  white-space: nowrap;
}
.sw-method-card.is-open .sw-method-detail .ha-prog-row > b {
  min-width: 0;
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.25;
  text-align: right;
  overflow-wrap: anywhere;
}
.sw-method-card.is-open .sw-method-detail .ha-result,
.sw-method-card.is-open .sw-method-detail .smd-chart-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  text-align: center;
  line-height: 1.25;
  white-space: normal;
}
@media (max-width: 430px) {
  .sw-method-card.is-open .sw-method-detail .ha-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sw-method-card.is-open .sw-method-detail .ha-filter-prefix {
    grid-column: 1 / -1;
  }
  .sw-method-card.is-open .sw-method-detail .ha-price-field {
    width: 100%;
  }
  .sw-method-card.is-open .sw-method-detail .ha-filter input {
    max-width: none;
  }
  .sw-method-card.is-open .sw-method-detail .ha-filter-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .sw-method-card.is-open .sw-method-detail .ha-srctab {
    gap: 8px;
  }
  .sw-method-card.is-open .sw-method-detail .ha-srcbtn {
    padding: 12px 8px;
    font-size: 13px;
  }
  .sw-method-card.is-open .sw-method-detail .ha-prog-row {
    grid-template-columns: 48px minmax(0, .75fr) minmax(0, 1.25fr);
    padding: 10px;
  }
  .sw-method-card.is-open .sw-method-detail .ha-prog-row > b {
    font-size: 14px;
  }
}

/* Swing HA source picker compact override must stay after legacy mobile rules. */
.sw-method-card.is-open .sw-method-detail .ha-srctab {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 3px !important;
  margin: 2px 0 8px !important;
  padding: 3px !important;
  border: 1px solid rgba(148, 163, 184, .55) !important;
  border-radius: 8px !important;
  background: rgba(241, 245, 249, .92) !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srcgrid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
  margin: 0 0 10px !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srcbtn {
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: #475569 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srcbtn.on {
  background: #0f766e !important;
  color: #fff !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srcbtn[data-src="formula"].on {
  background: #2563eb !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srcbtn[data-src="card"].on {
  background: #7c3aed !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist {
  display: block !important;
  grid-template-columns: none !important;
  grid-column: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  border-radius: 8px !important;
  border-color: rgba(148, 163, 184, .6) !important;
  overflow: hidden !important;
  transition: opacity .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist.is-formula {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist.is-card {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist.is-formula.is-active {
  border-color: rgba(37, 99, 235, .85) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12) !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist.is-card.is-active {
  border-color: rgba(124, 58, 237, .85) !important;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, .12) !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist.is-locked {
  opacity: .56 !important;
  filter: grayscale(.25) !important;
  background: #f1f5f9 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist.is-locked .ha-srclist-items,
.sw-method-card.is-open .sw-method-detail .ha-srclist.is-locked .ha-srclist-actions {
  pointer-events: none !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist.is-locked .ha-srclist-head::after {
  content: '잠김';
  flex: 0 0 auto;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist-head {
  display: flex !important;
  grid-template-columns: none !important;
  grid-column: auto !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  min-height: 34px !important;
  padding: 7px 10px !important;
  background: #f8fafc !important;
  color: #1f2937 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist-source {
  display: block !important;
  grid-column: auto !important;
  width: 100% !important;
  padding: 0 10px 7px !important;
  margin-top: -1px !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist-items {
  display: block !important;
  grid-template-columns: none !important;
  grid-column: auto !important;
  width: 100% !important;
  max-height: 190px !important;
  overflow-y: auto !important;
  background: #fff !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist-item {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 42px !important;
  padding: 7px 8px !important;
  border-bottom: 1px solid #eef2f7 !important;
  color: #111827 !important;
  font-size: 12px !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist-item input {
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  accent-color: #0f766e;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist.is-formula .ha-srclist-item input {
  accent-color: #2563eb !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist.is-card .ha-srclist-item input {
  accent-color: #7c3aed !important;
}
.sw-method-card.is-open .sw-method-detail .ha-source-text {
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1px !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist-item .nm {
  display: block !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-source-text small {
  color: #64748b !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist-item .seq,
.sw-method-card.is-open .sw-method-detail .ha-srclist-item .st {
  justify-self: end !important;
  padding: 2px 6px !important;
  border-radius: 999px !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 10.5px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist-actions {
  display: grid !important;
  grid-template-columns: 58px minmax(0, 1fr) !important;
  grid-column: auto !important;
  width: 100% !important;
  gap: 6px !important;
  padding: 7px !important;
  background: #f8fafc !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist-actions button {
  height: 36px !important;
  min-height: 36px !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist-actions button:disabled {
  cursor: not-allowed !important;
  opacity: .5 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-srclist-empty {
  padding: 16px 10px !important;
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}
@media (max-width: 430px) {
  .sw-method-card.is-open .sw-method-detail .ha-srcbtn {
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 6px !important;
    font-size: 12.5px !important;
  }
  .sw-method-card.is-open .sw-method-detail .ha-srcgrid {
    gap: 5px !important;
  }
  .sw-method-card.is-open .sw-method-detail .ha-srclist-head {
    padding: 6px 7px !important;
    font-size: 11px !important;
  }
  .sw-method-card.is-open .sw-method-detail .ha-srclist-source {
    padding: 0 7px 6px !important;
    font-size: 9px !important;
  }
  .sw-method-card.is-open .sw-method-detail .ha-srclist-items {
    max-height: 176px !important;
  }
  .sw-method-card.is-open .sw-method-detail .ha-srclist-item {
    grid-template-columns: 16px minmax(0, 1fr) auto !important;
    gap: 5px !important;
    min-height: 40px !important;
    padding: 6px 7px !important;
  }
  .sw-method-card.is-open .sw-method-detail .ha-srclist-actions {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    padding: 6px !important;
  }
}

/* Swing HA today progress compact cards */
.sw-method-card.is-open .sw-method-detail .ha-prog {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  width: 100% !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-pnl-hero {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  grid-template-areas: "label value rate" !important;
  column-gap: 8px !important;
  align-items: center !important;
  min-height: 46px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 8px 10px !important;
  border: 1px solid rgba(45, 212, 191, .42) !important;
  border-radius: 10px !important;
  background: rgba(15, 118, 110, .24) !important;
}
.sw-method-card.is-open .sw-method-detail .ha-pnl-lbl {
  grid-area: label !important;
  min-width: 0 !important;
  color: #cde8e6 !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
}
.sw-method-card.is-open .sw-method-detail .ha-pnl-val {
  grid-area: value !important;
  min-width: 0 !important;
  max-width: 100% !important;
  color: #f8fafc !important;
  font-size: 18px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  text-align: right !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  font-variant-numeric: tabular-nums !important;
}
.sw-method-card.is-open .sw-method-detail .ha-pnl-rate {
  grid-area: rate !important;
  min-width: 0 !important;
  color: #9fb7c8 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  text-align: right !important;
}
.sw-method-card.is-open .sw-method-detail .ha-pnl-val.pnl-pos,
.sw-method-card.is-open .sw-method-detail .ha-pnl-rate.pnl-pos {
  color: #ef4444 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-pnl-val.pnl-neg,
.sw-method-card.is-open .sw-method-detail .ha-pnl-rate.pnl-neg {
  color: #3b82f6 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-cell-val.pnl-pos,
.sw-method-card.is-open .sw-method-detail .ha-cell-sub.pnl-pos {
  color: #ef4444 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-cell-val.pnl-neg,
.sw-method-card.is-open .sw-method-detail .ha-cell-sub.pnl-neg {
  color: #3b82f6 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-prog-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
}
.sw-method-card.is-open .sw-method-detail .ha-prog-cell {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-areas:
    "label value"
    "sub sub" !important;
  align-items: center !important;
  min-width: 0 !important;
  min-height: 52px !important;
  box-sizing: border-box !important;
  padding: 8px 9px !important;
  border: 1px solid rgba(45, 212, 191, .22) !important;
  border-radius: 10px !important;
  background: #111827 !important;
}
.sw-method-card.is-open .sw-method-detail .ha-cell-lbl {
  grid-area: label !important;
  min-width: 0 !important;
  color: #cbd5e1 !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
}
.sw-method-card.is-open .sw-method-detail .ha-cell-val {
  grid-area: value !important;
  min-width: 0 !important;
  max-width: 100% !important;
  color: #f8fafc !important;
  font-size: 15px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  text-align: right !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-variant-numeric: tabular-nums !important;
}
.sw-method-card.is-open .sw-method-detail .ha-cell-sub {
  grid-area: sub !important;
  min-width: 0 !important;
  color: #94a3b8 !important;
  font-size: 10.5px !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
  text-align: left !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-variant-numeric: tabular-nums !important;
}
@media (max-width: 430px) {
  .sw-method-card.is-open .sw-method-detail .ha-pnl-hero {
    min-height: 42px !important;
    padding: 7px 9px !important;
  }
  .sw-method-card.is-open .sw-method-detail .ha-pnl-val {
    font-size: 17px !important;
  }
  .sw-method-card.is-open .sw-method-detail .ha-prog-grid {
    gap: 6px !important;
  }
  .sw-method-card.is-open .sw-method-detail .ha-prog-cell {
    min-height: 48px !important;
    padding: 7px 8px !important;
  }
  .sw-method-card.is-open .sw-method-detail .ha-cell-val {
    font-size: 14px !important;
  }
  .sw-method-card.is-open .sw-method-detail .ha-cell-sub {
    font-size: 10px !important;
  }
}


/* Unified investment ledger dashboard */
.money-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 12px;
  border-top: 1px solid rgba(255,255,255,.14);
  background: #0f172a;
  color: #e5e7eb;
}
.money-strip span { font-size: 12px; color: #94a3b8; }
.money-strip b { font-size: 20px; letter-spacing: 0; }
.money-strip small { margin-left: auto; font-size: 12px; font-weight: 700; }
.ledger-page {
  width: min(1120px, calc(100% - 24px));
  margin: 12px auto 28px;
}
.ledger-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin: 10px 0 12px;
}
.ledger-head h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}
.ledger-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
}
.ledger-live {
  min-width: 70px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
  font-weight: 800;
  font-size: 12px;
}
.ledger-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ledger-box {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}
.ledger-box h2 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #334155;
  letter-spacing: 0;
}
.ledger-box > strong {
  display: block;
  margin-bottom: 12px;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
  color: #0f172a;
}
.ledger-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  font-size: 13px;
}
.ledger-grid span { color: #64748b; }
.ledger-grid b { color: #111827; text-align: right; }
.ledger-box small {
  display: block;
  margin-top: 10px;
  color: #64748b;
  font-size: 12px;
}
.dept-ledger {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.dept-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.dept-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 0;
  background: #f8fafc;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}
.dept-row:hover { background: #f1f5f9; }
.dept-row b { display: block; font-size: 15px; letter-spacing: 0; }
.dept-row small { display: block; margin-top: 3px; color: #64748b; font-size: 12px; }
.dept-row strong { font-size: 18px; letter-spacing: 0; white-space: nowrap; }
.dept-body {
  padding: 10px 14px 14px;
  border-top: 1px solid #e2e8f0;
}
.round-ledger { display: grid; gap: 6px; }
.round-line {
  display: grid;
  grid-template-columns: 1.2fr .9fr .9fr .9fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #0f172a;
  text-decoration: none;
  font-size: 13px;
}
.round-line:hover { background: #f8fafc; text-decoration: none; }
.round-line b { display: block; }
.round-line small { display: block; color: #64748b; margin-top: 2px; }
.round-line strong { text-align: right; white-space: nowrap; }
.kv2 {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f7;
  font-size: 13px;
}
.kv2 span { color: #64748b; }
.kv2 b { color: #0f172a; text-align: right; }
.sa-more {
  display: inline-flex;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #0f766e;
}
.ledger-secondary {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.secondary-toggle {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 11px 14px;
  text-align: left;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
}
.secondary-body {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 10px 14px;
}
.flow-line {
  display: grid;
  grid-template-columns: 150px 1fr auto minmax(80px, .8fr);
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f7;
  font-size: 12px;
}
.flow-line:last-child, .kv2:last-child { border-bottom: 0; }
.flow-line span, .flow-line small { color: #64748b; }
.flow-line strong { text-align: right; white-space: nowrap; }
.sa-empty {
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
}
.daybar #db-dot {
  min-width: 30px;
  text-align: center;
}
@media (max-width: 760px) {
  .ledger-page { width: min(100% - 14px, 1120px); margin-top: 8px; }
  .ledger-head { align-items: start; }
  .ledger-head h1 { font-size: 20px; }
  .ledger-pair { grid-template-columns: 1fr; }
  .ledger-box > strong { font-size: 24px; }
  .round-line {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .round-line span:nth-child(2),
  .round-line span:nth-child(3),
  .round-line span:nth-child(4) { font-size: 12px; color: #475569; }
  .flow-line { grid-template-columns: 1fr auto; }
  .flow-line small { grid-column: 1 / -1; }
}
@media (prefers-color-scheme: dark) {
  .ledger-head p { color: #94a3b8; }
  .ledger-box, .dept-card, .secondary-toggle, .secondary-body { background: #0f172a; border-color: #334155; }
  .ledger-box h2, .dept-row, .secondary-toggle { color: #e2e8f0; }
  .ledger-box > strong, .ledger-grid b, .dept-row b, .kv2 b { color: #f8fafc; }
  .ledger-grid span, .ledger-box small, .dept-row small, .kv2 span, .flow-line span, .flow-line small { color: #94a3b8; }
  .dept-row { background: #111827; }
  .dept-row:hover { background: #1e293b; }
  .dept-body, .kv2, .flow-line { border-color: #263244; }
  .round-line { border-color: #334155; color: #e2e8f0; }
  .round-line:hover, .sa-empty { background: #111827; }
  .ledger-live { background: #064e3b; color: #d1fae5; }
}


/* Investment ledger anti-overlap pass */
.ledger-pair, .dept-ledger, .compounder-ledger-host { min-width: 0; }
.ledger-box, .dept-card, .compounder-ledger-card { min-width: 0; }
.ledger-grid { grid-template-columns: minmax(0, 1fr) minmax(78px, auto); }
.ledger-grid span, .ledger-grid b, .kv2 span, .kv2 b { min-width: 0; overflow-wrap: anywhere; }
.ledger-grid b, .kv2 b { font-variant-numeric: tabular-nums; }
.dept-row > span { min-width: 0; }
.dept-row b, .dept-row small { overflow: hidden; text-overflow: ellipsis; }
.round-line > span, .round-line strong, .flow-line > * { min-width: 0; }
.flow-line b, .flow-line small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compounder-ledger-title { flex-wrap: wrap; align-items: flex-start; }
.compounder-ledger-title b, .compounder-ledger-title small { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .dept-shell { grid-template-columns: 1fr; gap: 10px; }
  .dept-tree { position: static; max-height: 220px; border-radius: 8px; }
  .dept-hero { padding: 13px 14px; border-radius: 8px; }
  .dept-title { font-size: 21px; }
  .dept-summary { font-size: 13px; }
  .dept-panel { border-radius: 8px; padding: 12px; }
  .ledger-grid, .kv2 { grid-template-columns: minmax(0, 1fr) minmax(72px, auto); }
  .dept-row { padding: 12px; grid-template-columns: minmax(0, 1fr) minmax(84px, auto); }
  .dept-row strong { font-size: 16px; }
  .round-line { grid-template-columns: minmax(0, 1fr) minmax(82px, auto); gap: 5px 8px; }
  .round-line strong { grid-column: 2; grid-row: 1; }
  .flow-line b { white-space: normal; }
}

/* Compounder unified ledger in department detail */
.compounder-ledger-host {
  display: block;
  grid-column: 1 / -1;
}
.compounder-ledger-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 0 2px;
}
.compounder-ledger-title b {
  color: #0f172a;
  font-size: 17px;
  letter-spacing: 0;
}
.compounder-ledger-title small {
  color: #64748b;
  font-size: 12px;
  text-align: right;
}
.compounder-pair { margin-bottom: 12px; }
.compounder-dept-ledger { margin-top: 12px; }
.compounder-ledger-card .dept-body { display: block; }
.compounder-ledger-card .sa-more { text-decoration: none; }
@media (max-width: 760px) {
  .compounder-ledger-title {
    display: block;
  }
  .compounder-ledger-title small {
    display: block;
    margin-top: 4px;
    text-align: left;
  }
}
@media (prefers-color-scheme: dark) {
  .compounder-ledger-title b { color: #f8fafc; }
  .compounder-ledger-title small { color: #94a3b8; }
}

/* Restored dashboard layout */
.dash-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.dash-top-cards .card-value,
.dash-strat-card .card-value {
  letter-spacing: 0;
}
.dash-round-card .dash-mini-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
}
.dash-sublist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}
.dash-sublist span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}
.dash-note {
  margin: 10px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}
.dash-table-card {
  overflow-x: auto;
}
.dash-table {
  min-width: 720px;
  display: grid;
  gap: 0;
}
.dash-tr {
  display: grid;
  grid-template-columns: 82px 1.4fr 70px 120px 120px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f7;
  font-size: 13px;
}
.dash-tr:last-child { border-bottom: 0; }
.dash-th {
  color: #64748b;
  font-weight: 800;
  font-size: 12px;
}
.dash-tr span:nth-child(n+3) {
  text-align: right;
}
.card-value.pnl-pos,
.dash-hero-num.pnl-pos,
.kv2 b.pnl-pos,
.dash-tr .pnl-pos { color: #dc2626; }
.card-value.pnl-neg,
.dash-hero-num.pnl-neg,
.kv2 b.pnl-neg,
.dash-tr .pnl-neg { color: #2563eb; }
@media (max-width: 760px) {
  .dash-two-col { grid-template-columns: 1fr; }
  .dash-hero { grid-template-columns: 1fr; }
  .dash-table { min-width: 640px; }
}
@media (prefers-color-scheme: dark) {
  .dash-sublist span { background: #111827; border-color: #334155; color: #cbd5e1; }
  .dash-note { color: #94a3b8; }
  .dash-tr { border-color: #263244; }
  .dash-th { color: #94a3b8; }
}

/* Galaxy S25 dashboard rebuild */
.s25-dash {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 8px 10px 28px;
  display: grid;
  gap: 10px;
}
.s25-dash a { text-decoration: none; }
.s25-today-card {
  border-radius: 18px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 14px 34px rgba(15,23,42,.18);
}
.s25-today-toggle {
  position: relative;
  width: 100%;
  min-height: 128px;
  border: 0;
  padding: 18px 18px 16px;
  display: grid;
  gap: 4px;
  text-align: left;
  color: #f8fafc;
  background:
    linear-gradient(135deg, rgba(20,184,166,.92), rgba(37,99,235,.92) 52%, rgba(244,63,94,.86));
  text-decoration: none;
}
.s25-today-toggle:focus-visible { outline: 3px solid rgba(37,99,235,.28); outline-offset: 3px; }
.s25-eyebrow {
  color: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 900;
}
.s25-today-toggle strong {
  display: block;
  font-size: 38px;
  line-height: 1.06;
  letter-spacing: 0;
  color: #fff;
}
.s25-today-toggle strong.pnl-pos { color: #fff7ed; }
.s25-today-toggle strong.pnl-neg { color: #dbeafe; }
.s25-today-toggle small {
  color: rgba(255,255,255,.82);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
.s25-card-action {
  align-self: end;
  color: rgba(255,255,255,.88);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}
.s25-caret {
  position: absolute;
  right: 16px;
  top: 16px;
  font-style: normal;
  font-weight: 900;
  transition: transform .16s;
}
.s25-today-toggle[aria-expanded="true"] .s25-caret { transform: rotate(180deg); }
.s25-breakdown {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #0b1220;
}
.s25-money-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 11px 12px;
  border-radius: 13px;
  color: #f8fafc;
  border: 1px solid rgba(255,255,255,.12);
}
.s25-money-row b { display: block; font-size: 14px; letter-spacing: 0; }
.s25-money-row small { display: block; margin-top: 2px; color: rgba(255,255,255,.72); font-size: 12px; }
.s25-money-row strong { white-space: nowrap; font-size: 15px; }
.tone-danta { --tone: #f97316; --tone2: #ef4444; --soft: #fff7ed; }
.tone-strategy { --tone: #14b8a6; --tone2: #2563eb; --soft: #ecfeff; }
.tone-portfolio { --tone: #8b5cf6; --tone2: #ec4899; --soft: #faf5ff; }
.tone-agents { --tone: #22c55e; --tone2: #06b6d4; --soft: #f0fdf4; }
.s25-money-row.tone-danta,
.s25-money-row.tone-strategy,
.s25-money-row.tone-portfolio {
  background: linear-gradient(135deg, var(--tone), var(--tone2));
}
.s25-dayline {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}
.s25-day-left { min-width: 0; }
.s25-day-left b { display: block; color: #64748b; font-size: 11px; line-height: 1.15; white-space: normal; }
.s25-day-left span { display: block; margin-top: 4px; color: #0f172a; font-size: 21px; font-weight: 900; line-height: 1; letter-spacing: 0; }
.s25-market-wrap { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 8px; }
.s25-market-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.s25-market-wrap > span {
  min-width: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.s25-market-wrap > em {
  grid-column: 1 / -1;
  color: #2563eb;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}
.market-ok { background: #ecfdf5; color: #047857; }
.market-hot { background: #fef2f2; color: #dc2626; }
.market-cold { background: #eff6ff; color: #1d4ed8; }
.market-risk { background: #fef2f2; color: #dc2626; }
.market-closed, .market-wait { background: #f1f5f9; color: #475569; }
.s25-market-index { font-weight: 500; }
.s25-market-index.pnl-pos { color: #dc2626; }
.s25-market-index.pnl-neg { color: #2563eb; }
.s25-dot { color: #94a3b8; }
.s25-dayline { cursor: pointer; }
.s25-dayline:focus-visible { outline: 3px solid rgba(37,99,235,.25); outline-offset: 2px; }
.s25-watch-panel {
  margin-top: -4px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15,23,42,.05);
}
.s25-watch-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.s25-watch-head b { color: #0f172a; font-size: 14px; font-weight: 900; }
.s25-watch-head small { color: #64748b; font-size: 11px; white-space: nowrap; }
.s25-watch-list { display: grid; gap: 7px; }
.s25-index-grid { display: grid; grid-template-columns: 1fr; gap: 7px; }
.s25-index-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 64px;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 7px 2px;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
  background: transparent;
  color: #0f172a;
}
.s25-index-card.is-primary {
  min-height: 48px;
}
.s25-index-card b { display: block; font-size: 13px; font-weight: 700; }
.s25-index-card small { display: block; margin-top: 2px; color: #64748b; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s25-index-card strong { font-size: 16px; font-weight: 600; white-space: nowrap; }
.s25-index-card em { justify-self: end; font-size: 13px; font-style: normal; font-weight: 600; white-space: nowrap; }
.s25-topic-title {
  margin-top: 3px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}
.s25-topic-row {
  display: grid;
  grid-template-columns: minmax(88px, .4fr) minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 2px;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
}
.s25-topic-row[href]:hover strong { text-decoration: underline; }
.s25-topic-row b { display: block; color: #0f172a; font-size: 12px; font-weight: 900; }
.s25-topic-row small { display: block; margin-top: 2px; color: #64748b; font-size: 10px; }
.s25-topic-row strong { min-width: 0; color: #0f172a; font-size: 12px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.s25-news-row {
  display: block;
  min-height: 0;
  padding: 8px 2px;
}
.s25-news-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.s25-news-meta b {
  display: inline;
  flex: 0 0 auto;
}
.s25-news-meta small {
  display: inline;
  margin-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.s25-news-title {
  display: block;
  margin-top: 3px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}
.s25-watch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 58px;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  text-decoration: none;
}
.s25-watch-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.s25-watch-row small { display: block; margin-top: 2px; color: #64748b; font-size: 11px; }
.s25-watch-row strong { font-size: 14px; font-weight: 900; white-space: nowrap; }
.s25-watch-row em { justify-self: end; font-size: 13px; font-style: normal; font-weight: 900; white-space: nowrap; }
.s25-stack { display: grid; gap: 10px; }
.s25-rail {
  border: 1px solid #e2e8f0;
  border-left: 6px solid var(--tone);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15,23,42,.06);
}
.s25-rail-head {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  align-items: center;
  gap: 11px;
  border: 0;
  background: linear-gradient(90deg, var(--soft), #fff 68%);
  padding: 12px;
  color: #0f172a;
  text-align: left;
}
.s25-rail-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--tone), var(--tone2));
  color: #fff;
  font-weight: 900;
  font-size: 16px;
}
.s25-rail-head b { display: block; font-size: 17px; letter-spacing: 0; }
.s25-rail-head small { display: block; margin-top: 2px; color: #64748b; font-size: 12px; line-height: 1.3; }
.s25-rail-head strong { white-space: nowrap; font-size: 16px; letter-spacing: 0; }
.s25-rail-body {
  padding: 11px 12px 13px;
  border-top: 1px solid #eef2f7;
  background: #fff;
}
.s25-rounds { display: grid; gap: 7px; }
.s25-round {
  display: grid;
  grid-template-columns: minmax(76px,.85fr) minmax(72px,.8fr) minmax(82px,.9fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: #0f172a;
  background: #f8fafc;
}
.s25-round b { display: block; font-size: 14px; }
.s25-round small { display: block; margin-top: 2px; color: #64748b; font-size: 11px; }
.s25-round span { font-size: 12px; color: #475569; }
.s25-round strong { font-size: 13px; white-space: nowrap; }
.s25-kv-list { display: grid; gap: 4px; }
.s25-kv {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f7;
  font-size: 13px;
}
.s25-kv:last-child { border-bottom: 0; }
.s25-kv span { color: #64748b; }
.s25-kv b { color: #0f172a; }
.s25-go {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 10px;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  font-weight: 900;
  font-size: 13px;
}
.s25-agents { display: grid; gap: 7px; }
.s25-agent {
  display: grid;
  grid-template-columns: 10px minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px 9px;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
}
.s25-agent span { width: 9px; height: 9px; border-radius: 999px; background: #94a3b8; }
.s25-agent span.on { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.14); }
.s25-agent span.off { background: #f97316; }
.s25-agent b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.s25-agent small { color: #64748b; font-size: 12px; }
.s25-empty { padding: 12px; border-radius: 12px; background: #f8fafc; color: #64748b; font-size: 13px; }
.s25-dash .pnl-pos { color: #dc2626; }
.s25-dash .pnl-neg { color: #2563eb; }
.s25-dash .pnl-flat { color: inherit; }
@media (min-width: 720px) {
  .s25-dash { width: min(720px, 100%); grid-template-columns: 1fr; }
  .s25-round { grid-template-columns: minmax(100px,1fr) 1fr 1fr auto; }
}
@media (max-width: 390px) {
  .s25-dash { padding-left: 7px; padding-right: 7px; }
  .s25-today-toggle strong { font-size: 33px; }
  .s25-round { grid-template-columns: 1fr auto; }
  .s25-round span:nth-child(2), .s25-round span:nth-child(3) { font-size: 11px; }
}
@media (prefers-color-scheme: dark) {
  .s25-dayline, .s25-watch-panel, .s25-rail, .s25-rail-body { background: #0f172a; border-color: #334155; }
  .s25-rail-head { background: linear-gradient(90deg, rgba(30,41,59,.92), #0f172a 70%); color: #f8fafc; }
  .s25-rail-head small, .s25-kv span, .s25-round small, .s25-agent small, .s25-day-left b, .s25-watch-head small, .s25-watch-row small { color: #94a3b8; }
  .s25-round, .s25-agent, .s25-watch-row, .s25-empty { background: #111827; border-color: #334155; color: #e2e8f0; }
  .s25-index-card, .s25-topic-row { background: transparent; border-color: #334155; color: #e2e8f0; }
  .s25-kv, .s25-rail-body { border-color: #263244; }
  .s25-kv b, .s25-day-left span, .s25-market-wrap > span, .s25-watch-head b, .s25-watch-row b, .s25-watch-row strong, .s25-index-card b, .s25-index-card strong, .s25-topic-title, .s25-topic-row b, .s25-topic-row strong { color: #f8fafc; }
  .s25-market-wrap > em { color: #93c5fd; }
}

/* S25 today card no duplicate breakdown */
@media (max-width: 380px) {
  .s25-dayline { grid-template-columns: 112px minmax(0, 1fr); }
  .s25-day-left b { font-size: 10px; }
  .s25-day-left span { font-size: 19px; }
}


/* ───────────────── 포트폴리오 목표 프롬프트 폼 (Galaxy S25 Ultra 세로 기준) ───────────────── */
.pf-invest-fold {
  max-width: 720px; margin: 0 0 14px; border: 1px solid #dbe4f0; border-radius: 12px;
  background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.03); overflow: hidden;
}
.pf-fold-summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; cursor: pointer; color: #0f172a; -webkit-tap-highlight-color: transparent;
}
.pf-fold-summary::-webkit-details-marker { display: none; }
.pf-fold-summary b { display: block; font-size: 18px; line-height: 1.2; }
.pf-fold-summary small { display: block; margin-top: 3px; color: #64748b; font-size: 12px; font-weight: 800; line-height: 1.35; }
.pf-fold-summary em {
  flex: 0 0 auto; font-style: normal; padding: 6px 10px; border-radius: 999px;
  background: #ecfdf5; color: #047857; font-size: 12px; font-weight: 900;
}
.pf-invest-fold[open] .pf-fold-summary { border-bottom: 1px solid #edf2f7; }
.pf-invest-fold[open] .pf-fold-summary em { background: #f1f5f9; color: #475569; }
.pf-invest-fold[open] .pf-fold-summary em::before { content: "닫기"; }
.pf-invest-fold[open] .pf-fold-summary em { font-size: 0; }
.pf-invest-fold[open] .pf-fold-summary em::before { font-size: 12px; }
.pf-goalform { max-width: 520px; }
.pf-phone-form { padding: 14px; }
.pf-field { display: block; margin: 0 0 10px; }
.pf-step-field { position: relative; padding: 11px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.pf-flabel { display: block; font-size: 13px; font-weight: 900; color: #334155; margin-bottom: 7px; }
.pf-flabel small { display: inline; margin-left: 6px; font-weight: 700; color: #94a3b8; font-size: 11px; line-height: 1.25; }
.pf-inline-field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(132px, 168px); align-items: center; gap: 8px 10px; }
.pf-inline-field .pf-flabel { margin-bottom: 0; }
.pf-inline-field .pf-inwrap, .pf-inline-field > select.pf-in { grid-column: 2; }
.pf-inline-field .pf-stages, .pf-inline-field .pf-add, .pf-inline-field .pf-sum { grid-column: 1 / -1; }
.pf-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pf-mode {
  min-width: 0; min-height: 62px; padding: 10px 9px; border: 1px solid #cbd5e1; border-radius: 11px;
  background: #f8fafc; color: #334155; text-align: left; cursor: pointer;
}
.pf-mode b { display: block; font-size: 14px; color: #0f172a; line-height: 1.2; }
.pf-mode small { display: block; margin-top: 4px; color: #64748b; font-size: 11px; font-weight: 800; line-height: 1.25; }
.pf-mode.on { border-color: #0f766e; background: #ecfdf5; box-shadow: inset 4px 0 0 #14b8a6; }
.pf-mode.on b { color: #0f766e; }
.pf-sector-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.pf-sector {
  min-height: 38px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 10px;
  background: #f8fafc; color: #475569; font-size: 13px; font-weight: 800; line-height: 1; cursor: pointer;
}
.pf-sector.on { border-color: #0f766e; background: #ecfdf5; color: #0f766e; box-shadow: inset 3px 0 0 #14b8a6; }
.pf-sector-custom { border-style: dashed; color: #64748b; }
.pf-sector-hint {
  margin-top: 9px; padding: 8px 11px; font-size: 12px; font-weight: 700; line-height: 1.5;
  color: #0f766e; background: #ecfdf5; border: 1px solid #99f6e4; border-radius: 9px;
}
#pf-sector-custom-input { margin-top: 8px; }
.pf-self-row2 { display: flex; gap: 8px; margin-top: 8px; }
.pf-self-row2 .pf-inwrap { flex: 1; } .pf-self-row2 select.pf-in { flex: 1; }
.pf-self-results { margin-top: 6px; border-radius: 9px; overflow: hidden; }
.pf-self-rrow { display: flex; justify-content: space-between; padding: 9px 11px; font-size: 13px; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; cursor: pointer; }
.pf-self-rrow .c { color: #64748b; font-size: 11px; }
.pf-self-empty { padding: 10px; font-size: 12px; color: #94a3b8; text-align: center; }
.pf-self-picks { display: flex; flex-direction: column; gap: 7px; margin: 4px 0; }
.pf-self-pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 11px; }
.pf-self-pick .n b { font-size: 13px; color: #0f172a; }
.pf-self-pick .n small { display: block; font-size: 10.5px; color: #64748b; }
.pf-self-pick .q { display: flex; align-items: center; gap: 9px; }
.pf-self-pick .amt { font-size: 12px; color: #0f172a; min-width: 66px; text-align: right; }
.pf-self-pick .x { color: #94a3b8; cursor: pointer; font-style: normal; }
.pf-step { display: inline-flex; align-items: center; border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden; }
.pf-step i { padding: 4px 9px; color: #475569; background: #eef2f7; cursor: pointer; font-style: normal; font-size: 13px; }
.pf-step b { padding: 4px 8px; font-size: 12px; min-width: 32px; text-align: center; color: #0f172a; }
.pf-self-sum { display: flex; justify-content: space-between; align-items: baseline; background: #ecfdf5; border: 1px solid #99f6e4; border-radius: 10px; padding: 9px 12px; margin: 8px 0 11px; font-size: 12px; color: #0f766e; }
.pf-self-sum b { font-size: 15px; color: #0f766e; } .pf-self-sum b.loss { color: #2563eb; }
.pf-self-sum .r { font-size: 11px; color: #64748b; }
@media (prefers-color-scheme: dark) {
  .pf-self-rrow { background: #0f1f3a; border-color: #1e293b; }
  .pf-self-empty { color: #64748b; }
  .pf-self-pick { background: #0f172a; border-color: #1e293b; }
  .pf-self-pick .n b { color: #f1f5f9; } .pf-self-pick .amt { color: #f1f5f9; }
  .pf-step { border-color: #334155; } .pf-step i { background: #1e293b; color: #cbd5e1; } .pf-step b { color: #f1f5f9; }
  .pf-self-sum { background: #042f2e; border-color: #0f766e; color: #5eead4; } .pf-self-sum b { color: #99f6e4; }
}
.pf-compact { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; margin-bottom: 9px; cursor: pointer; }
.pf-compact .n b { font-size: 14px; color: #0f172a; }
.pf-compact .n small { display: block; font-size: 11px; color: #64748b; }
.pf-compact .r { text-align: right; }
.pf-compact .r b { font-size: 15px; }
.pf-compact .r small { display: block; font-size: 11px; color: #64748b; }
.pf-compact .r b.gain { color: #dc2626; }
.pf-compact .r b.loss { color: #2563eb; }
.pf-back { background: none; border: 1px solid #cbd5e1; border-radius: 8px; padding: 6px 12px; font-size: 13px; color: #334155; cursor: pointer; margin-bottom: 11px; }
@media (prefers-color-scheme: dark) {
  .pf-compact { background: #0f172a; border-color: #1e293b; }
  .pf-compact .n b { color: #f1f5f9; }
  .pf-compact .n small, .pf-compact .r small { color: #94a3b8; }
  .pf-back { border-color: #334155; color: #cbd5e1; }
}
.pf-in {
  width: 100%; box-sizing: border-box; height: 44px; padding: 0 12px;
  font-size: 15px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; color: #0f172a;
  -webkit-appearance: none; appearance: none;
}
.pf-in:focus { outline: none; border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15,118,110,.14); }
select.pf-in { background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none' stroke-linecap='round'/></svg>") no-repeat right 12px center; padding-right: 34px; }
.pf-textarea { height: auto; min-height: 118px; padding: 11px 12px; line-height: 1.45; resize: vertical; }
.pf-editor-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin-bottom: 8px; }
.pf-prompt-select { height: 38px; font-size: 12.5px; }
.pf-title-input { height: 38px; margin-bottom: 8px; font-size: 13px; font-weight: 800; }
.pf-editor {
  min-height: 190px; font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px; line-height: 1.55; white-space: pre-wrap;
}
.pf-editor-status { margin-top: 7px; font-size: 11.5px; font-weight: 900; color: #64748b; }
.pf-editor-status.ok { color: #0f766e; }
.pf-editor-status.warn { color: #b45309; }
.pf-editor-status.bad { color: #dc2626; }
.pf-editor-actions { grid-template-columns: 1fr 1fr 1fr 1fr; }
.pf-editor-receipt {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 8px; padding: 8px 9px;
  border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; color: #475569; font-size: 11.5px; line-height: 1.35;
}
.pf-editor-receipt[hidden] { display: none; }
.pf-editor-receipt b { color: #0f172a; }
.pf-editor-receipt span { color: #64748b; }
.pf-editor-receipt.ok { border-color: #99f6e4; background: #f0fdfa; }
.pf-editor-receipt.bad { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.pf-analysis-loader {
  margin: 12px 0; padding: 13px; border: 1px solid #99f6e4; border-radius: 13px;
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%); color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 118, 110, .08);
}
.pf-loader-top { display: grid; grid-template-columns: 38px minmax(0, 1fr) 52px; align-items: center; gap: 10px; }
.pf-loader-bot {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px;
  background: #ccfbf1; animation: pfBotPulse 1.4s ease-in-out infinite;
}
.pf-loader-top b { display: block; font-size: 14px; color: #0f766e; }
.pf-loader-top small { display: block; margin-top: 2px; font-size: 11.5px; color: #64748b; font-weight: 800; }
.pf-loader-top strong { text-align: right; color: #0f766e; font-size: 16px; }
.pf-loader-bar {
  position: relative; overflow: hidden; height: 10px; margin: 12px 0 10px;
  border-radius: 999px; background: #dbeafe;
}
.pf-loader-bar i {
  display: block; width: 0%; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #2563eb, #14b8a6);
  background-size: 180% 100%; transition: width .45s ease; animation: pfBarFlow 1.15s linear infinite;
}
.pf-loader-steps { display: grid; gap: 5px; }
.pf-loader-steps span {
  position: relative; padding-left: 18px; font-size: 11.5px; color: #94a3b8; line-height: 1.3;
}
.pf-loader-steps span::before {
  content: ""; position: absolute; left: 2px; top: .3em; width: 8px; height: 8px;
  border-radius: 999px; background: #cbd5e1;
}
.pf-loader-steps span.done { color: #0f766e; }
.pf-loader-steps span.done::before { background: #14b8a6; }
.pf-loader-steps span.on { color: #1d4ed8; font-weight: 900; }
.pf-loader-steps span.on::before { background: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); }
.pf-loader-foot {
  display: flex; justify-content: space-between; gap: 10px; margin-top: 10px;
  font-size: 11px; color: #64748b; font-weight: 800;
}
@keyframes pfBarFlow { from { background-position: 0% 50%; } to { background-position: 180% 50%; } }
@keyframes pfBotPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 0 0 0 rgba(20, 184, 166, .18); }
  50% { transform: translateY(-2px); box-shadow: 0 0 0 7px rgba(20, 184, 166, 0); }
}
.pf-inwrap { display: flex; align-items: center; gap: 8px; }
.pf-inwrap .pf-in { flex: 1; min-width: 0; }
.pf-unit { flex: 0 0 auto; font-size: 12px; color: #64748b; white-space: nowrap; font-style: normal; }
.pf-stages { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.pf-stage-row { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr) 34px; align-items: center; gap: 6px; }
.pf-stage-row .pf-in { height: 40px; font-size: 14px; padding: 0 9px; }
.pf-stage-del { width: 34px; height: 40px; border: 1px solid #fecaca; background: #fff;
  color: #dc2626; border-radius: 9px; font-size: 17px; cursor: pointer; }
.pf-add { width: 100%; margin-top: 8px; height: 40px; border: 1px dashed #99f6e4; background: #f0fdfa;
  color: #0f766e; border-radius: 10px; font-size: 12.5px; font-weight: 900; cursor: pointer; }
.pf-add:active, .pf-build:active, .pf-ex:active { transform: translateY(1px); }
.pf-sum { font-size: 12px; color: #0f766e; font-weight: 900; margin-top: 7px; line-height: 1.35; }
.pf-command-field { background: #f8fafc; }
.pf-prompt-actions { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-top: 8px; }
.pf-build { min-height: 38px; border: 1px solid #0f766e; background: #0f766e; color: #fff;
  border-radius: 9px; font-size: 12.5px; font-weight: 900; cursor: pointer; padding: 0 10px; }
.pf-build.ghost { background: #fff; color: #475569; border-color: #cbd5e1; }
.pf-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 9px; }
.pf-ex-title { font-size: 11px; color: #94a3b8; font-weight: 900; }
.pf-ex { font-size: 12px; font-weight: 900; padding: 6px 10px; border: 1px solid #cbd5e1;
  background: #fff; color: #334155; border-radius: 999px; cursor: pointer; }
.pf-deeprow { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: #334155;
  margin: 10px 0 12px; line-height: 1.35; }
.pf-deeprow small { display: block; color: #94a3b8; font-weight: 700; }
.pf-deeprow input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; }
.pf-bigbtn { width: 100%; height: 48px; font-size: 15px; font-weight: 900; border-radius: 12px; margin-bottom: 9px; }
.pf-disc { font-size: 11px; color: #94a3b8; margin: 8px 0 0; line-height: 1.45; }
.pf-plan-card { margin: 12px 0; padding: 13px; border-radius: 12px; border: 1px solid #bbf7d0;
  background: #f0fdf4; color: #0f172a; }
.pf-plan-card.warn { border-color: #fde68a; background: #fffbeb; }
.pf-plan-card.danger { border-color: #fecaca; background: #fef2f2; }
.pf-plan-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.pf-plan-head b { font-size: 15px; }
.pf-plan-head span { flex: 0 0 auto; font-size: 12px; font-weight: 900; color: #047857;
  background: rgba(255,255,255,.72); border: 1px solid rgba(15,23,42,.08); border-radius: 999px; padding: 4px 8px; }
.pf-plan-card.warn .pf-plan-head span { color: #b45309; }
.pf-plan-card.danger .pf-plan-head span { color: #b91c1c; }
.pf-plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.pf-plan-grid span { min-width: 0; padding: 8px; border-radius: 9px; background: rgba(255,255,255,.72);
  border: 1px solid rgba(15,23,42,.06); }
.pf-plan-grid small { display: block; color: #64748b; font-size: 11px; font-weight: 800; margin-bottom: 3px; }
.pf-plan-grid b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.pf-plan-card p { margin: 10px 0 0; color: #475569; font-size: 12.5px; line-height: 1.45; }
.pf-plan-prompt { margin-top: 8px; padding: 8px; border-radius: 8px; background: rgba(15,23,42,.05);
  color: #334155; font-size: 12px; line-height: 1.45; }
.pf-ai-comment { margin-top: 8px; padding: 8px; border-radius: 8px; background: #eef2ff;
  color: #3730a3; font-size: 12.5px; line-height: 1.45; }
.pf-data-status { margin: 10px 0; padding: 9px 10px; border-radius: 10px; border: 1px solid #bbf7d0;
  background: #f0fdf4; color: #064e3b; font-size: 12px; line-height: 1.35; }
.pf-data-status.warn { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.pf-data-status b { display: block; font-size: 13px; }
.pf-data-status span { display: block; margin-top: 2px; color: #64748b; overflow-wrap: anywhere; }
.pf-score-cell { background: #fffbeb; color: #78350f; font-size: 12px; padding: 9px 10px !important; }
.pf-score-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.pf-score-head b { font-size: 13px; color: #92400e; }
.pf-score-head span { color: #a16207; font-size: 11px; font-weight: 800; }
.pf-score-scroll { overflow-x: auto; border: 1px solid #fde68a; border-radius: 8px; background: #fff; }
.pf-score-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.pf-score-table th, .pf-score-table td { border-bottom: 1px solid #fef3c7; padding: 7px 8px; text-align: left; vertical-align: top; line-height: 1.35; }
.pf-score-table th { background: #fef3c7; color: #78350f; font-size: 11px; white-space: nowrap; }
.pf-score-table td:first-child { width: 86px; white-space: nowrap; font-weight: 900; }
.pf-score-table td.num { width: 58px; text-align: right; font-weight: 900; color: #0f172a; white-space: nowrap; }
.pf-score-table tr.ai td:first-child { color: #3730a3; }
.pf-score-table tr.engine td:first-child { color: #0f766e; }
.pf-score-note { margin-top: 7px; color: #92400e; font-size: 11.5px; line-height: 1.45; }
/* AI 분석 보기 — 일일 재분석 판정·메타·추이 그래프 */
.pf-verdict { font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 999px; }
.pf-verdict.hold { background: #d1fae5; color: #065f46; }
.pf-verdict.trim { background: #fef3c7; color: #92400e; }
.pf-verdict.sell { background: #dbeafe; color: #1e40af; }
.pf-verdict-box { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px; border-radius: 10px; margin-bottom: 9px; background: #f8fafc; border-left: 3px solid #94a3b8; }
.pf-verdict-box.hold { background: #ecfdf5; border-left-color: #10b981; }
.pf-verdict-box.trim { background: #fffbeb; border-left-color: #f59e0b; }
.pf-verdict-box.sell { background: #eff6ff; border-left-color: #3b82f6; }
.pf-verdict-box b { font-size: 12.5px; color: #0f172a; }
.pf-verdict-box span { font-size: 12.5px; color: #334155; line-height: 1.5; }
.pf-anal-meta { font-size: 11px; color: #94a3b8; font-weight: 800; margin-bottom: 9px; }
.pf-fresh { color: #0f766e; }
.pf-trend-wrap { margin-top: 11px; padding-top: 9px; border-top: 1px dashed #e2e8f0; }
.pf-trend-svg { width: 100%; height: auto; display: block; }
.pf-trend-ph { font-size: 11.5px; color: #94a3b8; text-align: center; padding: 14px 6px; line-height: 1.5; }
.pf-trend-legend { display: flex; gap: 12px; align-items: center; margin-top: 5px; font-size: 11px; color: #64748b; font-weight: 800; }
.pf-trend-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.pf-trend-now { margin-left: auto; }
.pf-trend-now.gain { color: #dc2626; }
.pf-trend-now.loss { color: #2563eb; }
.pf-trend-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 2px 4px; font-size: 12px; font-weight: 800; color: #64748b; }
.pf-trend-range { font-size: 11px; font-weight: 800; color: #64748b; }
.pf-trend-range b.gain { color: #dc2626; }
.pf-trend-range b.loss { color: #2563eb; }
.pf-overview { margin: 0 0 14px; }
.pf-ov-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 13px 15px; }
.pf-ov-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 11px; gap: 10px; }
.pf-ov-top small { display: block; font-size: 11px; color: #64748b; }
.pf-ov-top b { font-size: 17px; color: #0f172a; }
.pf-ov-top .r { text-align: right; }
.pf-ov-top b.gain { color: #dc2626; }
.pf-ov-top b.loss { color: #2563eb; }
.pf-ov-title { font-size: 12px; font-weight: 800; color: #334155; margin-bottom: 9px; }
.pf-ov-title small { color: #94a3b8; font-weight: 400; }
.pf-ov-donut { display: flex; gap: 14px; align-items: center; }
.pf-ov-donut svg { width: 124px; height: 124px; flex: none; }
.pf-ov-legend { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #334155; font-weight: 800; min-width: 0; }
.pf-ov-leg i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.pf-ov-leg b { float: right; color: #64748b; }
@media (prefers-color-scheme: dark) {
  .pf-ov-card { background: #0f172a; border-color: #1e293b; }
  .pf-ov-top b { color: #f8fafc; }
  .pf-ov-top small { color: #94a3b8; }
  .pf-ov-title { color: #cbd5e1; }
  .pf-ov-legend { color: #cbd5e1; }
}
.pf-score-item { padding: 9px 0; border-bottom: 0.5px solid #e2e8f0; }
.pf-score-item:last-child { border-bottom: 0; }
.pf-score-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pf-score-item-name { font-size: 13px; font-weight: 900; color: #0f172a; }
.pf-score-item.ai .pf-score-item-name { color: #3730a3; }
.pf-score-item.engine .pf-score-item-name { color: #0f766e; }
.pf-score-item-pt { font-size: 13px; font-weight: 900; color: #334155; white-space: nowrap; }
.pf-score-item-mean { font-size: 12px; color: #475569; margin-top: 3px; line-height: 1.5; }
.pf-score-item-detail { font-size: 11.5px; color: #64748b; margin-top: 3px; line-height: 1.55; }
.pf-score-item-src { font-size: 10.5px; color: #94a3b8; margin-top: 3px; }
.pf-ai-view { margin-top: 10px; }
.pf-ai-view-box { padding: 10px 12px; border-radius: 10px; background: #eef2ff; border-left: 3px solid #6366f1; }
.pf-ai-view-box b { font-size: 12.5px; color: #3730a3; }
.pf-ai-view-box p { margin: 5px 0 0; font-size: 12.5px; color: #334155; line-height: 1.6; white-space: pre-wrap; }
.pf-ai-view-msg { font-size: 12px; color: #94a3b8; padding: 8px 2px; }
.pf-ai-view-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pf-ai-when { font-size: 11px; font-weight: 700; color: #6366f1; white-space: nowrap; }
.pf-ai-refresh { margin-top: 8px; font-size: 11.5px; font-weight: 800; color: #3730a3; background: #e0e7ff; border: 1px solid #c7d2fe; border-radius: 8px; padding: 5px 11px; cursor: pointer; }
.pf-ai-refresh:disabled { opacity: 0.6; cursor: default; }
.pf-rebal-box { margin-top: 9px; padding: 10px; border: 1px solid #fde68a; border-radius: 10px;
  background: #fffbeb; color: #0f172a; font-size: 12.5px; }
.pf-rebal-box > b { display: block; margin-bottom: 7px; font-size: 13px; }
.pf-rebal-box p { margin: 6px 0 0; color: #64748b; line-height: 1.45; }
.pf-rebal-actions { display: grid; gap: 6px; }
.pf-rebal-actions div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 4px 8px;
  padding: 7px; border-radius: 8px; background: rgba(255,255,255,.72); border: 1px solid rgba(15,23,42,.06); }
.pf-rebal-actions span { color: #b45309; font-weight: 900; }
.pf-rebal-actions strong { min-width: 0; overflow-wrap: anywhere; }
.pf-rebal-actions small { grid-column: 2; color: #64748b; line-height: 1.35; }
.pf-rebal-repl { display: grid; gap: 6px; margin-top: 10px; }
.pf-rebal-repl > b { font-size: 13px; }
.pf-rebal-repl span { display: block; padding: 7px; border-radius: 8px; background: #f0fdf4; border: 1px solid #bbf7d0; }
.pf-rebal-repl strong { display: block; }
.pf-rebal-repl small { display: block; margin-top: 2px; color: #475569; line-height: 1.35; }
.pf-verify { margin: 11px 0; padding: 11px; border-radius: 12px; border: 1px solid #bbf7d0; background: #f0fdf4; }
.pf-verify.bad { border-color: #fecaca; background: #fef2f2; }
.pf-verify > div:first-child { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.pf-verify b { color: #0f766e; font-size: 13px; }
.pf-verify.bad b { color: #dc2626; }
.pf-verify small { color: #64748b; font-size: 11px; font-weight: 800; }
.pf-verify dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 9px 0 0; }
.pf-verify dl div { padding: 7px; border-radius: 9px; background: rgba(255,255,255,.75); border: 1px solid rgba(15,23,42,.06); }
.pf-verify dt { font-size: 10.5px; color: #94a3b8; font-weight: 900; }
.pf-verify dd { margin: 2px 0 0; color: #0f172a; font-size: 12px; font-weight: 900; }
.pf-verify details { margin-top: 8px; font-size: 12px; }
.pf-excluded { display: flex; flex-direction: column; gap: 4px; margin-top: 7px; color: #64748b; }
.pf-port-summary { margin: 10px 0; padding: 10px 11px; border-radius: 11px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; font-size: 12.5px; line-height: 1.45; }
.pf-pick-summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 12px 0 8px; color: #0f172a; }
.pf-pick-summary b { font-size: 14px; }
.pf-pick-summary span { font-size: 12px; color: #64748b; font-weight: 900; }
.pf-pick-list { display: grid; gap: 9px; }
.pf-pick-card { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 0; color: #0f172a; overflow: hidden; }
.pf-pick-card[open] { box-shadow: 0 10px 24px rgba(15,23,42,.08); }
.pf-pick-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) 54px; align-items: center; gap: 8px; }
.pf-pick-card > .pf-pick-head { padding: 11px; cursor: pointer; list-style: none; }
.pf-pick-card > .pf-pick-head::-webkit-details-marker { display: none; }
.pf-rank { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; background: #0f766e; color: #fff; font-size: 12px; font-weight: 900; }
.pf-pick-head b { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.pf-pick-head small { display: block; margin-top: 2px; color: #94a3b8; font-size: 11px; font-weight: 900; }
.pf-pick-head strong { text-align: right; color: #dc2626; font-size: 16px; }
.pf-pick-body { padding: 0 11px 11px; }
.pf-pick-card p { margin: 8px 0; color: #475569; font-size: 12.5px; line-height: 1.45; }
.pf-pick-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 8px; }
.pf-pick-tags span { padding: 4px 7px; border-radius: 999px; background: #e0f2fe; color: #075985; font-size: 10.5px; font-weight: 900; }
.pf-pick-tags .muted { background: #f1f5f9; color: #64748b; }
.pf-pick-money { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px; border-radius: 10px; background: #f8fafc; font-size: 12px; }
.pf-pick-money span { color: #64748b; font-weight: 800; }
.pf-pick-money b { color: #0f172a; }
.pf-pick-money em { font-style: normal; color: #0f766e; font-weight: 900; }
.pf-day-line { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 6px; padding: 7px 8px; border-radius: 10px; background: #fff7ed; font-size: 12px; }
.pf-day-line span { color: #94a3b8; font-weight: 900; }
.pf-day-line b { text-align: right; }
.pf-pick-card details { margin-top: 8px; border-top: 1px solid #e2e8f0; padding-top: 8px; }
.pf-pick-card summary { cursor: pointer; color: #0f766e; font-size: 12px; font-weight: 900; }
.pf-score-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 8px 0; }
.pf-score-mini div, .pf-track-grid span { padding: 7px; border-radius: 9px; background: #f8fafc; border: 1px solid #e2e8f0; }
.pf-score-mini b, .pf-track-grid b { display: block; color: #0f172a; font-size: 13px; }
.pf-score-mini span, .pf-track-grid small { display: block; color: #94a3b8; font-size: 10.5px; font-weight: 900; }
.pf-score-line { display: grid; gap: 3px; padding: 8px 0; border-top: 1px dashed #e2e8f0; font-size: 11.5px; }
.pf-score-line b { color: #0f766e; }
.pf-score-line.ai b { color: #3730a3; }
.pf-score-line span { color: #334155; line-height: 1.35; }
.pf-score-line small { color: #94a3b8; line-height: 1.35; }
.pf-track-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.pf-deep-card { margin-top: 8px; padding: 9px; border-radius: 10px; background: #eef2ff; color: #3730a3; white-space: pre-wrap; font-size: 12px; line-height: 1.45; }
.pf-mini-muted { color: #94a3b8; font-size: 12px; }
.pf-investments { margin-top: 14px; }
.pf-invest-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.pf-invest-head b { display: block; color: #0f172a; font-size: 18px; }
.pf-invest-head small { display: block; margin-top: 2px; color: #64748b; font-size: 12px; font-weight: 800; }
.pf-card-list { display: grid; gap: 10px; }
.pf-empty { padding: 14px; border: 1px dashed #cbd5e1; border-radius: 10px; color: #64748b; background: #f8fafc; font-size: 13px; line-height: 1.45; }
.pf-live-card { border: 1px solid #dbe4f0; border-radius: 12px; background: #fff; padding: 10px; }
.pf-live-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.pf-live-head b { display: block; color: #0f172a; font-size: 14px; line-height: 1.25; }
.pf-live-head small { display: block; margin-top: 2px; color: #94a3b8; font-size: 11px; font-weight: 800; }
.pf-live-badge { padding: 4px 7px; border-radius: 999px; background: #ecfdf5; color: #047857; font-size: 10.5px; font-weight: 900; white-space: nowrap; }
.pf-live-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.pf-live-stats span { min-width: 0; padding: 7px; border-radius: 9px; background: #f8fafc; border: 1px solid #edf2f7; }
.pf-live-stats small { display: block; color: #94a3b8; font-size: 10.5px; font-weight: 900; }
.pf-live-stats b { display: block; margin-top: 2px; color: #0f172a; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-live-list { display: grid; gap: 6px; }
.pf-live-stock { display: grid; grid-template-columns: minmax(110px, 1.35fr) minmax(120px, 1.2fr) minmax(78px, .75fr) minmax(94px, .9fr) minmax(94px, .9fr); gap: 6px; align-items: center; padding: 8px; border-radius: 10px; background: #fbfdff; border: 1px solid #edf2f7; }
.pf-live-main b { display: block; color: #0f172a; font-size: 12.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-live-main small { display: block; color: #94a3b8; font-size: 10.5px; font-weight: 900; }
.pf-live-buy span, .pf-live-now small, .pf-live-day small, .pf-live-pnl small { display: block; color: #94a3b8; font-size: 10px; font-weight: 900; }
.pf-live-buy b, .pf-live-now b, .pf-live-day b, .pf-live-pnl b { display: block; margin-top: 2px; color: #0f172a; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-live-health { grid-column: 1 / -1; display: flex; gap: 5px; flex-wrap: wrap; margin-top: -1px; }
.pf-live-health span { padding: 3px 6px; border-radius: 999px; background: #f1f5f9; color: #64748b; font-size: 10px; font-weight: 900; }
.pf-live-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.pf-mini-btn { border: 1px solid #cbd5e1; background: #fff; color: #334155; border-radius: 9px; min-height: 34px; font-size: 12px; font-weight: 900; cursor: pointer; }
.pf-mini-btn.danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.pf-run-section { margin-top: 14px; }
.pf-run-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
}
.pf-run-head h2 { margin: 0; color: #0f172a; font-size: 19px; line-height: 1.2; }
.pf-run-head p { margin: 3px 0 0; color: #64748b; font-size: 12px; font-weight: 800; line-height: 1.35; }
.pf-run-list { display: grid; gap: 12px; }
.pf-run-card {
  border: 1px solid #dbe4f0; border-radius: 12px; background: #fff; overflow: hidden;
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
.pf-run-card.warn { border-color: #fed7aa; }
.pf-run-card.danger { border-color: #fecaca; }
.pf-run-summary {
  list-style: none; display: grid; gap: 10px;
  padding: 14px 16px 12px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.pf-run-summary::-webkit-details-marker { display: none; }
.pf-run-summary b { display: block; color: #0f172a; font-size: 18px; line-height: 1.25; }
.pf-run-summary small { display: block; margin-top: 3px; color: #94a3b8; font-size: 12px; font-weight: 900; line-height: 1.35; }
.pf-run-summary strong { flex: 0 0 auto; text-align: right; font-size: 17px; white-space: nowrap; }
.pf-run-title { min-width: 0; }
.pf-run-title b {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pf-run-panel {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.15fr 1.15fr 1.15fr;
  background: #0f172a; border-radius: 13px; overflow: hidden; color: #fff;
}
.pf-run-panel span {
  min-width: 0; padding: 12px 16px; border-left: 1px solid #334155;
}
.pf-run-panel span:first-child { border-left: 0; }
.pf-run-panel small {
  display: block; margin: 0 0 6px; color: #94a3b8; font-size: 11px; font-weight: 950;
}
.pf-run-panel b {
  color: #fff; font-size: 15px; font-weight: 950; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums;
}
.pf-run-panel b em {
  margin-left: 6px; color: #fde047; font-size: 12px; font-style: normal; font-weight: 950;
}
.pf-run-panel > .pf-budget-cell b {
  font-size: 20px;
}
.pf-run-panel b.pnl-pos { color: #f87171; }
.pf-run-panel b.pnl-neg { color: #60a5fa; }
.pf-run-panel b.pnl-flat { color: #e5e7eb; }
.pf-run-panel .pf-cell-sub { display: block; margin: 5px 0 0; color: #94a3b8; font-size: 11px; font-weight: 950; }
.pf-run-panel small .pf-ref { color: #64748b; font-weight: 800; font-size: 10px; }
.pf-run-panel b em.pf-sell-rsv { color: #60a5fa; }
.pf-run-panel b.pf-period-val, .pf-run-panel b.pf-holdings { white-space: normal; }
.pf-run-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  padding: 0 16px 12px;
}
.pf-run-metrics span {
  min-width: 0; padding: 9px 10px; border: 1px solid #edf2f7; border-radius: 10px;
  background: #f8fafc;
}
.pf-run-metrics small { display: block; color: #94a3b8; font-size: 10.5px; font-weight: 900; }
.pf-run-metrics b { display: block; margin-top: 3px; color: #0f172a; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-run-stocks { display: grid; gap: 10px; padding: 0 16px 14px; }
.pf-run-stock {
  border: 1px solid #e2e8f0; border-radius: 12px; background: #fbfdff; overflow: hidden;
}
.pf-run-stock.warn { border-color: #fed7aa; background: #fffaf3; }
.pf-run-stock.danger { border-color: #fecaca; background: #fff7f7; }
.pf-run-stock > summary {
  position: relative; list-style: none; padding: 13px 14px 25px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pf-run-stock > summary::-webkit-details-marker { display: none; }
.pf-run-stock-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.pf-run-name { min-width: 0; }
.pf-run-name b { display: block; color: #0f172a; font-size: 16px; line-height: 1.22; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-run-name small { display: block; margin-top: 3px; color: #94a3b8; font-size: 11px; font-weight: 900; }
.pf-run-side { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.pf-run-side strong { text-align: right; font-size: 14px; white-space: nowrap; }
.pf-stock-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pf-stock-sell {
  flex: 0 0 auto; min-width: 48px; min-height: 28px; border: 1px solid #fecaca;
  border-radius: 8px; background: #fff; color: #dc2626; font-size: 11px; font-weight: 950;
  cursor: pointer;
}
.pf-stock-sell:active { transform: translateY(1px); }
.pf-stock-buy {
  flex: 0 0 auto; min-height: 28px; border: 1px solid #bbf7d0;
  border-radius: 8px; background: #ecfdf5; color: #047857; font-size: 11px; font-weight: 950;
  cursor: pointer; padding: 0 8px; white-space: nowrap;
}
.pf-stock-buy.reserve { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.pf-stock-buy.cancel { border-color: #e2e8f0; background: #f8fafc; color: #475569; }
.pf-stock-buy:active { transform: translateY(1px); }
.pf-stock-pending {
  display: inline-flex; align-items: center; min-height: 28px; border-radius: 8px; padding: 0 8px;
  background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 950; white-space: nowrap;
}
.pf-stock-pending.done { background: #f1f5f9; color: #64748b; }
.pf-stock-buy:disabled, .pf-stock-sell:disabled {
  opacity: .42; cursor: not-allowed; transform: none;
}
.pf-stock-sell.done:disabled {
  opacity: 1; background: #f1f5f9; border-color: #e2e8f0; color: #64748b;
}
.pf-range-labels {
  position: relative; height: 18px; margin: 0 0 2px; color: #64748b; font-size: 11px; font-weight: 900;
}
.pf-range-labels span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.pf-range-labels span.loss { transform: translateX(0); color: #2563eb; }
.pf-range-labels span.entry { color: #0f172a; }
.pf-range-labels span.gain { transform: translateX(-100%); color: #dc2626; }
.pf-range-line {
  position: relative; height: 16px; border-radius: 999px;
  background: linear-gradient(90deg, #bfdbfe 0%, #e5e7eb 50%, #fecaca 100%);
  overflow: visible;
}
.pf-range-line i {
  position: absolute; top: -5px; width: 4px; height: 26px; border-radius: 999px;
  transform: translateX(-50%); background: #94a3b8;
}
.pf-range-line i.entry { height: 18px; top: -1px; background: rgba(17,24,39,.7); }
.pf-range-line i.current { background: #111827; z-index: 2; }
.pf-current-label {
  position: relative; width: max-content; max-width: 100%; transform: translateX(-50%);
  margin-top: 9px; color: #0f172a; font-size: 12px; font-weight: 950; white-space: nowrap;
}
.pf-run-foot {
  display: flex; flex-wrap: wrap; gap: 4px 9px; margin-top: 10px;
  color: #16a34a; font-size: 13px; font-weight: 900; line-height: 1.35;
}
.pf-run-stock.warn .pf-run-foot, .pf-run-stock.danger .pf-run-foot { color: #dc2626; }
/* 매수가 중심 입체 막대 — 상승=빨강 우측·하락=파랑 좌측. 예약/후보는 색 막대 없음(관찰) */
.pf-bar {
  position: relative; height: 30px; border-radius: 9px; margin-top: 2px;
  background: linear-gradient(90deg, #bfdbfe 0%, #dbeafe 40%, #eef2f7 50%, #fde7e7 60%, #fecaca 100%);
  box-shadow: inset 0 2px 5px rgba(15,23,42,.18), inset 0 -1px 0 rgba(255,255,255,.6);
}
.pf-bar-fill {
  position: absolute; top: 3px; bottom: 3px; border-radius: 6px;
  box-shadow: inset 0 2px 2px rgba(255,255,255,.45), inset 0 -3px 4px rgba(0,0,0,.2);
}
.pf-bar-fill.gain { background: linear-gradient(90deg, #fca5a5, #dc2626); }
.pf-bar-fill.loss { background: linear-gradient(90deg, #1d4ed8, #93c5fd); }
.pf-bar-buy {
  position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px;
  background: #334155; border-radius: 2px; box-shadow: 0 0 0 1.5px rgba(255,255,255,.7); z-index: 3;
}
.pf-bar-buy.wait { background: #94a3b8; }
.pf-bar-cur {
  position: absolute; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,.4); z-index: 4;
}
.pf-bar-cur.gain { background: radial-gradient(circle at 35% 30%, #fff, #ef4444 62%, #b91c1c); }
.pf-bar-cur.loss { background: radial-gradient(circle at 35% 30%, #fff, #3b82f6 62%, #1e3a8a); }
.pf-bar-cur.wait { background: #fff; border: 2px dashed #94a3b8; box-shadow: none; }
.pf-bar-curlbl {
  position: relative; width: max-content; max-width: 100%; transform: translateX(-50%);
  margin: 7px 0 0; color: #0f172a; font-size: 11px; font-weight: 900; white-space: nowrap;
}
.pf-bar-ticks { position: relative; height: 15px; margin-top: 7px; color: #94a3b8; font-size: 11px; font-weight: 900; }
.pf-bar-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.pf-bar-ticks .l { left: 0; transform: none; }
.pf-bar-ticks .r { right: 0; left: auto; transform: none; }
.pf-bar-ticks .b { left: 50%; color: #334155; }
.pf-bar-ticks .loss { color: #2563eb; }
.pf-bar-ticks .gain { color: #dc2626; }
/* 돈 중심 카드 — 상태 한마디·큰 손익금액·본전 영역(가격/목표 라벨 없음) */
.pf-state-pill { font-size: 11px; font-weight: 900; padding: 3px 10px; border-radius: 999px; white-space: nowrap; align-self: center; }
.pf-state-pill.gain { background: #fee2e2; color: #b91c1c; }
.pf-state-pill.loss { background: #dbeafe; color: #1e40af; }
.pf-state-pill.wait, .pf-state-pill.gray { background: #f1f5f9; color: #475569; }
.pf-money { font-size: 25px; font-weight: 950; line-height: 1.1; margin: 4px 0 2px; }
.pf-money small { font-size: 14px; font-weight: 800; margin-left: 7px; }
.pf-money.gain { color: #dc2626; }
.pf-money.loss { color: #2563eb; }
.pf-flow { font-size: 13px; color: #475569; font-weight: 800; margin-bottom: 13px; }
.pf-flow b { color: #0f172a; }
.pf-bar-zones { display: flex; justify-content: space-between; margin-top: 8px; color: #94a3b8; font-size: 11px; font-weight: 900; }
.pf-bar-zones .b { color: #334155; }
.pf-bar-base { text-align: center; margin-top: 8px; color: #334155; font-size: 11.5px; font-weight: 900; }
.pf-pnl { text-align: right; line-height: 1.15; }
.pf-pnl b { font-size: 20px; font-weight: 950; }
.pf-pnl small { display: block; font-size: 11.5px; color: #64748b; font-weight: 800; margin-top: 1px; }
.pf-pnl.gain b { color: #dc2626; }
.pf-pnl.loss b { color: #2563eb; }
.pf-pnl.gray b { color: #94a3b8; font-size: 16px; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.pf-chips span { font-size: 11.5px; color: #64748b; background: #f1f5f9; border-radius: 7px; padding: 4px 9px; font-weight: 800; }
.pf-chips b { font-weight: 950; color: #334155; }
.pf-chips b.gain { color: #dc2626; }
.pf-chips b.loss { color: #2563eb; }
.pf-chips b.muted { color: #94a3b8; font-weight: 800; }
.pf-chips .pf-chip-trend { cursor: pointer; background: #eff6ff; color: #1e40af; }
.pf-trend-inline { margin-top: 10px; }
.pf-period { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed #e2e8f0; font-size: 11.5px; color: #64748b; font-weight: 800; }
.pf-period .day { color: #334155; }
.pf-period.muted { color: #94a3b8; }
/* 매도 예약 — 깜빡이는 파란 배지 + 펄스 테두리 (매도=파랑) */
.pf-sellres-badge { display: flex; align-items: center; gap: 6px; margin: 9px 0 4px; padding: 8px 11px; border-radius: 9px; background: #dbeafe; color: #1e40af; font-size: 12px; font-weight: 900; animation: pfSellResBlink 1.25s ease-in-out infinite; }
.pf-sellres-badge i { font-size: 16px; }
.pf-run-stock.sellres { border: 1.5px solid #3b82f6; animation: pfSellResBorder 1.25s ease-in-out infinite; }
.pf-stock-sell.cancel-sell { background: #fff; border: 1px solid #93c5fd; color: #1e40af; }
@keyframes pfSellResBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes pfSellResBorder { 0%, 100% { border-color: #3b82f6; } 50% { border-color: #bfdbfe; } }
.pf-extend { margin-left: auto; font-size: 11px; font-weight: 900; padding: 3px 11px; border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; color: #334155; cursor: pointer; }
.pf-score { margin-top: 10px; border-top: 1px dashed #e2e8f0; padding-top: 9px; }
.pf-score > summary { list-style: none; cursor: pointer; font-size: 13px; font-weight: 900; color: #0f172a; display: flex; align-items: center; gap: 8px; -webkit-tap-highlight-color: transparent; }
.pf-score > summary::-webkit-details-marker { display: none; }
.pf-score > summary b { color: #2563eb; }
.pf-score-hint { margin-left: auto; font-size: 11px; font-weight: 800; color: #94a3b8; }
.pf-score-body { margin-top: 8px; font-size: 12.5px; color: #475569; line-height: 1.6; }
.pf-score-list { list-style: none; margin: 6px 0 0; padding: 0; }
.pf-score-list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid #f1f5f9; }
.pf-score-list b { color: #0f172a; }
.pf-deep { margin-top: 6px; color: #64748b; }
.pf-card-actions { padding: 4px 16px 14px; display: flex; justify-content: space-between; gap: 8px; }
.pf-cancel-btn { font-size: 12px; font-weight: 900; padding: 6px 14px; border: 1px solid #fecaca; border-radius: 8px; background: #fff; color: #b91c1c; cursor: pointer; }
.pf-more-btn { font-size: 12px; font-weight: 900; padding: 6px 14px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #334155; cursor: pointer; }
.pf-stock-remove { font-size: 12px; font-weight: 800; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #64748b; cursor: pointer; }
.pf-rsv { font-size: 13px; color: #475569; font-weight: 800; margin: 8px 0 4px; }
.pf-rsv b { color: #0f172a; }
.pf-goal { background: #0f172a; border-radius: 12px; padding: 13px 15px; color: #fff; flex: 1; }
.pf-goal-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pf-goal-name { font-size: 12.5px; color: #cbd5e1; font-weight: 800; }
.pf-goal-dday { font-size: 12px; color: #fca5a5; font-weight: 900; white-space: nowrap; }
.pf-goal-big { font-size: 26px; font-weight: 950; margin: 5px 0 2px; color: #fff; }
.pf-goal-big small { font-size: 15px; font-weight: 800; margin-left: 7px; }
.pf-goal-flow { font-size: 13px; color: #e2e8f0; font-weight: 800; }
.pf-goal-flow b { color: #fff; }
.pf-run-detail {
  padding: 0 14px 13px; border-top: 1px solid #edf2f7; background: rgba(255,255,255,.7);
}
.pf-run-detail dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 12px 0 0; }
.pf-run-detail dl div { min-width: 0; padding: 8px; border-radius: 9px; background: #f8fafc; border: 1px solid #edf2f7; }
.pf-run-detail dt { color: #94a3b8; font-size: 10.5px; font-weight: 900; }
.pf-run-detail dd { margin: 3px 0 0; color: #0f172a; font-size: 12px; font-weight: 900; overflow-wrap: anywhere; }
.pf-run-detail p { margin: 9px 0 0; color: #64748b; font-size: 12px; line-height: 1.45; }
.pf-run-actions { padding: 0 16px 14px; margin-top: 0; }
@media (max-width: 760px) {
  .pf-goalform { max-width: none; margin-left: -2px; margin-right: -2px; }
  .pf-invest-fold { max-width: none; }
  .pf-run-head { align-items: stretch; }
  .pf-run-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-left: 12px; padding-right: 12px; }
  .pf-run-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-run-panel span { border-left: 0; border-top: 1px solid #334155; }
  .pf-run-panel span:nth-child(1), .pf-run-panel span:nth-child(2) { border-top: 0; }
  .pf-run-panel span:nth-child(even) { border-left: 1px solid #334155; }
  .pf-run-stocks { padding-left: 12px; padding-right: 12px; }
  .pf-run-summary { padding: 13px 12px; }
  .pf-run-summary strong { font-size: 13px; }
  .pf-run-stock-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .pf-run-side { justify-content: space-between; width: 100%; }
  .pf-stock-actions { justify-content: flex-end; }
  .pf-run-side strong { text-align: left; font-size: 12.5px; }
  .pf-run-name b { font-size: 14px; white-space: normal; }
  .pf-run-name small { font-size: 10px; }
  .pf-stock-actions { gap: 4px; }
  .pf-stock-buy, .pf-stock-sell, .pf-stock-pending {
    min-height: 26px; border-radius: 7px; font-size: 10.5px; padding-left: 7px; padding-right: 7px;
  }
  .pf-range-labels { font-size: 9.5px; }
  .pf-run-foot { font-size: 11px; }
  .pf-run-detail dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-run-actions { padding-left: 12px; padding-right: 12px; }
  .pf-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-plan-head { align-items: flex-start; }
  .pf-plan-head span { font-size: 11px; }
  .pf-editor-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-live-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-live-stock { grid-template-columns: minmax(0, 1fr) auto; }
  .pf-live-buy, .pf-live-now, .pf-live-day, .pf-live-pnl { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; }
  .pf-live-buy b, .pf-live-now b, .pf-live-day b, .pf-live-pnl b { text-align: right; }
}
@media (max-width: 430px) {
  .pf-phone-form { padding: 12px; }
  .pf-fold-summary { padding: 13px 12px; }
  .pf-fold-summary b { font-size: 17px; }
  .pf-run-head { flex-direction: column; }
  .pf-run-head .pf-build { width: 100%; }
  .pf-run-summary { display: grid; grid-template-columns: 1fr; }
  .pf-run-summary strong { text-align: left; }
  .pf-current-label { font-size: 11px; }
  .pf-run-foot { font-size: 12px; }
  .pf-step-field { padding: 10px; }
  .pf-in { height: 42px; font-size: 14px; }
  .pf-textarea { min-height: 116px; }
  .pf-editor { min-height: 210px; font-size: 12px; }
  .pf-editor-head { grid-template-columns: 1fr; }
  .pf-prompt-actions { grid-template-columns: 1fr; }
  .pf-editor-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-build.ghost { min-height: 34px; }
}
@media (prefers-color-scheme: dark) {
  .pf-invest-fold, .pf-run-card { background: #111827; border-color: #334155; }
  .pf-fold-summary, .pf-run-summary b, .pf-run-head h2, .pf-run-name b, .pf-current-label, .pf-run-metrics b, .pf-run-detail dd { color: #f8fafc; }
  .pf-fold-summary small, .pf-run-head p, .pf-run-summary small, .pf-run-name small, .pf-run-detail p { color: #94a3b8; }
  .pf-run-panel { background: #0b1220; }
  .pf-run-panel span { border-color: #334155; }
  .pf-run-panel b.pnl-pos { color: #f87171; }
  .pf-run-panel b.pnl-neg { color: #60a5fa; }
  .pf-run-panel b.pnl-flat { color: #e5e7eb; }
  .pf-invest-fold[open] .pf-fold-summary { border-bottom-color: #334155; }
  .pf-fold-summary em { background: #064e3b; color: #99f6e4; }
  .pf-invest-fold[open] .pf-fold-summary em { background: #1e293b; color: #cbd5e1; }
  .pf-run-metrics span, .pf-run-detail dl div { background: #0f172a; border-color: #334155; }
  .pf-run-stock { background: #0f172a; border-color: #334155; }
  .pf-run-stock.warn { background: #1f160f; border-color: #92400e; }
  .pf-run-stock.danger { background: #241111; border-color: #991b1b; }
  .pf-range-labels span.entry { color: #e5e7eb; }
  .pf-stock-sell { background: #1e293b; border-color: #991b1b; color: #fecaca; }
  .pf-stock-buy { background: #102018; border-color: #15803d; color: #bbf7d0; }
  .pf-stock-buy.reserve { background: #0f172a; border-color: #2563eb; color: #bfdbfe; }
  .pf-stock-buy.cancel { background: #111827; border-color: #475569; color: #cbd5e1; }
  .pf-stock-pending { background: #2a2109; color: #fde68a; }
  .pf-stock-pending.done { background: #111827; color: #94a3b8; }
  .pf-run-detail { background: rgba(15,23,42,.6); border-top-color: #334155; }
  .pf-range-line i.current { background: #e5e7eb; }
  .pf-bar-curlbl { color: #f8fafc; }
  .pf-bar-ticks .b { color: #cbd5e1; }
  .pf-bar-zones .b { color: #cbd5e1; }
  .pf-bar-base { color: #cbd5e1; }
  .pf-pnl small { color: #94a3b8; }
  .pf-chips span { background: #1e293b; color: #94a3b8; }
  .pf-chips b { color: #cbd5e1; }
  .pf-period { border-top-color: #334155; color: #94a3b8; }
  .pf-period .day { color: #cbd5e1; }
  .pf-extend { background: #1e293b; border-color: #475569; color: #cbd5e1; }
  .pf-score { border-top-color: #334155; }
  .pf-score > summary { color: #f8fafc; }
  .pf-score-body { color: #94a3b8; }
  .pf-score-list li { border-bottom-color: #1e293b; }
  .pf-score-list b { color: #e5e7eb; }
  .pf-deep { color: #94a3b8; }
  .pf-cancel-btn { background: #241111; border-color: #991b1b; color: #fecaca; }
  .pf-more-btn { background: #0f172a; border-color: #334155; color: #cbd5e1; }
  .pf-stock-remove { background: #0f172a; border-color: #334155; color: #94a3b8; }
  .pf-flow, .pf-rsv { color: #94a3b8; }
  .pf-flow b, .pf-rsv b { color: #f8fafc; }
  .pf-state-pill.gain { background: #3a1212; color: #fecaca; }
  .pf-state-pill.loss { background: #0f1f3a; color: #bfdbfe; }
  .pf-state-pill.wait, .pf-state-pill.gray { background: #1e293b; color: #cbd5e1; }
  .pf-sellres-badge { background: #0f1f3a; color: #bfdbfe; }
  .pf-stock-sell.cancel-sell { background: #0f172a; border-color: #1e40af; color: #bfdbfe; }
  .pf-verdict-box { background: #111827; }
  .pf-verdict-box.hold { background: #052e22; } .pf-verdict-box.trim { background: #2a1e05; } .pf-verdict-box.sell { background: #0f1f3a; }
  .pf-verdict-box b { color: #f1f5f9; } .pf-verdict-box span { color: #cbd5e1; }
  .pf-verdict.hold { background: #052e22; color: #6ee7b7; } .pf-verdict.trim { background: #2a1e05; color: #fcd34d; } .pf-verdict.sell { background: #0f1f3a; color: #bfdbfe; }
  .pf-trend-wrap { border-top-color: #334155; }
  .pf-chips .pf-chip-trend { background: #0f1f3a; color: #bfdbfe; }
  .pf-score-item { border-bottom-color: #334155; }
  .pf-score-item-name { color: #f1f5f9; }
  .pf-score-item.ai .pf-score-item-name { color: #c7d2fe; }
  .pf-score-item.engine .pf-score-item-name { color: #5eead4; }
  .pf-score-item-pt { color: #e2e8f0; } .pf-score-item-mean { color: #cbd5e1; } .pf-score-item-detail { color: #94a3b8; }
  .pf-ai-view-box { background: #1e1b4b; border-left-color: #818cf8; }
  .pf-ai-view-box b { color: #c7d2fe; } .pf-ai-view-box p { color: #cbd5e1; }
  .pf-ai-when { color: #a5b4fc; }
  .pf-ai-refresh { background: #312e81; border-color: #4f46e5; color: #c7d2fe; }
  .pf-step-field { background: #111827; border-color: #334155; color: #cbd5e1; }
  .pf-mode { background: #0f172a; border-color: #334155; color: #cbd5e1; }
  .pf-mode b { color: #f8fafc; }
  .pf-mode small { color: #94a3b8; }
  .pf-mode.on { background: #042f2e; border-color: #14b8a6; box-shadow: inset 4px 0 0 #2dd4bf; }
  .pf-mode.on b { color: #99f6e4; }
  .pf-sector { background: #0f172a; border-color: #334155; color: #cbd5e1; }
  .pf-sector.on { background: #042f2e; border-color: #14b8a6; color: #99f6e4; box-shadow: inset 3px 0 0 #2dd4bf; }
  .pf-sector-custom { color: #94a3b8; }
  .pf-sector-hint { background: #042f2e; border-color: #0f766e; color: #99f6e4; }
  .pf-flabel { color: #cbd5e1; }
  .pf-in { background: #0f172a; border-color: #334155; color: #f1f5f9; }
  .pf-title-input { background: #0f172a; border-color: #334155; color: #f8fafc; }
  .pf-command-field { background: #0f172a; }
  .pf-editor-receipt { background: #111827; border-color: #334155; color: #cbd5e1; }
  .pf-editor-receipt b { color: #f8fafc; }
  .pf-editor-receipt.ok { background: #042f2e; border-color: #0f766e; }
  .pf-editor-receipt.bad { background: #450a0a; border-color: #991b1b; color: #fecaca; }
  .pf-analysis-loader { background: linear-gradient(180deg, #042f2e 0%, #0f172a 100%); border-color: #0f766e; color: #e2e8f0; }
  .pf-loader-bot { background: #064e3b; }
  .pf-loader-top b { color: #99f6e4; }
  .pf-loader-top small, .pf-loader-foot { color: #94a3b8; }
  .pf-loader-bar { background: #1e293b; }
  .pf-loader-steps span { color: #64748b; }
  .pf-loader-steps span.done { color: #5eead4; }
  .pf-loader-steps span.on { color: #93c5fd; }
  .pf-invest-head b { color: #f8fafc; }
  .pf-invest-head small { color: #94a3b8; }
  .pf-empty { background: #0f172a; border-color: #334155; color: #94a3b8; }
  .pf-live-card { background: #111827; border-color: #334155; }
  .pf-live-head b, .pf-live-stats b, .pf-live-main b, .pf-live-buy b, .pf-live-now b, .pf-live-day b, .pf-live-pnl b { color: #f8fafc; }
  .pf-live-head small, .pf-live-stats small, .pf-live-main small, .pf-live-buy span, .pf-live-now small, .pf-live-day small, .pf-live-pnl small { color: #94a3b8; }
  .pf-live-badge { background: #064e3b; color: #99f6e4; }
  .pf-live-stats span, .pf-live-stock { background: #0f172a; border-color: #334155; }
  .pf-live-health span { background: #1e293b; color: #cbd5e1; }
  .pf-mini-btn { background: #1e293b; border-color: #334155; color: #cbd5e1; }
  .pf-mini-btn.danger { background: #991b1b; border-color: #b91c1c; color: #fff; }
  .pf-build.ghost, .pf-ex, .pf-stage-del { background: #1e293b; }
  .pf-build.ghost, .pf-ex { color: #cbd5e1; border-color: #334155; }
  .pf-add { background: #0f1f33; border-color: #1d4ed8; color: #93c5fd; }
  .pf-plan-card { background: #052e16; border-color: #166534; color: #f8fafc; }
  .pf-plan-card.warn { background: #422006; border-color: #92400e; }
  .pf-plan-card.danger { background: #450a0a; border-color: #991b1b; }
  .pf-plan-grid span, .pf-plan-head span { background: rgba(15,23,42,.55); border-color: rgba(148,163,184,.18); }
  .pf-plan-grid small, .pf-plan-card p, .pf-plan-prompt { color: #cbd5e1; }
  .pf-plan-prompt { background: rgba(15,23,42,.5); }
  .pf-ai-comment { background: #172554; color: #dbeafe; }
  .pf-score-cell { background: #422006; color: #fde68a; }
  .pf-score-head b, .pf-score-note { color: #fde68a; }
  .pf-score-scroll { background: #0f172a; border-color: #92400e; }
  .pf-score-table th { background: #78350f; color: #fef3c7; }
  .pf-score-table th, .pf-score-table td { border-color: #78350f; }
  .pf-score-table td.num { color: #f8fafc; }
  .pf-data-status { background: #052e16; border-color: #166534; color: #bbf7d0; }
  .pf-data-status.warn { background: #422006; border-color: #92400e; color: #fde68a; }
  .pf-data-status span { color: #cbd5e1; }
  .pf-verify { background: #052e16; border-color: #166534; }
  .pf-verify.bad { background: #450a0a; border-color: #991b1b; }
  .pf-verify dl div, .pf-pick-money, .pf-score-mini div, .pf-track-grid span { background: #0f172a; border-color: #334155; }
  .pf-verify dd, .pf-pick-summary, .pf-pick-money b, .pf-score-mini b, .pf-track-grid b, .pf-pick-head b { color: #f8fafc; }
  .pf-port-summary { background: #172554; border-color: #1d4ed8; color: #dbeafe; }
  .pf-pick-card { background: #111827; border-color: #334155; color: #f8fafc; }
  .pf-pick-card[open] { box-shadow: 0 10px 24px rgba(0,0,0,.28); }
  .pf-pick-card p, .pf-score-line span { color: #cbd5e1; }
  .pf-pick-card details, .pf-score-line { border-color: #334155; }
  .pf-pick-tags span { background: #083344; color: #67e8f9; }
  .pf-pick-tags .muted { background: #1e293b; color: #94a3b8; }
  .pf-day-line { background: #1f2937; }
  .pf-deep-card { background: #172554; color: #dbeafe; }
  .pf-rebal-box { background: #422006; border-color: #92400e; color: #f8fafc; }
  .pf-rebal-box p, .pf-rebal-actions small, .pf-rebal-repl small { color: #cbd5e1; }
  .pf-rebal-actions div { background: rgba(15,23,42,.45); border-color: rgba(148,163,184,.18); }
  .pf-rebal-repl span { background: #052e16; border-color: #166534; }
}
