body[data-theme="dark"] {
  --ink: #e7edf6;
  --muted: #9ba9bb;
  --navy: #091321;
  --blue: #79a4ff;
  --line: #26364b;
  --panel: #141f2f;
  --bg: #0b1320;
  --green: #58b99b;
  --red: #f07b82;
  --orange: #e9a657;
  color-scheme: dark;
  background: var(--bg);
  color: var(--ink);
}

body[data-theme="dark"] .topbar,
body[data-theme="dark"] .market-strip,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .candidate,
body[data-theme="dark"] .chart-wrap,
body[data-theme="dark"] .price-plan,
body[data-theme="dark"] .price-plan > div,
body[data-theme="dark"] .demo-preview,
body[data-theme="dark"] .demo-preview-grid article {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}

body[data-theme="dark"] .topbar { border-bottom-color: var(--line); }
body[data-theme="dark"] .main-content { background: var(--bg); }
body[data-theme="dark"] .sidebar { background: var(--navy); }
body[data-theme="dark"] .breadcrumbs,
body[data-theme="dark"] .breadcrumbs strong,
body[data-theme="dark"] .page-heading h1,
body[data-theme="dark"] .section-heading h2,
body[data-theme="dark"] .panel-topline strong,
body[data-theme="dark"] .stock-identity h3,
body[data-theme="dark"] .candidate-title strong,
body[data-theme="dark"] .strategy-card h2,
body[data-theme="dark"] .validation-lanes h2,
body[data-theme="dark"] .capability-panel h2,
body[data-theme="dark"] .system-foot-panel h2,
body[data-theme="dark"] .department-card h3,
body[data-theme="dark"] .check-item strong,
body[data-theme="dark"] .rule-row strong,
body[data-theme="dark"] .demo-preview-head h2,
body[data-theme="dark"] .demo-preview-grid b {
  color: #e7edf6;
}

body[data-theme="dark"] .eyebrow,
body[data-theme="dark"] .page-heading p,
body[data-theme="dark"] .panel-topline > div > span,
body[data-theme="dark"] .market-cell .label,
body[data-theme="dark"] .market-cell small,
body[data-theme="dark"] .candidate-title small,
body[data-theme="dark"] .candidate-note,
body[data-theme="dark"] .candidate-score,
body[data-theme="dark"] .ticker,
body[data-theme="dark"] .price-plan span,
body[data-theme="dark"] .detail-rationale p,
body[data-theme="dark"] .news-box p,
body[data-theme="dark"] .strategy-card > p,
body[data-theme="dark"] .strategy-card li,
body[data-theme="dark"] .strategy-owner,
body[data-theme="dark"] .strategy-intro p,
body[data-theme="dark"] .department-card p,
body[data-theme="dark"] .validation-lanes p,
body[data-theme="dark"] .validation-lanes li,
body[data-theme="dark"] .capability-row,
body[data-theme="dark"] .capability-note,
body[data-theme="dark"] .check-item p,
body[data-theme="dark"] .check-state,
body[data-theme="dark"] .system-foot-panel p,
body[data-theme="dark"] .demo-preview-head p,
body[data-theme="dark"] .demo-preview-grid span,
body[data-theme="dark"] .page-footer {
  color: #9ba9bb;
}

body[data-theme="dark"] .market-cell,
body[data-theme="dark"] .candidate,
body[data-theme="dark"] .price-plan > div,
body[data-theme="dark"] .department-summary .panel,
body[data-theme="dark"] .department-card,
body[data-theme="dark"] .check-item,
body[data-theme="dark"] .capability-row,
body[data-theme="dark"] .scorecard-grid > div,
body[data-theme="dark"] .rule-row,
body[data-theme="dark"] .candidate:last-child {
  border-color: var(--line);
}

