:root {
  /* ### V18.2.7.5: read back by the staleness check in index.html. */
  --javid-asset-ver: "V18.2.10";
  --bg: #0a0d12;
  --surface: #0f131a;
  --panel: #111823;
  --inset: #0d1420;
  --line: #1c2530;
  --line-2: #27303f;
  --text: #dbe4f0;
  --muted: #7d8aa0;
  --faint: #5f6b7d;
  --accent: #2dd4bf;
  --accent-dim: #14655c;
  --accent-bg: #0e3b34;
  --violet: #8b5cf6;
  --up: #34d399;
  --down: #fb7185;
  --warn: #fbbf24;
  --radius: 6px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(139,92,246,0.07), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, rgba(45,212,191,0.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: 'Pretendard', 'Malgun Gothic', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: -0.01em;
}
#app { display: flex; flex-direction: column; height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 22px;
  height: 54px; padding: 0 18px;
  background: linear-gradient(180deg, #0e1420, #0b0f16);
  border-bottom: 1px solid var(--line-2);
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 230px; }
.brand-mark {
  width: 20px; height: 20px; flex-shrink: 0;
  background: conic-gradient(from 210deg, var(--accent), var(--violet), var(--accent));
  clip-path: polygon(50% 0, 100% 28%, 100% 72%, 50% 100%, 0 72%, 0 28%);
}
.app-title { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.app-title em { font-style: normal; color: var(--accent); font-weight: 600; font-size: 12px; margin-left: 2px; }
.license-info { font-size: 11px; color: var(--faint); }
.topnav { display: flex; gap: 2px; flex: 1; height: 100%;
          justify-content: center; align-items: center; }
.nav-btn {
  position: relative; display: flex; align-items: center; gap: 6px;
  padding: 0 15px; height: 100%;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  transition: color .15s;
}
.nav-btn .nav-icon { display: none; }
.nav-btn:hover { color: var(--text); }
.nav-btn.active { color: var(--accent); }
.nav-btn.active::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 2px; background: linear-gradient(90deg, var(--accent), var(--violet));
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.status-cluster { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-offline { background: var(--faint); box-shadow: 0 0 0 3px rgba(95,107,125,.15); }
.status-online  { background: var(--warn);  box-shadow: 0 0 0 3px rgba(251,191,36,.15); }
.status-running { background: var(--accent); box-shadow: 0 0 0 3px rgba(45,212,191,.18); }
.start-stop-container { display: flex; }
.btn-start-stop {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 20px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  transition: filter .15s, transform .05s;
}
.btn-start-stop:active { transform: scale(.97); }
.btn-start { background: linear-gradient(135deg, #14b8a6, #0d9488); color: #04211d; }
.btn-start:hover { filter: brightness(1.12); }
.btn-stop { background: transparent; color: var(--down); border-color: var(--down); }
.btn-stop:hover { background: rgba(251,113,133,.12); }
.btn-start-stop:disabled { opacity: .55; cursor: wait; }
.main-layout.workspace { display: flex; flex: 1; overflow: hidden; }
.content-area { flex: 1; overflow-y: auto; padding: 20px 24px 60px; }
.dock {
  width: 262px; flex-shrink: 0; overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--line-2);
  padding: 14px 14px 40px;
}
.dock-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--faint);
  padding: 4px 2px 10px; border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.dock > div:not(.dock-title) { margin-bottom: 4px; }
.shadow-toggle-container, .investment-mode-container, .config-import-container {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 12px; margin-bottom: 12px;
}
.investment-mode-container { border-left-color: #4c3a80; }
.config-import-container   { border-left-color: var(--line-2); }
.shadow-toggle-label, .investment-mode-label {
  display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px;
}
.shadow-toggle-label input, .investment-mode-label input[type="checkbox"] { display: none; }
.shadow-toggle-slider {
  width: 34px; height: 18px; border-radius: 999px; flex-shrink: 0;
  background: var(--line-2); position: relative; transition: background .18s;
}
.shadow-toggle-slider::before {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #94a3b8; transition: transform .18s, background .18s;
}
.shadow-toggle-label input:checked + .shadow-toggle-slider,
.investment-mode-label input:checked + .shadow-toggle-slider { background: var(--accent-dim); }
.shadow-toggle-label input:checked + .shadow-toggle-slider::before,
.investment-mode-label input:checked + .shadow-toggle-slider::before {
  transform: translateX(16px); background: var(--accent);
}
.shadow-toggle-text { line-height: 1.35; font-weight: 600; }
.shadow-toggle-text small { color: var(--muted); font-weight: 400; }
.investment-mode-label input:checked ~ .shadow-toggle-text small { color: var(--accent); }
.shadow-help { margin-top: 8px; font-size: 11px; color: var(--faint); line-height: 1.5; }
.shadow-virtual-balance { margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.shadow-virtual-balance label { display: block; margin-bottom: 4px; }
.shadow-virtual-balance input {
  width: 100%; padding: 6px 8px; border-radius: 4px;
  background: var(--inset); border: 1px solid var(--line-2); color: var(--text);
}
.shadow-virtual-balance small { display: block; margin-top: 4px; color: var(--faint); }
.mode-buttons { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 10px; }
.mode-btn {
  padding: 8px 4px; border-radius: 4px; cursor: pointer; text-align: center;
  background: var(--inset); border: 1px solid var(--line-2);
  color: var(--muted); font-size: 11.5px; line-height: 1.4;
}
.mode-btn small { color: var(--faint); font-size: 10px; }
.mode-btn:hover { border-color: var(--accent-dim); color: var(--text); }
.mode-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.mode-btn.active small { color: var(--accent); }
.investment-mode-container:not(.enabled) .mode-info { opacity: .5; }
.mode-info { margin-top: 10px; font-size: 12px; color: var(--muted); }
.mode-info-row { display: flex; justify-content: space-between; padding: 2px 0; }
.mode-info-row strong { color: var(--text); }
.mode-info-help { margin-top: 6px; font-size: 10.5px; color: var(--faint); line-height: 1.5; }
.import-label { font-size: 12px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 8px; }
.import-btn {
  width: 100%; padding: 7px; border-radius: 4px; cursor: pointer;
  background: transparent; border: 1px dashed var(--line-2); color: var(--muted); font-size: 12px;
}
.import-btn:hover { border-color: var(--accent); color: var(--accent); }
.import-help { margin-top: 7px; font-size: 10.5px; color: var(--faint); line-height: 1.5; }
.view { display: none; max-width: 1240px; margin: 0 auto; }
.view.active { display: block; }
.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.view-header h2, .view > h2 {
  font-size: 17px; font-weight: 700; letter-spacing: 0.01em; margin-bottom: 4px;
}
.view > h2 { margin-bottom: 16px; }
.view-header > div { display: flex; gap: 8px; align-items: center; }
.status-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 3px; vertical-align: 3px;
  background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-dim);
}
.status-badge.idle { background: var(--inset); color: var(--muted); border-color: var(--line-2); }
.status-badge.shadow { background: #2b2350; color: #b79cff; border-color: #4c3a80; }
.btn {
  padding: 7px 14px; border-radius: 4px; cursor: pointer; font-size: 12.5px; font-weight: 600;
  background: transparent; border: 1px solid var(--line-2); color: var(--muted);
  transition: all .13s;
}
.btn:hover { color: var(--text); border-color: var(--faint); }
.btn-primary { border-color: var(--accent-dim); color: var(--accent); }
.btn-primary:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.btn-secondary { }
.btn-danger { border-color: #6b2c3d; color: var(--down); }
.btn-danger:hover { background: rgba(251,113,133,.1); border-color: var(--down); color: var(--down); }
.btn-success { border-color: var(--accent-dim); color: var(--accent); }
.btn-success:hover { background: var(--accent-bg); }
.btn-success:disabled { opacity: .5; cursor: wait; }
.btn-mini { font-size: 11px; padding: 4px 10px; }
.kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 18px;
}
.kpi-card { position: relative; padding: 16px 18px 14px; }
.kpi-card + .kpi-card { border-left: 1px solid var(--line); }
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 18px; width: 26px; height: 2px;
  background: var(--accent);
}
.kpi-card.kpi-profit::before { background: var(--violet); }
.kpi-card.kpi-roi::before { background: var(--warn); }
.kpi-card.kpi-positions::before { background: var(--faint); }
.kpi-icon { display: none; }
.kpi-label {
  font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 7px;
}
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-value.up { color: var(--up); }
.kpi-value.down { color: var(--down); }
.kpi-sub { margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.dashboard-panel {
  background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--accent-dim);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px;
}
.dashboard-panel h3, .panel-header h3 {
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text);
}
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-header .panel-sub { font-size: 11px; color: var(--faint); }
#chart-canvas { width: 100%; height: 240px; display: block; }
.workflow-guide {
  background: var(--surface); border: 1px dashed var(--line-2);
  border-radius: var(--radius); padding: 12px 16px;
  margin: 0 auto 16px; max-width: 1240px;
}
.workflow-title { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.workflow-steps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.step {
  font-size: 11.5px; padding: 4px 11px; border-radius: 999px;
  background: var(--inset); border: 1px solid var(--line-2); color: var(--muted);
}
.step.done { border-color: var(--accent-dim); color: var(--accent); background: var(--accent-bg); }
.step.active { border-color: var(--warn); color: var(--warn); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.step-arrow { color: var(--faint); font-size: 11px; }
.workflow-help { margin-top: 9px; font-size: 11.5px; color: var(--faint); line-height: 1.6; }
.market-cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.market-card { padding: 13px 15px; background: var(--surface); }
.market-card + .market-card { border-left: 1px solid var(--line); }
.market-card .card-label { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.market-card .card-row { display: flex; align-items: baseline; gap: 7px; margin-top: 3px; }
.market-card .coin-icon { color: var(--violet); font-weight: 700; }
.market-card .card-price, .market-card .card-price-inline { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.market-card .card-change-inline { font-size: 11.5px; }
.card-change-inline.up, .card-change.up { color: var(--up); }
.card-change-inline.down, .card-change.down { color: var(--down); }
.market-card .card-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.up-ratio { color: var(--up); } .down-ratio { color: var(--down); }
.sentiment-bar { display: flex; height: 5px; border-radius: 999px; overflow: hidden; margin: 8px 0; background: var(--inset); }
.sentiment-up { background: var(--up); } .sentiment-down { background: var(--down); }
.volatility-bar-bg { height: 5px; border-radius: 999px; background: var(--inset); margin: 8px 0; overflow: hidden; }
.volatility-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--warn)); }
.dashboard-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.top-panel h4 { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table thead { background: transparent; }
.data-table th {
  text-align: left; padding: 8px 10px; font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
  border-bottom: 1px solid var(--line-2);
}
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.data-table tbody tr:hover { background: rgba(45,212,191,.04); }
.data-table-compact td { padding: 5px 8px; font-size: 12px; border-bottom: 1px solid var(--line); }
.data-table-compact td:first-child { color: var(--text); font-weight: 600; }
.data-table-compact td:last-child { text-align: right; }
.pnl-pos, .roe-pos, .up { color: var(--up); }
.pnl-neg, .roe-neg, .down { color: var(--down); }
.side-long {
  color: var(--up); font-weight: 700; font-size: 11px; letter-spacing: .06em;
  padding: 2px 8px; border: 1px solid rgba(52,211,153,.35); border-radius: 3px;
}
.side-short {
  color: var(--down); font-weight: 700; font-size: 11px; letter-spacing: .06em;
  padding: 2px 8px; border: 1px solid rgba(251,113,133,.35); border-radius: 3px;
}
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar input[type="text"], #symbol-search {
  padding: 8px 12px; min-width: 200px; border-radius: 4px;
  background: var(--inset); border: 1px solid var(--line-2); color: var(--text); font-size: 13px;
}
.toolbar input:focus { outline: none; border-color: var(--accent-dim); }
.symbol-sort-select, select {
  padding: 7px 10px; border-radius: 4px;
  background: var(--inset); border: 1px solid var(--line-2); color: var(--text); font-size: 12.5px;
}
.filter-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.filter-toggle:hover { color: var(--text); }
.filter-toggle input[type=checkbox] { accent-color: var(--accent); }
.symbols-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.symbol-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  cursor: pointer; transition: border-color .12s;
}
.symbol-item:hover { border-color: var(--accent-dim); }
.symbol-item.selected { border-color: var(--accent); background: var(--accent-bg); }
.symbol-checkbox { accent-color: var(--accent); }
.symbol-content { min-width: 0; }
.symbol-info { font-size: 10.5px; color: var(--faint); }
.symbol-name { font-size: 12.5px; font-weight: 600; }
.load-progress { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; }
.load-progress .progress-header { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.progress-bar-bg { height: 4px; background: var(--inset); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--violet)); transition: width .3s; }
.progress-current { margin-top: 6px; font-size: 11px; color: var(--faint); }
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.stat-card { padding: 12px 14px; background: var(--panel); }
.stat-card + .stat-card { border-left: 1px solid var(--line); }
.stat-label { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.stat-value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-value.up { color: var(--up); } .stat-value.down { color: var(--down); }
.settings-panel {
  background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--line-2);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px;
}
.settings-panel h3 { font-size: 13px; font-weight: 700; margin-bottom: 10px; letter-spacing: .02em; }
.settings-panel label { display: block; margin: 8px 0 4px; font-size: 12.5px; color: var(--muted); }
.settings-panel input[type="text"], .settings-panel input[type="password"], .settings-panel input[type="number"] {
  width: 100%; max-width: 460px; padding: 8px 11px; border-radius: 4px; margin-top: 4px;
  background: var(--inset); border: 1px solid var(--line-2); color: var(--text); font-size: 13px;
}
.settings-panel input:focus { outline: none; border-color: var(--accent-dim); }
.inline-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.checkbox-row { display: flex !important; align-items: center; gap: 8px; cursor: pointer; margin: 8px 0 !important; color: var(--text) !important; }
.checkbox-row input { accent-color: var(--accent); }
.conn-status { font-size: 12px; color: var(--muted); }
.conn-status.ok { color: var(--up); } .conn-status.err { color: var(--down); }
.info-box { background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.info-box h4 { font-size: 12.5px; margin-bottom: 8px; color: var(--warn); }
.info-box p { font-size: 12px; color: var(--muted); line-height: 1.6; }
.info-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12px; }
.info-table th { text-align: left; padding: 6px 8px; color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line-2); }
.info-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.info-table tr:hover { background: rgba(45,212,191,.04); }
.info-help { font-size: 11.5px; color: var(--faint); line-height: 1.7; }
.info-help strong { color: var(--muted); }
.settings-mode-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.settings-mode-btn, .settings-entry-mode-btn, .settings-order-type-btn, .settings-leverage-btn {
  position: relative; padding: 13px 10px; text-align: center; cursor: pointer;
  background: var(--inset); border: 1px solid var(--line-2); border-radius: var(--radius);
  color: var(--muted); transition: all .13s;
}
.settings-mode-btn:hover, .settings-entry-mode-btn:hover, .settings-order-type-btn:hover, .settings-leverage-btn:hover { border-color: var(--faint); }
.settings-mode-btn.active, .settings-entry-mode-btn.active, .settings-order-type-btn.active, .settings-leverage-btn.active {
  border-color: var(--accent); background: var(--accent-bg); color: var(--text);
}
.settings-mode-btn .mode-icon { display: block; font-size: 20px; margin-bottom: 4px; }
.settings-entry-mode-btn .mode-icon, .settings-order-type-btn .mode-icon { display: none; }
.mode-check { display: none; position: absolute; top: 6px; right: 9px; color: var(--accent); font-size: 12px; }
.settings-entry-mode-btn.active .mode-check, .settings-order-type-btn.active .mode-check, .settings-leverage-btn.active .mode-check { display: block; }
.mode-name { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.settings-mode-btn.active .mode-name { color: var(--accent); }
.mode-divisor { font-size: 11px; color: var(--accent); margin-bottom: 3px; }
.mode-desc { font-size: 10.5px; color: var(--faint); line-height: 1.4; }
.settings-mode-preview { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; font-size: 12px; }
.preview-row { display: flex; justify-content: space-between; padding: 2px 0; color: var(--muted); }
.preview-row strong { color: var(--text); }
.preview-help { font-size: 11px; color: var(--faint); line-height: 1.7; margin-top: 4px; }
.strategy-preset-card { padding: 0; overflow: hidden; }
.strategy-preset-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 18px; cursor: pointer; user-select: none;
}
.strategy-preset-header:hover { background: rgba(45,212,191,.04); }
.strategy-preset-header .arrow { color: var(--faint); font-size: 10px; transition: transform .18s; margin-right: 4px; }
.strategy-preset-card.expanded .strategy-preset-header .arrow { transform: rotate(90deg); }
.strategy-preset-body { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.strategy-preset-card.expanded .strategy-preset-body { max-height: 3000px; }
.strategy-preset-content { padding: 4px 18px 16px; border-top: 1px solid var(--line); }
.strategy-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; }
.strategy-form label { font-size: 11.5px; }
.field-group { }
.section-divider { grid-column: 1 / -1; border-top: 1px dashed var(--line-2); margin: 6px 0; padding-top: 6px; font-size: 11px; color: var(--faint); letter-spacing: .1em; text-transform: uppercase; }
.advanced-section { grid-column: 1 / -1; }
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 19px; }
.toggle-switch input { display: none; }
.toggle-switch .slider {
  position: absolute; inset: 0; border-radius: 999px; cursor: pointer;
  background: var(--line-2); transition: background .18s;
}
.toggle-switch .slider::before {
  content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #94a3b8; transition: transform .18s, background .18s;
}
.toggle-switch input:checked + .slider { background: var(--accent-dim); }
.toggle-switch input:checked + .slider::before { transform: translateX(17px); background: var(--accent); }
.feature-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.feature-card.enabled { border-left: 2px solid var(--accent); }
.feature-card.disabled { opacity: .75; }
.feature-card .feature-header { display: flex; align-items: center; gap: 8px; }
.feature-card .feature-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.feature-card.enabled .feature-status-dot { background: var(--accent); }
.feature-card .feature-label { font-size: 13px; font-weight: 600; flex: 1; }
.feature-card.enabled .feature-label { color: var(--text); }
.feature-card .feature-tag { font-size: 10px; padding: 2px 7px; border-radius: 3px; background: var(--inset); color: var(--faint); border: 1px solid var(--line-2); }
.feature-card.enabled .feature-tag { color: var(--accent); border-color: var(--accent-dim); }
.feature-card .applied-badge { font-size: 10px; color: var(--accent); }
.feature-card.disabled .applied-badge { color: var(--faint); }
.feature-card .feature-body { margin-top: 8px; }
.feature-card .feature-desc { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.feature-card .feature-thresholds { margin-top: 6px; font-size: 11px; color: var(--faint); }
.feature-card .feature-toggle { position: relative; display: inline-block; width: 34px; height: 18px; }
.feature-card .feature-toggle input { display: none; }
.feature-card .feature-slider { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); cursor: pointer; transition: background .18s; }
.feature-card .feature-slider:before { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #94a3b8; transition: transform .18s; }
.feature-card .feature-toggle input:checked + .feature-slider { background: var(--accent-dim); }
.feature-card .feature-toggle input:checked + .feature-slider:before { transform: translateX(16px); background: var(--accent); }
.log-container {
  background: #070b10; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; height: calc(100vh - 210px); overflow-y: auto;
  font-family: 'Cascadia Code', 'D2Coding', Consolas, monospace; font-size: 12px; line-height: 1.75;
}
.log-line { white-space: pre-wrap; word-break: break-all; color: #9aa8bd; }
.log-line.DATA { color: #7cb7ff; }
.log-line.INFO { color: #8b97a8; }
.log-line.TRADE { color: var(--accent); }
.log-line.ERROR { color: var(--down); }
.log-count { font-size: 11.5px; color: var(--faint); }
.shadow-banner {
  background: linear-gradient(90deg, rgba(139,92,246,.16), rgba(139,92,246,.05));
  border: 1px solid #4c3a80; border-left: 3px solid var(--violet);
  border-radius: var(--radius); color: #cabcf5;
  padding: 10px 16px; margin-bottom: 14px; font-size: 12.5px;
}
.diagnose-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(680px, 92vw); max-height: 84vh; overflow-y: auto; z-index: 9999;
  background: var(--panel); border: 1px solid var(--line-2); border-top: 2px solid var(--accent);
  border-radius: 8px; padding: 20px 24px; box-shadow: 0 24px 70px rgba(0,0,0,.65);
  font-size: 13px;
}
.diagnose-modal h3 { color: var(--accent); margin-bottom: 12px; font-size: 15px; }
.diagnose-modal .check-row { margin: 5px 0; padding: 7px 10px; background: var(--inset); border-radius: 4px; border-left: 2px solid var(--line-2); }
.diagnose-modal .check-row.ok { border-left-color: var(--up); }
.diagnose-modal .check-row.fail { border-left-color: var(--down); }
.diagnose-modal button {
  margin-top: 14px; padding: 8px 18px; border-radius: 4px; cursor: pointer;
  background: var(--accent-bg); border: 1px solid var(--accent-dim); color: var(--accent); font-weight: 600;
}
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }
@media (max-width: 1280px) {
  .dock { width: 232px; }
  .kpi-row, .market-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-card:nth-child(3), .market-card:nth-child(3) { border-left: none; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  .topnav { overflow-x: auto; }
  .main-layout.workspace { flex-direction: column; }
  .dock { width: 100%; border-left: none; border-top: 1px solid var(--line-2); }
  .dashboard-row { grid-template-columns: 1fr; }
}
.top-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.card-range { font-size: 10.5px; color: var(--faint); }
.status-badge.error { background: rgba(251,113,133,.12); color: var(--down); border-color: #6b2c3d; }
.btn-preset { font-size: 11px; padding: 4px 10px; border-radius: 3px; background: var(--inset); border: 1px solid var(--line-2); color: var(--muted); cursor: pointer; }
.btn-preset:hover { border-color: var(--accent-dim); color: var(--accent); }
.strategy-form .field-group label { margin: 0 0 3px; font-size: 11px; color: var(--faint); display: block; }
.strategy-form .field-group input { width: 100%; max-width: none; padding: 6px 9px; font-size: 12.5px; margin-top: 0; }
details.advanced-section { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--line-2); border-radius: 4px; padding: 8px 12px; }
details.advanced-section summary { cursor: pointer; font-size: 11.5px; color: var(--muted); letter-spacing: .06em; }
details.advanced-section[open] summary { color: var(--accent); margin-bottom: 8px; }
details.advanced-section .field-group { display: inline-block; min-width: 180px; margin: 4px 10px 4px 0; }
.settings-panel.disabled .settings-mode-buttons,
.settings-panel.disabled .settings-mode-preview,
.investment-mode-container:not(.enabled) .mode-buttons { opacity: .45; pointer-events: none; }
/* NOTE: the original styles.css ended here mid-selector, at a bare
   ".investment-mode-c" with no declaration block.  CSS treats a dangling
   selector as the start of the NEXT rule, so it silently absorbed the first
   rule appended below and that rule never applied.  Neutralised in V18.2.7.3.  */

/* ============================================================
   ★ V18.2.7.3 — navigation emphasis + Positions split layout
   Presentation only.  Nothing in this block affects trading logic.
   ============================================================ */

/* Dashboard is the primary destination: boxed, and larger than its neighbours. */
.nav-btn.nav-btn-hero {
  height: 36px; align-self: center; flex: 0 0 auto;
  margin: 0 18px; padding: 0 24px;
  font-size: 15px; font-weight: 800; letter-spacing: 0.12em;
  color: #d9fbf6;
  background: linear-gradient(180deg, rgba(45,212,191,.22), rgba(45,212,191,.07));
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(45,212,191,.10), 0 2px 16px rgba(45,212,191,.20);
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.nav-btn.nav-btn-hero:hover {
  color: #fff; border-color: #5eead4;
  background: linear-gradient(180deg, rgba(45,212,191,.30), rgba(45,212,191,.12));
}
.nav-btn.nav-btn-hero.active {
  color: #04211d; border-color: var(--accent);
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  box-shadow: 0 0 0 1px rgba(45,212,191,.22), 0 4px 18px rgba(45,212,191,.26);
}
.nav-btn.nav-btn-hero.active::after { display: none; }   /* the box is the indicator */

/* ── Positions: position table on the left, live chart on the right ── */
.view.view-wide { max-width: 1680px; }
.pos-split {
  display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
  gap: 14px; align-items: start;
}
.pos-split-left { min-width: 0; overflow-x: auto; }
.pos-split-left .data-table { font-size: 11.2px; }
.pos-split-left .data-table th, .pos-split-left .data-table td { padding: 6px 4px; }
.pos-split-left .data-table th { letter-spacing: .04em; }
.pos-split-left .data-table .btn { padding: 3px 9px; font-size: 10.5px; }
/* keep the timestamp on two tidy lines (date / time) instead of breaking at
   every hyphen, without forcing the column wide enough for one long line. */
.pos-split-left .data-table td.pos-time {
  word-break: keep-all; min-width: 68px; line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.pos-row { cursor: pointer; }
.pos-row:hover { background: rgba(45,212,191,.05); }
.pos-row.pos-row-selected {
  background: rgba(45,212,191,.10);
  box-shadow: inset 2px 0 0 var(--accent);
}
.pos-split-right {
  min-width: 0;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 2px solid var(--accent-dim); border-radius: var(--radius);
  padding: 12px 14px 14px;
}
.poschart-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 10px;
}
.poschart-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
#poschart-symbol { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.poschart-side {
  font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 3px; white-space: nowrap;
  border: 1px solid var(--line-2); color: var(--muted);
}
.poschart-side.long   { color: var(--up);   border-color: #1d6b52; background: rgba(52,211,153,.10); }
.poschart-side.short  { color: var(--down); border-color: #6b2c3d; background: rgba(251,113,133,.10); }
.poschart-side.closed { color: var(--warn); border-color: #6b5320; background: rgba(251,191,36,.10); }
.poschart-tfs { display: flex; gap: 4px; flex-shrink: 0; }
.tf-btn {
  padding: 3px 9px; border-radius: 3px; cursor: pointer; font-size: 11px; font-weight: 600;
  background: var(--inset); border: 1px solid var(--line-2); color: var(--muted);
}
.tf-btn:hover { color: var(--text); border-color: var(--faint); }
.tf-btn.active { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-bg); }
.poschart-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.poschart-stats > div {
  background: var(--inset); border: 1px solid var(--line);
  border-radius: 4px; padding: 6px 8px; min-width: 0;
}
.poschart-stats span {
  display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 3px;
}
.poschart-stats strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.poschart-stats strong.up { color: var(--up); }
.poschart-stats strong.down { color: var(--down); }
#poschart-box { width: 100%; height: 400px; }
.poschart-empty {
  display: none; height: 400px; align-items: center; justify-content: center;
  text-align: center; color: var(--faint); font-size: 12.5px; line-height: 1.8;
  padding: 0 20px; border: 1px dashed var(--line-2); border-radius: 4px;
}
.poschart-empty.show { display: flex; }
.poschart-note { margin-top: 8px; font-size: 10.5px; color: var(--faint); line-height: 1.6; min-height: 15px; }

@media (max-width: 1180px) {
  .pos-split { grid-template-columns: 1fr; }
  #poschart-box, .poschart-empty { height: 320px; }
}

/* ==========================================================
   ### V18.2.7.5  alert stack (stale assets / unmanaged positions)
   Fixed overlay, outside #app - no effect on any tab layout.
   ========================================================== */
#javid-alert-stack {
  position: fixed; inset: 0 0 auto 0; z-index: 9999;
  pointer-events: none;
}
#stale-asset-banner,
#unmanaged-banner {
  display: none; padding: 10px 16px; pointer-events: auto;
  font-size: 13px; font-weight: 700; line-height: 1.5;
  color: #fff2f2; background: #7f1d1d;
  border-bottom: 2px solid #ef4444;
  box-shadow: 0 2px 14px rgba(0,0,0,.5);
}
#unmanaged-banner {
  color: #fff6ea; background: #7c2d12;
  border-bottom-color: #f59e0b;
}
#stale-asset-banner code {
  padding: 1px 6px; border-radius: 4px;
  background: rgba(0,0,0,.35); font-size: 12px;
}
.unmanaged-list {
  display: block; margin-top: 4px;
  font-weight: 600; color: #ffe4c7;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================
   ### V18.2.8.1-SIGNUP  Settings-tab "first time?" help block
   Append-only; every selector below is a NEW class, so no existing
   element can be restyled by these rules.
   ========================================================== */
.signup-help {
  margin-top: 14px; padding: 12px 14px;
  background: var(--inset); border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}
.signup-help-title {
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: #f0b90b; margin-bottom: 6px;
}
.signup-help-text {
  font-size: 12.5px; line-height: 1.7; color: var(--muted);
  margin-bottom: 10px;
}
.btn-signup {
  border-color: #f0b90b !important;   /* Binance yellow */
  color: #f0b90b !important;
  font-weight: 700;
}
.btn-signup:hover { background: rgba(240,185,11,.12); }
/* the two help links are <a>, not <button> - keep them on the button baseline */
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
