:root {
  --ink: #f4f4f4;
  --muted: #a7a7a7;
  --line: #2f2f2f;
  --paper: #050505;
  --panel: #111111;
  --accent: #ffffff;
  --accent-2: #d9d9d9;
  --rail: #000000;
  --price: #64c7d5;
  --money: #e8bd69;
  --ready: #4fd1a1;
  --blocked: #ff716b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 198px;
  background: var(--rail);
  color: #f7f7f7;
  padding: 24px 18px;
  transition: width 200ms ease, padding 200ms ease;
  overflow: hidden;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 30px;
  transition: justify-content 200ms ease;
}
.brand-text {
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 150ms ease;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #f4f4f4;
  color: #000;
  background: #fff;
  font-weight: 800;
}
.brand small {
  display: block;
  color: #9d9d9d;
  margin-top: 3px;
}
nav { display: grid; gap: 4px; }
nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f7f7f7;
  text-decoration: none;
  padding: 10px 12px;
  border-left: 3px solid transparent;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, padding 200ms ease;
}
nav a:hover { background: #151515; border-left-color: #ffffff; }
nav a.is-active { background: #1a1a1a; border-left-color: #ffffff; }
.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.nav-label {
  overflow: hidden;
  transition: opacity 150ms ease;
}

.workspace {
  margin-left: 198px;
  min-height: 100vh;
  padding: 12px 18px 36px;
  transition: margin-left 200ms ease;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  font-size: 13px;
}
.topbar-account { margin-left: auto; color: var(--ink); }
.logout-form { margin: 0; }
.logout-form .secondary { margin: 0; padding: 6px 10px; }
.sidebar-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: #1a1a1a;
  color: #f4f4f4;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: #2a2a2a; border-color: #777; }
.sidebar-toggle svg { width: 18px; height: 18px; }
.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
h1, h2 { margin: 0; }
h1 { font-size: 32px; }
h2 { font-size: 16px; }

.login-page {
  min-height: 100vh;
  overflow-x: hidden;
  background: #070908;
  font-family: "Bahnschrift", "Microsoft YaHei", sans-serif;
}
.login-stage {
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  align-items: center;
  gap: clamp(44px, 7vw, 110px);
  padding: 44px 0;
}
.login-market-visual {
  position: relative;
  min-height: min(690px, calc(100vh - 88px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #242927;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(100, 199, 213, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(100, 199, 213, 0.045) 1px, transparent 1px),
    #0b0e0d;
  background-size: 52px 52px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}
.login-market-visual::after {
  content: "QUANT / 01";
  position: absolute;
  right: 26px;
  top: 24px;
  color: #53605c;
  font: 600 11px/1 "Bahnschrift", sans-serif;
  letter-spacing: 0;
}
.login-brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 26px;
  border-bottom: 1px solid #242927;
}
.login-brand-code,
.login-kicker,
.login-visual-footer,
.login-card-foot {
  font-family: "Bahnschrift", sans-serif;
  letter-spacing: 0;
}
.login-brand-code {
  color: #b7c2be;
  font-size: 12px;
  font-weight: 650;
}
.login-market-copy {
  position: relative;
  z-index: 2;
  padding: clamp(64px, 10vh, 108px) 9% 0;
}
.login-kicker {
  display: block;
  color: var(--money);
  font-size: 11px;
  font-weight: 700;
}
.login-market-copy h1 {
  max-width: 8em;
  margin-top: 12px;
  color: #f6f8f7;
  font-size: 64px;
  line-height: 1.06;
  font-weight: 720;
}
.login-market-copy p {
  margin: 18px 0 0;
  color: #9aa6a1;
  font-size: 15px;
}
.login-market-chart {
  position: absolute;
  inset: 54% 7% 13%;
  display: grid;
  grid-template-columns: repeat(10, minmax(8px, 1fr));
  align-items: stretch;
  gap: clamp(10px, 2vw, 24px);
  opacity: 0.82;
}
.candle {
  position: relative;
  width: min(14px, 55%);
  height: var(--h);
  margin: var(--y) auto 0;
  border-radius: 1px;
  animation: candle-in 600ms ease both;
}
.candle::before {
  content: "";
  position: absolute;
  top: -18%;
  bottom: -18%;
  left: 50%;
  width: 1px;
  background: currentColor;
  transform: translateX(-50%);
}
.candle.up { color: #ef6461; background: #ef6461; }
.candle.down { color: #42b7a6; background: #42b7a6; }
.candle:nth-child(2n) { animation-delay: 70ms; }
.candle:nth-child(3n) { animation-delay: 140ms; }
.login-visual-footer {
  position: relative;
  z-index: 2;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 26px;
  border-top: 1px solid #242927;
  color: #67716d;
  font-size: 10px;
  font-weight: 650;
}
.login-card {
  width: 100%;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid #2b312f;
  border-radius: 8px;
  background: #101311;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}
.login-card-head h2 {
  margin-top: 10px;
  font-size: 28px;
  line-height: 1.15;
}
.login-card-head p {
  margin: 8px 0 0;
  color: #87918d;
  font-size: 13px;
}
.login-form {
  display: grid;
  gap: 18px;
  margin-top: 34px;
}
.login-form label { gap: 8px; }
.login-field-label {
  color: #b9c1be;
  font-size: 12px;
  font-weight: 650;
}
.login-form input:not([type="hidden"]) {
  min-height: 46px;
  padding: 10px 12px;
  border-color: #39403d;
  background: #090b0a;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.login-form input::placeholder { color: #59615e; }
.login-form input:focus-visible {
  outline: none;
  border-color: var(--price);
  background: #0c100f;
  box-shadow: 0 0 0 3px rgba(100, 199, 213, 0.13);
}
.login-submit {
  min-height: 46px;
  margin-top: 4px;
  border-color: #d8e2df;
  background: #ecf2f0;
  color: #090b0a;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}
.login-submit:hover {
  border-color: var(--price);
  background: var(--price);
}
.login-submit:focus-visible {
  outline: 2px solid var(--price);
  outline-offset: 3px;
}
.login-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid #292e2c;
  color: #69726e;
  font-size: 10px;
  font-weight: 650;
}
.login-error {
  padding: 10px 12px;
  border: 1px solid rgba(255, 113, 107, 0.42);
  border-left: 3px solid var(--blocked);
  border-radius: 4px;
  background: rgba(255, 113, 107, 0.08);
  color: #ff9a95;
  font-size: 13px;
}
@keyframes candle-in {
  from { opacity: 0; transform: scaleY(0.25); transform-origin: bottom; }
  to { opacity: 1; transform: scaleY(1); transform-origin: bottom; }
}
@media (prefers-reduced-motion: reduce) {
  .candle { animation: none; }
}
.form-section-title {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
}

.command, .secondary, button {
  border: 0;
  background: var(--accent);
  color: #050505;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border-radius: 6px;
}
.secondary { background: #2a2a2a; color: #fff; border: 1px solid #777; margin-top: 14px; }
.panel, .metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 0 0 1px #000, 0 18px 50px rgba(0, 0, 0, 0.35);
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px;
  margin: 12px 0 10px;
}
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 4px; font-size: 18px; }
.metric-action { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
.metric-action button { font-size: 13px; }
.compact { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
.layout-two {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 10px;
}
.form-grid {
  display: grid;
  gap: 8px;
}
label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--ink);
  background: #050505;
  border-color: #3a3a3a;
  font: inherit;
}
textarea { min-height: 86px; resize: vertical; }
.wide { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th { color: var(--muted); font-size: 12px; }
.status-line {
  min-height: 20px;
  color: var(--muted);
  margin: 8px 0 0;
}
.logbox {
  background: #000;
  color: #f4f4f4;
  min-height: 180px;
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
}
.curl-doc {
  min-height: 120px;
  margin: 0;
  white-space: pre-wrap;
  color: #d7d7d7;
  font-size: 12px;
}
.backtest-chart {
  width: 100%;
  min-height: 360px;
  border: 1px solid #222;
  border-radius: 8px;
  background: #050505;
  margin: 8px 0 10px;
}
.action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.action-row a {
  color: var(--accent);
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-decoration: none;
}
.spaced { margin-top: 10px; }
.toolbar, .section-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.section-title-row, .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  margin-bottom: 8px;
}
.panel-head.wide {
  grid-column: 1 / -1;
}
.head-note, .status-inline {
  color: var(--muted);
  font-size: 12px;
}
.compact-toolbar {
  margin-left: auto;
}
.compact-toolbar .secondary,
.run-modal__actions .secondary,
.action-row .secondary { margin-top: 0; }
.inline-field {
  display: flex;
  align-items: center;
  grid-template-columns: none;
  gap: 8px;
}
.inline-field input { width: 90px; }
.date-range-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}
.date-range-trigger {
  align-self: end;
  height: 32px;
  white-space: nowrap;
}
.mini {
  padding: 5px 9px;
  font-size: 12px;
  border: 1px solid #fff;
}
.pool-action {
  background: #ffd166;
  color: #050505;
  border-color: #ffd166;
}
.pool-action:hover:not(:disabled) {
  background: #ffe29a;
  border-color: #ffe29a;
}
.pool-action.is-in-pool {
  background: #2a2a2a;
  color: #8a8a8a;
  border-color: #444;
}
button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.switch-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.switch-field input {
  width: 34px;
  height: 18px;
  appearance: none;
  border: 1px solid #777;
  border-radius: 999px;
  background: #050505;
  position: relative;
  cursor: pointer;
  padding: 0;
}
.switch-field input::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #777;
  transition: transform 120ms ease, background 120ms ease;
}
.switch-field input:checked {
  border-color: #fff;
  background: #fff;
}
.switch-field input:checked::before {
  transform: translateX(16px);
  background: #050505;
}
.link-mini {
  color: #050505;
  background: #fff;
  text-decoration: none;
  font-weight: 700;
}
.danger {
  background: #050505;
  color: #fff;
}
.search-results {
  display: grid;
  gap: 6px;
}
.search-result {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid #3a3a3a;
  background: #050505;
  color: #fff;
  text-align: left;
}
.search-result:hover {
  border-color: #fff;
}
.stock-code-link {
  border: 0;
  border-bottom: 1px solid #888;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #58a6ff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.stock-code-link:hover {
  color: #9dccff;
  border-bottom-color: #9dccff;
}
.market-up {
  color: #ef5350;
  font-weight: 700;
}
.market-down {
  color: #26a69a;
  font-weight: 700;
}
.market-flat {
  color: #d7d7d7;
}
.price-value {
  color: var(--price);
  font-variant-numeric: tabular-nums;
}
.money-value {
  color: var(--money);
  font-variant-numeric: tabular-nums;
}
.value-unit {
  margin-left: 2px;
  color: #8ca6aa;
  font-size: 0.78em;
  font-weight: 600;
}
.status-ready {
  color: var(--ready);
  font-weight: 700;
}
.status-blocked {
  color: var(--blocked);
  font-weight: 700;
}
.amount-strong {
  color: #ffd166;
  font-weight: 700;
}
.amount-mid {
  color: #f6e58d;
  font-weight: 700;
}
.amount-normal {
  color: #d7d7d7;
}
.chart-modal[hidden] {
  display: none;
}
.position-modal[hidden] {
  display: none;
}
.position-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
}
.position-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
}
.position-modal__panel {
  position: absolute;
  top: 74px;
  right: 42px;
  width: min(360px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #fff;
  border-radius: 8px;
  background: #050505;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}
.chart-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.chart-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.chart-modal__panel {
  position: absolute;
  inset: 42px 48px;
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr) auto auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid #fff;
  border-radius: 8px;
  background: #050505;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}
.chart-modal__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.chart-modal__head strong {
  display: block;
  font-size: 17px;
}
.chart-modal__head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.chart-modal__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.chart-period.is-active {
  background: #fff;
  color: #050505;
}
#stock-echarts {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 1px solid #222;
  background: #050505;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}
.legend-day { color: #fff; }
.legend-month { color: #a7a7a7; }
.legend-year { color: #6f6f6f; }
.narrow { max-width: 520px; }

.progress-bar {
  position: fixed;
  top: 0;
  left: 198px;
  right: 0;
  z-index: 60;
  background: #0a0a0a;
  border-bottom: 1px solid #333;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(-100%);
  transition: transform 200ms ease, left 200ms ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.progress-bar.is-visible { transform: translateY(0); }
.progress-bar__label {
  font-size: 13px;
  color: #d7d7d7;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}
.progress-bar__track {
  flex: 1;
  height: 8px;
  background: #1a1a1a;
  border-radius: 4px;
  overflow: hidden;
  min-width: 80px;
}
.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #26a69a, #ffd166);
  border-radius: 4px;
  transition: width 300ms ease;
  width: 0%;
}
.progress-bar__pct {
  font-size: 12px;
  color: #a7a7a7;
  font-weight: 700;
  white-space: nowrap;
}
.progress-bar.is-done .progress-bar__fill { background: #26a69a; }
.progress-bar.is-error .progress-bar__fill { background: #ef5350; }

.refresh-modal[hidden] { display: none; }
.run-modal[hidden] { display: none; }
.run-modal {
  position: fixed;
  inset: 0;
  z-index: 68;
  display: grid;
  place-items: center;
}
.run-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.run-modal__panel {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #fff;
  border-radius: 8px;
  background: #050505;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}
.run-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.run-modal__head strong {
  display: block;
  font-size: 16px;
}
.run-modal__head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.run-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.date-modal[hidden] { display: none; }
.date-modal {
  position: fixed;
  inset: 0;
  z-index: 66;
  display: grid;
  place-items: center;
}
.date-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.date-modal__panel {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #fff;
  border-radius: 8px;
  background: #050505;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}
.date-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.date-modal__head strong {
  display: block;
  font-size: 16px;
}
.date-modal__head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.date-modal__presets, .date-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.date-modal__custom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.param-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.live-config-backtest-meta {
  margin-top: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.live-config-backtest-meta label {
  margin: 0;
}
.live-config-params-json {
  width: 100%;
  min-height: 140px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
  white-space: pre;
}
.field-hint {
  display: block;
  margin-top: 4px;
  color: #8a8a8a;
  font-size: 11px;
  font-weight: 500;
}
#live-config-backtest-metrics {
  margin-top: 8px;
}
#live-config-backtest-metrics:empty {
  display: none;
}
.param-field {
  padding: 10px;
  border: 1px solid #2f2f2f;
  border-radius: 6px;
  background: #0a0a0a;
}
.param-field__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #f4f4f4;
}
.param-field__meta small {
  color: #777;
  font-size: 11px;
  font-weight: 600;
}
.param-field__hint {
  color: #8a8a8a;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.refresh-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
}
.refresh-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.refresh-modal__panel {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  background: #050505;
  border: 1px solid #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  display: grid;
  gap: 14px;
}
.refresh-modal__title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}
.refresh-modal__body {
  display: grid;
  gap: 10px;
}
.refresh-modal__step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #a7a7a7;
}
.refresh-modal__step .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #333;
  flex-shrink: 0;
}
.refresh-modal__step.is-active .dot { background: #ffd166; animation: pulse 1s infinite; }
.refresh-modal__step.is-done .dot { background: #26a69a; }
.refresh-modal__step.is-failed .dot { background: #ef5350; }
.refresh-modal__step.is-skipped .dot { background: #444; }
.refresh-modal__step.is-active { color: #fff; }
.refresh-modal__step.is-done { color: #26a69a; }
.refresh-modal__step.is-failed { color: #ef5350; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.refresh-modal__result {
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #0a0a0a;
  color: #d7d7d7;
  display: none;
}
.refresh-modal__result.is-visible { display: block; }
.refresh-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---- sidebar collapsed state ---- */
body.sidebar-collapsed .sidebar { width: 64px; padding: 24px 10px; }
body.sidebar-collapsed .workspace { margin-left: 64px; }
body.sidebar-collapsed .progress-bar { left: 64px; }
body.sidebar-collapsed .brand { justify-content: center; }
body.sidebar-collapsed .brand-text { opacity: 0; pointer-events: none; }
body.sidebar-collapsed .nav-label { opacity: 0; pointer-events: none; }
body.sidebar-collapsed nav a { justify-content: center; padding-left: 0; padding-right: 0; }

@media (max-width: 860px) {
  .login-stage {
    width: min(620px, calc(100% - 32px));
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 0 28px;
  }
  .login-market-visual { min-height: 330px; }
  .login-market-copy { padding: 46px 28px 0; }
  .login-market-copy h1 { font-size: 42px; }
  .login-market-chart { inset: 63% 7% 14%; }
  .login-card { padding: 28px; }
  .sidebar { position: static; width: auto; }
  .workspace { margin-left: 0; padding: 16px; }
  .layout-two, .metric-grid { grid-template-columns: 1fr; }
  .progress-bar { left: 0; }
  .sidebar-toggle { display: none; }
  body.sidebar-collapsed .sidebar { width: auto; padding: 24px 18px; }
  body.sidebar-collapsed .workspace { margin-left: 0; }
  body.sidebar-collapsed .brand { justify-content: flex-start; }
  body.sidebar-collapsed .brand-text { opacity: 1; pointer-events: auto; }
  body.sidebar-collapsed .nav-label { opacity: 1; pointer-events: auto; }
  body.sidebar-collapsed nav a { justify-content: flex-start; padding-left: 12px; padding-right: 12px; }
  body.sidebar-collapsed .progress-bar { left: 0; }
  .date-range-group, .date-modal__custom { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .login-market-visual { min-height: 380px; }
  .login-brand-lockup { padding: 18px 20px; }
  .login-market-copy { padding: 38px 20px 0; }
  .login-market-copy h1 { font-size: 36px; }
  .login-market-chart { inset: 64% 7% 13%; gap: 9px; }
  .login-visual-footer { padding: 16px 20px; }
  .login-card { padding: 24px 20px; }
  .login-card-foot { flex-wrap: wrap; }
}

@media (max-width: 440px) and (max-height: 700px) {
  .login-stage { gap: 12px; padding-top: 10px; }
  .login-market-visual { min-height: 142px; }
  .login-brand-lockup { padding: 12px 16px; }
  .login-market-copy { padding: 16px; }
  .login-market-copy h1 { margin-top: 0; font-size: 28px; }
  .login-market-copy .login-kicker,
  .login-market-copy p,
  .login-market-visual::after,
  .login-visual-footer { display: none; }
  .login-market-chart { display: none; }
  .login-card { padding: 20px; }
  .login-card-head h2 { font-size: 24px; }
  .login-form { gap: 12px; margin-top: 20px; }
  .login-form label { gap: 6px; }
  .login-card-foot { display: none; }
}

.scan-pending { color: #a7a7a7; font-size: 12px; }
.scan-running { color: #ffd166; font-weight: 700; font-size: 12px; animation: pulse 1.2s infinite; }
.scan-completed { color: #26a69a; font-size: 12px; }
.scan-failed { color: #ef5350; font-size: 12px; }
.scan-skipped { color: #777; font-size: 12px; }
.scan-error { color: #ef5350; font-weight: 400; }
.result-cell { min-width: 280px; }
.result-item {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 1px solid #1a1a1a;
  font-size: 12px;
  white-space: nowrap;
}
.result-item:last-child { border-bottom: 0; }
.result-strat {
  color: #d7d7d7;
  font-weight: 700;
  min-width: 56px;
}

.readiness-list { display: grid; gap: 10px; }
.readiness-item {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}