body[data-theme="dark"] .candidate:hover { background: #19273a; }
body[data-theme="dark"] .candidate.selected,
body[data-theme="dark"] .demo-candidate.selected { background: #1d2b43; }
body[data-theme="dark"] .candidate-rank { background: #202d40; color: #a7b7ce; }
body[data-theme="dark"] .demo-candidate .candidate-rank { background: #2c2440; color: #c5a4f1; }
body[data-theme="dark"] .tabs { background: #0e1929; }
body[data-theme="dark"] .tab { color: #9ba9bb; }
body[data-theme="dark"] .tab.active { background: #24344b; color: #a9c4ff; box-shadow: 0 1px 5px #0005; }
body[data-theme="dark"] .button,
body[data-theme="dark"] .theme-toggle { background: #172438; color: #dce6f4; border-color: #34455e; }
body[data-theme="dark"] .button:hover,
body[data-theme="dark"] .theme-toggle:hover { background: #22334a; border-color: #526c91; color: #fff; }
body[data-theme="dark"] .toss-credential-form label { color: #b8c4d5; }
body[data-theme="dark"] .toss-credential-form input { background: #101a29; border-color: #35445b; color: var(--ink); }
body[data-theme="dark"] .toss-credential-note { color: #a3b0c1; }
body[data-theme="dark"] .toss-secret-entry .button { background: #172438; color: #dce6f4; border-color: #34455e; }
body[data-theme="dark"] .theme-toggle { display: inline-flex; align-items: center; gap: 7px; }
body[data-theme="dark"] .profile-button { background: #263750; color: #c7d8f5; }
body[data-theme="dark"] .auth-gate { background: var(--bg); }
body[data-theme="dark"] .auth-card,
body[data-theme="dark"] .account-row { background: var(--panel); border-color: var(--line); color: var(--ink); }
body[data-theme="dark"] .auth-card h1,
body[data-theme="dark"] .account-row-identity strong { color: var(--ink); }
body[data-theme="dark"] .auth-card input,
body[data-theme="dark"] .account-create input,
body[data-theme="dark"] .account-create select,
body[data-theme="dark"] .account-row-controls input,
body[data-theme="dark"] .account-row-controls select { background: #101a29; border-color: #35445b; color: var(--ink); }
body[data-theme="dark"] .auth-notice { background: #382623; border-color: #5a3935; color: #ffb8a8; }
body[data-theme="dark"] .account-empty { border-color: var(--line); color: #a4b1c2; }
body[data-theme="dark"] .connection-chip { background: #172438; border-color: #34455e; color: #b2bfd0; }
body[data-theme="dark"] .connection-banner { background: #172840; border-color: #293f5e; color: #b9d0ff; }
body[data-theme="dark"] .connection-banner .banner-icon { background: #263c5b; color: #d6e3ff; }
body[data-theme="dark"] .connection-banner span { color: #a9bddb; }
body[data-theme="dark"] .demo-banner { background: #211d32; border-color: #40345c; color: #dfd1ff; }
body[data-theme="dark"] .demo-banner .banner-icon { background: #392d50; color: #e5d5ff; }
body[data-theme="dark"] .demo-banner span { color: #c4b1e4; }
body[data-theme="dark"] .demo-preview { background: linear-gradient(120deg, #141f2f, #1a2031); border-color: #40345c; }
body[data-theme="dark"] .demo-preview-foot { color: #c2a1ec; }
body[data-theme="dark"] .tag-pending { background: #263143; color: #aab6c6; }
body[data-theme="dark"] .tag-blue { background: #1d3150; color: #a9c4ff; }
body[data-theme="dark"] .tag-green { background: #183a36; color: #80d0b5; }
body[data-theme="dark"] .tag-red { background: #432832; color: #f4a1a5; }
body[data-theme="dark"] .tag-orange { background: #443522; color: #f4be76; }
body[data-theme="dark"] .tag-demo { background: #332749; color: #d1b4f7; }
body[data-theme="dark"] .detail-panel .stop-cell { background: #302027; }
body[data-theme="dark"] .news-box { background: #30271d; border-color: #4d3b25; }
body[data-theme="dark"] .news-box strong { color: #f0c37e; }
body[data-theme="dark"] .news-mark { background: #584126; color: #ffd28b; }
body[data-theme="dark"] .inline-code { background: #202d40; color: #c1cede; }
body[data-theme="dark"] .rule-check { background: #1b3b35; color: #7bd0b4; }
body[data-theme="dark"] .agent-progress,
body[data-theme="dark"] .scorecard-grid,
body[data-theme="dark"] .department-summary { color: var(--ink); }
body[data-theme="dark"] .scorecard-grid b,
body[data-theme="dark"] .rule-row small,
body[data-theme="dark"] .agent-progress,
body[data-theme="dark"] .flow-steps small { color: #9ba9bb; }
body[data-theme="dark"] .chart-label,
body[data-theme="dark"] .chart-axis { color: #9ba9bb; }
body[data-theme="dark"] .chart-label span + span,
body[data-theme="dark"] .chart-axis a { color: #b3c0d0; }
body[data-theme="dark"] .chart-grid { stroke: #29384c; }
body[data-theme="dark"] .candidate-empty { color: #a4b1c2; }
body[data-theme="dark"] .candidate-empty strong { color: #dce5f2; }
body[data-theme="dark"] .page-footer { border-color: var(--line); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #dfe5ed;
  border-radius: 7px;
  background: #fff;
  color: #516078;
  padding: 7px 10px;
  font:600 13px var(--font);
  cursor: pointer;
  white-space: nowrap;
}
.theme-toggle:hover { border-color: #b6c4dc; color: #315fc4; }
#theme-icon { font-size:16px; line-height: 1; }
@media(max-width:560px) {
  .theme-toggle { padding: 7px 8px; font-size:12px; }
}
