:root {
  color-scheme: light;
  --page: #f4f6f8;
  --ink: #101828;
  --muted: #667085;
  --quiet: #98a2b3;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: #e4e7ec;
  --line-strong: #cfd4dc;
  --black: #101828;
  --green: #067647;
  --amber: #b54708;
  --orange: #b54708;
  --red: #b42318;
  --blue: #175cd3;
  --blue-soft: #eff6ff;
  --yellow: #b7791f;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --r: 10px;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --terminal: #171916;
  --terminal-2: #20231f;
  --terminal-line: rgba(255, 255, 255, .10);
  --terminal-muted: rgba(255, 255, 255, .52);
  --terminal-active: #b8aa7a;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --row-h: 64px;
  --focus: 0 0 0 3px rgba(23, 92, 211, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "IBM Plex Sans", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  background:
    linear-gradient(90deg, rgba(16,24,40,.012) 1px, transparent 1px),
    linear-gradient(180deg, rgba(16,24,40,.012) 1px, transparent 1px),
    var(--page);
  background-size: 56px 56px, 56px 56px, auto;
}

a, button, input, select {
  font: inherit;
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }

button, .primary, .ghost {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-strong);
  color: var(--ink);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

button:hover, .primary:hover, .ghost:hover {
  border-color: #b2ccff;
  background: #f8fbff;
}

.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  font-weight: 700;
}

.primary:hover {
  background: #1849a9;
  border-color: #1849a9;
}

.icon-btn { width: 38px; padding: 0; }

svg { width: 17px; height: 17px; stroke-width: 2.1; flex: 0 0 auto; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  background: #101828;
  color: white;
  padding: 22px 16px;
}

.brand { display: block; }

.brand b, .brand span, .rail-note span, .rail-note b { display: block; }
.brand b { font-size: 18px; line-height: 1.2; }
.brand span, .rail-note span { color: rgba(255,255,255,.56); font-size: 12px; margin-top: 2px; }

nav { display: grid; gap: 5px; align-content: start; overflow-y: auto; min-height: 0; }

.nav-btn {
  width: 100%;
  min-height: 42px;
  border: 0;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  background: transparent;
  color: rgba(255,255,255,.72);
  text-align: left;
  padding: 0 10px;
  border-radius: 8px;
}

.nav-btn.active, .nav-btn:hover {
  background: rgba(255,255,255,.09);
  color: white;
}

.nav-btn.active::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--terminal-active);
}

.nav-btn.soon { opacity: .58; }

.rail-note {
  border-top: 1px solid rgba(255,255,255,.14);
  padding-top: 14px;
}

.main {
  position: relative;
  overflow: hidden;
  padding: 28px 32px;
  min-width: 0;
}

.page-decor {
  position: absolute;
  top: 10px;
  right: 44px;
  width: min(230px, 22vw);
  height: 170px;
  opacity: .10;
  pointer-events: none;
  filter: grayscale(1);
}

.page-decor svg {
  width: 100%;
  height: 100%;
}

.decor-line {
  fill: none;
  stroke: rgba(16, 24, 40, .42);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.decor-line.soft {
  stroke: rgba(16, 24, 40, .30);
  stroke-width: 2;
}

.decor-bars rect {
  fill: rgba(16, 24, 40, .20);
}

.topbar, #decision, .view {
  max-width: 1460px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 16px;
}

.eyebrow {
  display: inline-flex;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

h1, h2, h3, p { margin: 0; }
h1 { margin-top: 4px; font-size: 30px; line-height: 1.15; font-weight: 700; }
h2 { font-size: 22px; line-height: 1.18; }
h3 { font-size: 16px; line-height: 1.24; font-weight: 650; }

.top-actions { display: flex; gap: 8px; align-items: center; }

.context-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.title-switch-card {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.title-switch-card > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.title-switch-card > .switch-toggle {
  flex: 0 0 56px;
}

.switch-toggle {
  width: 56px;
  min-width: 56px;
  min-height: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 0;
  position: relative;
  overflow: hidden;
  background: #d0d5dd;
  justify-content: flex-start;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .04), inset 0 2px 5px rgba(16, 24, 40, .08);
  transition: background .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s ease, opacity .18s ease;
}

.switch-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #4795ff 0%, #2f80ed 100%);
  opacity: 0;
  transition: opacity .22s cubic-bezier(.2, .8, .2, 1);
}

.switch-toggle:hover { border-color: transparent; background: #b8c0cc; }
.switch-toggle.on::before { opacity: 1; }
.switch-toggle.on:hover::before { background: linear-gradient(180deg, #3f8dff 0%, #175cd3 100%); }

.switch-toggle i {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: white;
  margin-left: 3px;
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 7px rgba(16, 24, 40, .18), 0 0 0 1px rgba(16, 24, 40, .04);
  transition: transform .24s cubic-bezier(.24, 1.28, .36, 1), width .18s ease, box-shadow .18s ease;
}

.switch-toggle.on i { transform: translateX(26px); }
.switch-toggle:active i { width: 27px; }
.switch-toggle.on:active i { transform: translateX(23px); }
.switch-toggle.mini-switch {
  width: 48px;
  min-width: 48px;
  height: 26px;
  min-height: 26px;
}
.switch-toggle.mini-switch i {
  width: 20px;
  height: 20px;
}
.switch-toggle.mini-switch.on i { transform: translateX(22px); }
.switch-toggle.mini-switch.on:active i { transform: translateX(19px); }

.switch-action {
  gap: 10px;
  padding: 2px 6px 2px 12px;
  min-height: 38px;
  border-color: var(--line-strong);
  background: var(--panel-strong);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease;
}

.switch-action.on {
  border-color: #b2ccff;
  background: #f8fbff;
}

.switch-action:hover {
  border-color: #b2ccff;
  background: #f8fbff;
}

.switch-action-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.switch-action.module-switch {
  margin-left: auto;
}

.switch-action.row-switch {
  padding-left: 10px;
}

.head-switch-inline {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.top-actions .primary {
  background: var(--panel-strong);
  border-color: var(--line-strong);
  color: var(--ink);
  font-weight: 650;
}

.top-actions .primary:hover {
  background: #f8fbff;
  border-color: #b2ccff;
}

#decision { margin-bottom: 14px; }

.decision {
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--panel-strong);
  display: grid;
  grid-template-columns: minmax(300px, 1.15fr) repeat(4, minmax(140px, .45fr));
}

.decision-main, .decision-cell {
  padding: 15px 16px;
  border-right: 1px solid var(--line);
}

.decision-cell:last-child { border-right: 0; }

.decision-main { display: grid; gap: 7px; }
.decision-main strong { font-size: 19px; line-height: 1.25; font-weight: 700; }
.decision-main span, .decision-cell span, .muted { color: var(--muted); }
.decision-cell { display: grid; align-content: center; gap: 6px; }
.decision-cell b { font-size: 20px; line-height: 1.1; font-weight: 700; }

.dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 99px;
  background: var(--green);
  margin-right: 6px;
}
.dot.warn { background: var(--amber); }
.dot.bad { background: var(--red); }
.dot.info { background: var(--blue); }

.view {
  animation: none;
}

.notice {
  min-height: 44px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.notice.ok { border-left-color: var(--green); }
.notice.warn { border-left-color: var(--orange); }
.notice.bad { border-left-color: var(--red); }

.notice button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
}

.auth-locked .main,
.auth-locked .rail {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(238, 242, 239, .62);
  backdrop-filter: blur(10px);
}

.auth-card {
  width: min(760px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 16px;
}

.auth-icon {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: var(--blue);
}

.auth-copy {
  display: grid;
  gap: 12px;
}

.auth-copy h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.auth-copy p {
  margin: 0;
  color: var(--muted);
  max-width: 620px;
}

.auth-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.auth-meta span,
.auth-error {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
}

.auth-error {
  width: fit-content;
  border-color: rgba(192, 57, 43, .24);
  background: #fff5f4;
  color: var(--red);
  border-radius: 8px;
}

.auth-form {
  display: grid;
  grid-template-columns: minmax(150px, 220px) auto;
  gap: 10px;
  justify-content: start;
  align-items: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 24, 40, .42);
  backdrop-filter: blur(7px);
  overflow: auto;
}

.confirm-modal {
  width: min(520px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(16, 24, 40, .28);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
}

.setup-guide-modal {
  position: relative;
  width: min(560px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(16, 24, 40, .28);
  padding: 26px;
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.success-mark {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ecfdf3;
  color: var(--green);
  border: 1px solid #abefc6;
  box-shadow: 0 0 0 10px rgba(6, 118, 71, .08);
}

.success-mark svg {
  width: 38px;
  height: 38px;
  stroke-width: 2.6;
}

.setup-guide-copy {
  display: grid;
  gap: 8px;
}

.setup-guide-copy h3 {
  font-size: 22px;
}

.setup-guide-copy p {
  max-width: 440px;
  color: var(--muted);
  line-height: 1.58;
}

.setup-guide-modal .modal-actions {
  justify-content: center;
  margin-top: 4px;
}

.modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
}

.confirm-modal h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.purchase-modal {
  position: relative;
  width: min(860px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(16, 24, 40, .28);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(230px, .7fr);
  gap: 18px;
  padding: 22px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
}

.purchase-copy {
  display: grid;
  gap: 12px;
  align-content: start;
}

.purchase-copy h3 {
  margin: 0;
  font-size: 22px;
}

.purchase-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.purchase-facts div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-2);
  display: grid;
  gap: 4px;
}

.purchase-facts span {
  color: var(--muted);
  font-size: 12px;
}

.purchase-facts .copyable-fact {
  padding: 0;
}

.fact-copy {
  min-height: 76px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 10px;
  background: transparent;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: end;
  justify-items: start;
  gap: 6px;
  text-align: left;
}

.fact-copy:hover {
  background: #eef4ff;
}

.fact-copy b {
  min-width: 0;
  width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
}

.purchase-qr {
  display: grid;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.purchase-qr .asset-image-frame {
  width: min(260px, 100%);
  height: auto;
  min-height: 260px;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
  overflow: visible;
}

.purchase-qr img {
  width: min(100%, 260px);
  height: auto;
  object-fit: contain;
  display: block;
}

.activation-box {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .35fr);
  gap: 10px;
}

.activation-box label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.activation-hint {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  border: 1px dashed var(--line);
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 12px;
}

.activation-box textarea {
  min-height: 74px;
  resize: vertical;
}

.activation-feedback {
  grid-column: 1 / -1;
  border-left: 4px solid var(--line-strong);
  background: #f8fafc;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.activation-feedback.info { border-left-color: var(--accent); }
.activation-feedback.warn { border-left-color: var(--orange); }
.activation-feedback.bad { border-left-color: var(--red); }
.activation-feedback.ok { border-left-color: var(--green); }

.activation-box .modal-actions {
  grid-column: 1 / -1;
}

.modal-message {
  display: grid;
  gap: 5px;
  color: var(--muted);
  line-height: 1.5;
}

.modal-message p { margin: 0; }

.modal-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(255,255,255,.78) inset;
  animation: none;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-head {
  min-height: 54px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel-title-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.panel-title-stack > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.panel-body { padding: 16px 18px; }
.span3 { grid-column: span 3; }
.span4 { grid-column: span 4; }
.span5 { grid-column: span 5; }
.span6 { grid-column: span 6; }
.span7 { grid-column: span 7; }
.span8 { grid-column: span 8; }
.span12 { grid-column: 1 / -1; }

.exchange-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

.exchange-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-strong);
  display: grid;
  gap: 12px;
  width: 100%;
  text-align: left;
  align-items: stretch;
  justify-content: stretch;
}

.exchange-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.exchange-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef4f1;
  border: 1px solid var(--line);
  font-weight: 900;
}

.exchange-logo.binance { background: #fff9e6; color: #7d5700; border-color: #f6d98b; }
.exchange-logo.okx { background: #111827; color: white; }
.exchange-logo.gate { background: #eaf3ff; color: #1c5b94; }
.exchange-logo.bitget { background: #effaf1; color: #1b783e; }

.exchange-logo img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.asset-image-frame {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 1em;
  min-height: 1em;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #eef2f6;
  color: var(--quiet);
}

.asset-image-frame .asset-image {
  grid-area: 1 / 1;
  opacity: 0;
  transition: opacity .16s ease;
}

.asset-image-frame.is-loaded .asset-image {
  opacity: 1;
}

.asset-spinner {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 2px solid #cfd4dc;
  border-top-color: var(--blue);
  animation: spin .72s linear infinite;
}

.asset-loading {
  grid-area: 1 / 1;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.asset-loading-text {
  line-height: 1.2;
}

.asset-image-frame.is-loaded .asset-loading,
.asset-image-frame.is-loaded .asset-spinner {
  display: none;
}

.exchange-logo .asset-image-frame {
  width: 24px;
  height: 24px;
  border-radius: 5px;
}

.exchange-logo .asset-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asset-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 11px;
  color: var(--ink);
}

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

.kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fafb;
}

.kpi span { color: var(--muted); font-size: 12px; }
.kpi b { display: block; margin-top: 6px; font-size: 23px; line-height: 1.04; }
.kpi small { display: block; color: var(--quiet); margin-top: 5px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0 9px;
  background: #f9fafb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.chip.ok { color: var(--green); background: #ecfdf3; border-color: #abefc6; }
.chip.warn { color: var(--amber); background: #fffaeb; border-color: #fedf89; }
.chip.bad { color: var(--red); background: #fef3f2; border-color: #fecdca; }
.chip.info { color: var(--blue); background: var(--blue-soft); border-color: #b2ccff; }

.source-list, .position-list, .account-list, .event-list {
  display: grid;
  gap: 9px;
}

.source-module-strip {
  display: grid;
  gap: 12px;
  border: 1px solid #b2ccff;
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbff;
}

.source-module-main {
  display: grid;
  gap: 4px;
}

.source-module-main b {
  color: var(--ink);
  font-size: 14px;
}

.source-module-main span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.source-section-label {
  padding: 4px 2px 0;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 750;
}

.action-strip {
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.onboarding-panel .panel-head {
  align-items: center;
}

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

.onboarding-step {
  position: relative;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  padding: 16px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  overflow: hidden;
}

.onboarding-step .step-index {
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 34px;
  font-weight: 900;
  color: rgba(16, 24, 40, .055);
  line-height: 1;
}

.onboarding-step > svg {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
}

.onboarding-step b,
.onboarding-step span {
  display: block;
}

.onboarding-step b {
  font-size: 15px;
  line-height: 1.3;
}

.onboarding-step span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.source-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.source-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  background: #1d2939;
  color: white;
  font-weight: 900;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar .asset-image-frame {
  border-radius: inherit;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,0)),
    #263241;
  color: #fff;
  font-weight: 900;
  font-size: 19px;
}

.row-title { display: grid; gap: 5px; min-width: 0; }
.row-title b { font-size: 17px; overflow-wrap: anywhere; }
.row-title span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.row-title small { color: var(--quiet); font-size: 12px; overflow-wrap: anywhere; }

.position-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.15fr) minmax(128px, .75fr) repeat(3, minmax(112px, .55fr)) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.position-row.warn {
  border-color: #fedf89;
  background: #fffaf0;
}

.position-row > .chips {
  justify-self: end;
  min-width: 86px;
  justify-content: flex-end;
}

.position-row > .chips .chip { white-space: nowrap; }

.symbol {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
}

.coin {
  width: 34px;
  height: 34px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: #edf2ef;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
}

.coin img { width: 100%; height: 100%; object-fit: cover; display: block; }

.coin .asset-image-frame {
  border-radius: inherit;
}

.symbol b { display: block; font-size: 17px; }
.symbol span, .cell span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.cell b { display: block; font-variant-numeric: tabular-nums; font-size: 16px; }

.source-cell b {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.inline-exchange {
  width: 1em;
  height: 1em;
  border-radius: 3px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: #111614;
  color: white;
  font-size: 1em;
  line-height: 1;
}

.inline-exchange.binance { background: #fff5cf; color: #7d5700; }
.inline-exchange img { width: .86em; height: .86em; object-fit: contain; display: block; }
.inline-exchange .asset-image-frame {
  width: .86em;
  height: .86em;
  min-width: .86em;
  min-height: .86em;
  border-radius: 3px;
}

.inline-exchange .asset-spinner {
  width: .62em;
  height: .62em;
  border-width: 1px;
}

.account-row, .event-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.account-row.api-account-row {
  grid-template-columns: minmax(0, 1fr) auto 32px;
  align-items: center;
}

.account-row.api-account-row.has-copy-edit {
  grid-template-columns: minmax(0, 1fr) auto 32px 32px;
}

.api-delete-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-color: #b2ccff;
  background: var(--blue-soft);
  color: var(--blue);
}

.source-edit-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-color: #b2ccff;
  background: var(--blue-soft);
  color: var(--blue);
}

.api-delete-btn:hover,
.source-edit-btn:hover {
  border-color: var(--blue);
  background: #dbeafe;
}

.event-row { grid-template-columns: 92px 1fr auto; align-items: center; }
.event-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.event-row b { display: block; }
.event-row span { color: var(--muted); font-size: 13px; margin-top: 3px; display: block; }

.event-row.event-explained {
  display: block;
  padding: 0;
  overflow: hidden;
  border-left: 3px solid transparent;
}

.event-row.event-explained.bad { border-left-color: var(--red); }
.event-row.event-explained.warn { border-left-color: var(--amber); }
.event-row.event-explained.ok { border-left-color: var(--green); }
.event-row.event-explained.info { border-left-color: var(--blue); }

.event-main {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.event-main:hover { background: #f8fafc; }

.event-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.event-copy em {
  color: var(--ink);
  font-style: normal;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.event-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.event-side svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.event-detail {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 12px;
  color: var(--muted);
  transition: max-height .24s ease, opacity .18s ease, padding .24s ease;
}

.event-row.expanded .event-detail {
  max-height: 240px;
  opacity: 1;
  padding: 0 12px 12px 104px;
}

.event-detail p {
  margin: 6px 0 0;
  line-height: 1.55;
}

.no-order-guide {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid #fbbf24;
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: #fffbeb;
  color: var(--ink);
}

.no-order-guide b,
.no-order-guide span,
.no-order-guide em {
  display: block;
}

.no-order-guide b {
  font-size: 15px;
  line-height: 1.3;
}

.no-order-guide span,
.no-order-guide em {
  margin-top: 4px;
  color: #69401c;
  font-size: 13px;
  line-height: 1.5;
}

.no-order-guide em {
  font-style: normal;
  color: #92400e;
  font-weight: 700;
}

.no-order-pulse {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fef3c7;
  color: var(--amber);
  animation: noOrderPulse 1.6s ease-in-out infinite;
}

@keyframes noOrderPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(181, 71, 8, .24); }
  50% { box-shadow: 0 0 0 8px rgba(181, 71, 8, 0); }
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.module-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 14px;
  display: grid;
  gap: 10px;
  min-height: 138px;
}

.module-card.system {
  background: #f9fafb;
}

.module-card.paid {
  border-color: #fedf89;
}

.module-card.locked {
  background: #fffaf0;
}

.module-inline-notice {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(47, 128, 237, .24);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: #f3f8ff;
  color: #1d4f8f;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.5;
}

.module-inline-notice.warn {
  border-color: rgba(245, 158, 11, .34);
  border-left-color: #f59e0b;
  background: #fff8eb;
  color: #92400e;
}

.module-inline-notice.bad {
  border-color: rgba(239, 68, 68, .30);
  border-left-color: #ef4444;
  background: #fff5f5;
  color: #991b1b;
}

.module-inline-notice svg {
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.module-top, .module-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.module-actions { margin-top: auto; }
.module-actions button:disabled { opacity: .55; cursor: not-allowed; }

.panel-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.loading-state {
  grid-column: 1 / -1;
  grid-template-columns: 34px 1fr;
  align-items: center;
}

.loading-spinner {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--blue);
  animation: spin .72s linear infinite;
}

.about-grid,
.preflight-grid,
.advanced-settings-grid {
  display: grid;
  gap: 10px;
}

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

.about-grid > div,
.preflight-card,
.advanced-form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.about-grid > div {
  min-height: 70px;
  padding: 12px;
  display: grid;
  gap: 6px;
  align-content: center;
}

.about-grid span,
.preflight-metrics span,
.settings-intro,
.advanced-form-section p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.about-grid b,
.preflight-metrics b {
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.preflight-card {
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.panel-head.compact {
  padding: 0;
  margin: 0;
  border: 0;
}

.preflight-row {
  border-left: 3px solid var(--amber);
  background: var(--panel);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.preflight-row.ok { border-left-color: var(--green); }

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

.preflight-metrics > div {
  padding: 8px;
  border-radius: 7px;
  background: var(--surface-3);
  display: grid;
  gap: 4px;
}

.advanced-settings-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.settings-intro {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--blue-soft);
}

.advanced-settings-grid label,
.advanced-form-section label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-save {
  grid-column: 1 / -1;
}

.advanced-form-section {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.advanced-form-section.span-all {
  grid-column: 1 / -1;
}

.advanced-form-section h4,
.advanced-form-section p {
  grid-column: 1 / -1;
}

.advanced-form-section h4 {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

.account-settings-modal {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.account-settings-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.account-settings-head .modal-close {
  top: 14px;
  right: 14px;
}

.account-settings-form {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px 18px 18px;
  overflow: auto;
  max-height: calc(100vh - 196px);
  background: #f8fafc;
}

.account-settings-form .advanced-form-section {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #fff;
}

.account-settings-form .advanced-form-section:first-of-type {
  grid-template-columns: minmax(190px, 1.2fr) repeat(3, minmax(160px, 1fr));
}

.account-settings-form .advanced-form-section:first-of-type label:first-of-type {
  grid-row: span 2;
}

.advanced-form-section .toggle-line {
  min-height: 58px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  align-content: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  line-height: 1.35;
}

.advanced-form-section .toggle-line .label-help {
  justify-self: start;
}

.account-settings-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.account-settings-actions .multi-trader-save {
  width: auto;
  min-width: 170px;
}

.inline-enhancer {
  border: 1px dashed #b2ccff;
  border-radius: 8px;
  padding: 12px;
  background: #f5f8ff;
  display: grid;
  gap: 10px;
}

.inline-enhancer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.inline-enhancer-head span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(96px, .46fr) minmax(130px, .6fr) minmax(110px, auto);
  gap: 8px;
  align-items: end;
}

.inline-form label,
.inline-form .field-block {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.label-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.label-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--muted);
  vertical-align: -2px;
}

.label-help svg {
  width: 13px;
  height: 13px;
}

.label-help:hover,
.label-help:focus-visible {
  color: var(--blue);
  outline: none;
}

.portfolio-id-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 4px;
  align-items: center;
}

.scan-square {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.scan-square:hover {
  border-color: #1849a9;
  background: #1849a9;
  color: #fff;
}

.inline-form [data-save-inline-multi-trader] {
  min-width: 110px;
  min-height: 40px;
  white-space: nowrap;
}

.inline-form [data-save-inline-multi-trader] span {
  white-space: nowrap;
}

.sr-only-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.scan-choice-modal {
  width: min(430px, 100%);
}

.multi-trader-modal {
  position: relative;
  width: min(520px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(16, 24, 40, .28);
  display: grid;
  gap: 16px;
  padding: 22px;
}

.multi-trader-modal .modal-copy {
  padding-right: 34px;
}

.multi-trader-modal .modal-copy h3 {
  margin: 4px 0 6px;
  font-size: 20px;
}

.multi-trader-modal .modal-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.52;
}

.multi-trader-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.multi-trader-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.multi-trader-form [data-multi-dialog-field="portfolio_id"],
.multi-trader-form [data-account-dialog-field="account_id"],
.multi-trader-form .toggle-line {
  grid-column: 1 / -1;
}

.multi-trader-form .toggle-line,
.wizard-multi-fields .toggle-line {
  display: inline-flex;
  align-items: center;
}

.leverage-toggle {
  align-self: end;
}

.multi-trader-save {
  width: 100%;
  min-height: 44px;
  justify-content: center;
}

.scan-choice-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.scan-choice-actions button {
  min-height: 46px;
}

.toggle-line input[type="checkbox"] {
  width: 44px;
  height: 26px;
}

.account-settings-modal {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.module-workbench {
  display: grid;
  gap: 16px;
}

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

.workbench-summary > div {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 14px;
}

.workbench-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.workbench-summary b {
  font-size: 15px;
}

.button-row,
.form-actions.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.lead-guide-panel .panel-head {
  align-items: start;
}

.lead-guide {
  display: grid;
  gap: 16px;
}

.lead-guide-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lead-guide-summary > div {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  padding: 12px;
}

.lead-guide-summary span,
.lead-account-slot > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.lead-guide-summary b,
.lead-account-slot > b {
  font-size: 14px;
}

.lead-step-list {
  display: grid;
  gap: 10px;
}

.lead-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface);
}

.lead-step.done {
  border-color: #b2ccff;
  background: var(--blue-soft);
}

.lead-step.warn {
  border-color: #b2ccff;
  background: #f8fbff;
}

.lead-step.todo {
  background: #f8fafc;
}

.lead-step-mark {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e2e8f0;
  color: #475467;
}

.lead-step.done .lead-step-mark {
  background: var(--blue);
  color: white;
}

.lead-step.warn .lead-step-mark {
  background: #eaf2ff;
  color: var(--blue);
  box-shadow: inset 0 0 0 1px #b2ccff;
}

.lead-step b {
  display: block;
  font-size: 14px;
}

.lead-step span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.lead-step > button,
.lead-step > .switch-action {
  justify-self: end;
}

.lead-guide-actions {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.lead-account-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.lead-account-slot {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: #f8fafc;
}

.lead-account-slot.ready {
  border-color: #b2ccff;
  background: var(--blue-soft);
}

.lead-account-slot.pending {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.lead-account-slot.missing {
  border-style: dashed;
}

.lead-account-slot small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.lead-slot-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 6px 8px 6px 12px;
}

.lead-slot-toggle span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.lead-slot-toggle .switch-toggle {
  flex: 0 0 56px;
}

.compact-grid {
  display: grid;
  gap: 12px;
}

.totp-box {
  display: grid;
  gap: 12px;
  max-width: 820px;
}

.totp-box textarea {
  min-height: 76px;
  resize: vertical;
}

.totp-setup-grid {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.totp-qr {
  width: 176px;
  min-height: 176px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.totp-qr svg {
  width: 152px;
  height: 152px;
  display: block;
}

.qr-fallback {
  color: var(--muted);
  font-size: 13px;
}

.totp-secret-fields {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.setup-shell { overflow: hidden; }

.setup-body { padding: 14px; }

.setup-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.setup-tutorial-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  color: var(--brand, #10b981);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: opacity .15s;
}
.setup-tutorial-link:hover { opacity: .72; text-decoration: underline; }
.setup-tutorial-link i { width: 16px; height: 16px; }

.setup-work-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.setup-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 6px;
}

.setup-tabs button {
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 52px;
  background: transparent;
  justify-content: flex-start;
  padding: 8px 10px;
  text-align: left;
}

.setup-tabs button.active {
  background: #fff;
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: inset 0 -3px 0 var(--blue);
}

.setup-tabs button > span { display: grid; gap: 2px; }
.setup-tabs b { font-size: 14px; }
.setup-tabs small { color: var(--muted); font-size: 12px; }

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .55fr);
  gap: 12px;
}

.trader-setup-grid {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  align-items: start;
}

.trader-setup-main {
  display: grid;
  gap: 12px;
}

.setup-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 12px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.setup-card.wide { min-height: 210px; }

.setup-card.wide textarea { min-height: 118px; }

textarea {
  width: 100%;
  min-height: 132px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
  color: var(--ink);
  background: #fbfcfb;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 9px 11px;
}

input[type="checkbox"] {
  appearance: none;
  width: 44px;
  height: 26px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  position: relative;
  background: #d0d5dd;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .04), inset 0 2px 5px rgba(16, 24, 40, .08);
  cursor: pointer;
  flex: 0 0 44px;
  transition: background .22s cubic-bezier(.2, .8, .2, 1), box-shadow .18s ease;
}

input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(16, 24, 40, .18), 0 0 0 1px rgba(16, 24, 40, .04);
  transition: transform .24s cubic-bezier(.24, 1.28, .36, 1), width .18s ease;
}

input[type="checkbox"]:checked {
  background: linear-gradient(180deg, #4795ff 0%, #2f80ed 100%);
}

input[type="checkbox"]:checked::before {
  transform: translateX(18px);
}

input[type="checkbox"]:active::before {
  width: 23px;
}

input[type="checkbox"]:checked:active::before {
  transform: translateX(15px);
}

input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: var(--focus), inset 0 0 0 1px rgba(16, 24, 40, .04);
}

label span { font-weight: 740; }

.form-actions, .compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-strong);
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.file-button input { display: none; }

.preview-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbf8;
}

.preview-card span { display: block; color: var(--muted); margin-top: 4px; }

.preview-card.is-invalid {
  border-color: #f9a8a8;
  background: #fff7f7;
}

.wizard-multi-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.readonly-source-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 12px;
  align-items: start;
}

.readonly-source-card .panel-head {
  align-items: start;
}

.readonly-source-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.readonly-source-modal {
  width: min(680px, calc(100vw - 28px));
}

.readonly-source-form.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.readonly-source-form .span-full {
  grid-column: 1 / -1;
}

.readonly-source-note {
  display: grid;
  gap: 8px;
  border: 1px solid #b2ccff;
  border-radius: 8px;
  background: #f5f9ff;
  color: #24466f;
  padding: 10px 12px;
  font-size: 13px;
}

.readonly-source-note span {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-weight: 650;
}

.readonly-source-note svg,
.readonly-side-head svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.readonly-source-status {
  min-height: 210px;
}

.readonly-source-stat {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.readonly-source-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.readonly-source-stat b {
  font-size: 15px;
}

.readonly-side-panel {
  gap: 14px;
}

.readonly-side-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink);
}

.readonly-side-head b,
.readonly-flow-list b {
  display: block;
}

.readonly-side-head span {
  color: var(--muted);
  font-size: 13px;
}

.readonly-permissions {
  grid-template-columns: 1fr;
}

.readonly-flow-list {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.readonly-flow-list span {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.readonly-flow-list b {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e8f2ff;
  color: #1d5fa7;
  display: grid;
  place-items: center;
}

.wizard-multi-fields .toggle-line {
  align-self: end;
  min-height: 40px;
}

.copy-logic-note {
  grid-column: 1 / -1;
  border: 1px solid #b2ccff;
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: #f8fbff;
  padding: 11px 12px;
  display: grid;
  gap: 4px;
}

.copy-logic-note b {
  font-size: 13px;
  color: var(--ink);
}

.copy-logic-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.mini-steps {
  display: grid;
  gap: 8px;
  counter-reset: step;
}

.mini-steps span {
  counter-increment: step;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: start;
}

.mini-steps span::before {
  content: counter(step);
  width: 24px;
  height: 24px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: #344054;
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.setup-tutorial-panel,
.trader-tutorial-panel {
  position: sticky;
  top: 12px;
  gap: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.tutorial-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tutorial-switch button {
  min-height: 38px;
  justify-content: center;
  border-color: var(--line);
  background: #fff;
}

.tutorial-switch button.active {
  color: var(--blue-strong);
  border-color: rgba(47, 128, 237, .45);
  background: #eef6ff;
  box-shadow: inset 0 -2px 0 var(--blue);
}

.tutorial-phone {
  display: grid;
  justify-items: center;
  align-items: center;
}

.tutorial-phone-frame {
  position: relative;
  width: clamp(300px, 22vw, 390px);
  aspect-ratio: 1200 / 2670;
  border-radius: 34px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 10%, rgba(0, 0, 0, .22) 88%, rgba(255, 255, 255, .22)),
    linear-gradient(145deg, #2a323c, #0b0f14 54%, #2d3540);
  padding: 5px;
  box-shadow:
    0 18px 34px rgba(16, 24, 40, .20),
    0 2px 0 rgba(255, 255, 255, .34) inset,
    0 0 0 1px rgba(6, 12, 20, .62) inset;
  display: grid;
}

.tutorial-phone-frame::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .34) inset;
  pointer-events: none;
}

.tutorial-phone-frame::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 18%;
  width: 4px;
  height: 58px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d4d8df, #7d8795 48%, #f4f6f8);
  box-shadow: 0 78px 0 -1px #9aa3af;
  pointer-events: none;
}

.tutorial-phone-speaker {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 54px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, #111827, #030712);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .16);
  z-index: 4;
}

.tutorial-phone-camera {
  position: absolute;
  top: 13px;
  left: 50%;
  width: 9px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(circle at 56% 44%, #65758a 0 13%, #111827 15% 46%, #020617 48% 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .18), 0 1px 5px rgba(0, 0, 0, .42);
  z-index: 5;
  pointer-events: none;
}

.tutorial-phone-screen {
  position: relative;
  overflow: hidden;
  border-radius: 29px;
  background: #f4f6f9;
  display: grid;
  width: 100%;
  height: 100%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .82) inset;
}

.tutorial-slide-image.asset-image-frame {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 27px;
  background: #f2f4f7;
}

.tutorial-slide-image .asset-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tutorial-slide-image.slide-next {
  animation: tutorialSlideNext .48s cubic-bezier(.16, 1, .3, 1);
}

.tutorial-slide-image.slide-prev {
  animation: tutorialSlidePrev .48s cubic-bezier(.16, 1, .3, 1);
}

.tutorial-slide-image .asset-loading {
  background: #f3f6fa;
}

@keyframes tutorialSlideNext {
  from { opacity: .55; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes tutorialSlidePrev {
  from { opacity: .55; transform: translateX(-100%); }
  to { opacity: 1; transform: translateX(0); }
}

.tutorial-phone-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.tutorial-phone-placeholder svg {
  width: 30px;
  height: 30px;
  color: var(--blue);
}

.tutorial-phone-placeholder b {
  color: var(--ink);
  font-size: 16px;
}

.tutorial-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tutorial-caption b {
  color: var(--ink);
  font-size: 15px;
}

.tutorial-caption span {
  color: var(--muted);
  font-weight: 800;
}

.tutorial-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tutorial-nav button {
  min-height: 40px;
  justify-content: center;
}

.tutorial-empty {
  min-height: 420px;
  border: 1px dashed var(--line-strong);
  border-radius: 24px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.tutorial-empty svg {
  width: 32px;
  height: 32px;
  color: var(--blue);
}

.tutorial-empty b {
  color: var(--ink);
  font-size: 16px;
}

.api-flow {
  display: grid;
  gap: 12px;
}

.api-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.api-choice {
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  justify-content: start;
  text-align: left;
  padding: 10px 12px;
  border-color: var(--line);
  background: #fff;
}

.api-choice.active {
  border-color: #b2ccff;
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px rgba(23,92,211,.12);
}

.api-choice span:not(.exchange-logo) { display: grid; gap: 3px; }

.api-choice small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.panel-head.plain {
  min-height: auto;
  padding: 0;
  border: 0;
}

.title-with-logo {
  display: flex;
  align-items: center;
  gap: 9px;
}

.exchange-logo.small {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.numbered-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  counter-reset: api-step;
}

.numbered-steps span {
  counter-increment: api-step;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  padding: 10px 10px 10px 38px;
  position: relative;
  font-weight: 720;
  line-height: 1.35;
}

.numbered-steps span::before {
  content: counter(api-step);
  position: absolute;
  left: 10px;
  top: 10px;
  width: 20px;
  height: 20px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: #344054;
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.permission-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #f9fafb;
}

.permission {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.permission.ok { color: #087044; }
.permission.bad { color: #8c1f1f; }

.api-tip-strip {
  display: grid;
  gap: 8px;
  border: 1px solid #fedf89;
  border-radius: 8px;
  background: #fffbeb;
  padding: 10px 12px;
}

.api-tip-strip span {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  color: #69401c;
  font-size: 13px;
  line-height: 1.45;
}

.api-tip-strip svg {
  width: 16px;
  height: 16px;
  color: var(--amber);
  margin-top: 1px;
}

.field-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

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

.credential-fields.compact { margin-top: -2px; }

.credential-fields label {
  display: grid;
  gap: 6px;
}

.save-card { min-height: auto; }

.check-list {
  display: grid;
  gap: 9px;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hint-line {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.hint-line.warn { color: var(--amber); }

.tutorial-page {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 720px;
  overflow: hidden;
  background: #fff;
}

.tutorial-page-rail {
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  padding: 20px 16px;
  display: grid;
  gap: 22px;
  align-content: start;
}

.tutorial-menu-group {
  display: grid;
  gap: 8px;
}

.tutorial-menu-group > b {
  padding: 0 8px 4px;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 800;
}

.tutorial-menu-item {
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  gap: 10px;
  align-items: center;
  justify-content: stretch;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
}

.tutorial-menu-item.active,
.tutorial-menu-item:hover {
  background: var(--blue-soft);
  box-shadow: inset 3px 0 0 var(--blue);
}

.tutorial-menu-item strong,
.tutorial-menu-item small {
  display: block;
}

.tutorial-menu-item strong {
  font-size: 14px;
  line-height: 1.25;
}

.tutorial-menu-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.tutorial-menu-item > svg {
  width: 14px;
  height: 14px;
  color: var(--quiet);
}

.tutorial-article {
  padding: 30px 34px 40px;
  display: grid;
  gap: 22px;
  align-content: start;
}

.tutorial-hero {
  display: grid;
  gap: 8px;
  max-width: 780px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.tutorial-hero h2 {
  font-size: 32px;
  line-height: 1.12;
}

.tutorial-hero p {
  color: var(--muted);
  line-height: 1.58;
}

.tutorial-alert {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--ink);
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  max-width: 760px;
}

.tutorial-alert svg {
  color: var(--blue);
}

.tutorial-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 360px));
  gap: 12px;
}

.tutorial-permission-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  padding: 14px;
  display: grid;
  gap: 9px;
}

.tutorial-step-list {
  display: grid;
  gap: 0;
}

.tutorial-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
  gap: 42px;
  min-height: 360px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.tutorial-step-copy {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  max-width: 560px;
}

.tutorial-step-index {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
}

.tutorial-step-copy h3 {
  font-size: 18px;
}

.tutorial-step-copy p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.58;
}

.tutorial-phone-shot {
  justify-self: center;
  width: min(260px, 100%);
  min-height: 440px;
  display: grid;
  place-items: center;
  position: relative;
}

.tutorial-phone-shot::before {
  content: none;
}

.tutorial-full-image.asset-image-frame {
  width: 100%;
  min-height: 440px;
  aspect-ratio: 9 / 19;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.tutorial-full-image .asset-image {
  width: 100%;
  height: 100%;
  max-height: 560px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .18)) drop-shadow(0 4px 8px rgba(0, 0, 0, .1));
}

.tutorial-step-body { color: var(--muted); font-size: 15px; line-height: 1.8; }
.tutorial-step-body p { margin: 0 0 9px; }
.tutorial-step-body ul { margin: 0 0 9px; padding-left: 20px; }
.tutorial-step-body li { margin: 0 0 5px; }
.tutorial-step-body strong { color: var(--ink); font-weight: 800; }

.tutorial-phone-shot.web { width: min(720px, 100%); }
.tutorial-phone-shot.web .tutorial-full-image.asset-image-frame { aspect-ratio: 16 / 10; min-height: 0; }
.tutorial-phone-shot.web .tutorial-full-image .asset-image { object-fit: cover; max-height: 460px; border-radius: 14px; box-shadow: 0 22px 44px -28px rgba(15, 23, 42, .5); filter: none; }

.tutorial-shot-placeholder {
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  color: var(--muted);
}

.tutorial-shot-placeholder svg {
  width: 30px;
  height: 30px;
  color: var(--blue);
}

.tutorial-shot-placeholder b {
  color: var(--ink);
}

.tutorial-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.help-center {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 560px;
  overflow: hidden;
}

.help-rail {
  border-right: 1px solid var(--line);
  background: #f8fafc;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.help-rail-title {
  display: grid;
  gap: 5px;
}

.help-rail-title b {
  font-size: 16px;
}

.help-rail-title span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.help-topic-list {
  display: grid;
  gap: 8px;
}

.help-topic-list button {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: stretch;
  text-align: left;
  border-color: var(--line);
  background: #fff;
}

.help-topic-list button.active {
  border-color: #b2ccff;
  background: var(--blue-soft);
  box-shadow: inset 3px 0 0 var(--blue);
}

.help-topic-list small {
  color: var(--muted);
  font-size: 12px;
}

.help-article {
  padding: 26px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.help-article-head {
  display: grid;
  gap: 8px;
  max-width: 820px;
}

.help-article-head h3 {
  font-size: 24px;
}

.help-article-head p {
  color: var(--muted);
  line-height: 1.58;
}

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

.help-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 15px;
  display: grid;
  gap: 8px;
}

.help-section b {
  font-size: 15px;
}

.help-section span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.help-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

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

.check-lane {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-strong);
  display: grid;
  gap: 10px;
  align-content: start;
}

.lane-index {
  width: 30px;
  height: 30px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: #344054;
  color: white;
  font-weight: 900;
}

.coming-wrap {
  position: relative;
  min-height: 560px;
}

.blurred-demo {
  filter: blur(5px);
  opacity: .5;
  pointer-events: none;
}

.coming-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(238, 242, 239, .48);
}

.coming-overlay > div {
  width: min(460px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 22px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  text-align: center;
}

.module-empty {
  grid-column: 1 / -1;
  min-height: 150px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 18px;
  background: #f9fafb;
}

.module-mark {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #344054;
  color: white;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #f9fafb;
}

/* Finance console pass: preserve behavior, replace template-style visuals. */
.rail {
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 240px),
    var(--terminal);
  border-right: 1px solid #0d0f0c;
}

nav {
  gap: 18px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-group-label {
  padding: 0 10px 5px;
  color: var(--terminal-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

.nav-btn {
  position: relative;
  min-height: 38px;
  color: rgba(255,255,255,.72);
  border-radius: 6px;
  padding-left: 12px;
}

.nav-btn.active,
.nav-btn:hover {
  background: rgba(255,255,255,.075);
}

.nav-btn.active::after { display: none; }

.nav-btn.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 2px;
  border-radius: 2px;
  background: var(--terminal-active);
}

.nav-btn.soon {
  opacity: .42;
}

.rail-note {
  border-top-color: var(--terminal-line);
}

.page-decor {
  width: min(210px, 18vw);
  opacity: .055;
}

.decor-line,
.decor-line.soft {
  stroke: rgba(16, 24, 40, .55);
}

.decor-bars rect {
  fill: rgba(16, 24, 40, .26);
}

button,
.primary,
.ghost,
.file-button {
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
}

button:focus-visible,
.exchange-card:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

button.is-loading:not(.switch-action):not(.switch-toggle) {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

button.is-loading:not(.switch-action):not(.switch-toggle) svg,
button.is-loading:not(.switch-action):not(.switch-toggle) span {
  opacity: 0;
}

button.is-loading:not(.switch-action):not(.switch-toggle)::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 2px solid var(--blue);
  border-top-color: transparent;
  animation: spin .72s linear infinite;
}

.primary.is-loading:not(.switch-action):not(.switch-toggle)::after {
  border-color: #fff;
  border-top-color: transparent;
}

.switch-action.is-loading,
button.switch-toggle.is-loading {
  pointer-events: none;
  cursor: wait;
  color: var(--muted) !important;
  border-color: #d0d5dd !important;
  background: #f2f4f7 !important;
  opacity: 1;
}

.switch-action.is-loading .switch-action-label {
  color: var(--muted);
}

.switch-action.is-loading .switch-toggle,
button.switch-toggle.is-loading {
  background: #cfd4dc !important;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .05);
}

.switch-action.is-loading .switch-toggle::before,
button.switch-toggle.is-loading::before {
  opacity: 0;
}

.switch-action.is-loading .switch-toggle i,
button.switch-toggle.is-loading i {
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .14);
}

.switch-action.is-loading .switch-toggle i::after,
button.switch-toggle.is-loading i::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 999px;
  border: 2px solid #98a2b3;
  border-top-color: transparent;
  animation: spin .72s linear infinite;
}

.switch-action:disabled,
.switch-toggle:disabled {
  cursor: not-allowed;
  opacity: .72;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.panel {
  box-shadow: none;
}

.panel-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.exchange-card {
  position: relative;
  cursor: pointer;
  gap: 14px;
  padding: 16px;
  min-height: 218px;
  overflow: hidden;
  border-color: #d9e0ea;
  background: #fff;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.exchange-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: #d0d5dd;
}

.exchange-card:hover {
  border-color: #98a2b3;
  background: #fcfcfd;
  transform: translateY(-1px);
}

.exchange-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

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

.exchange-title h3 {
  font-size: 17px;
  font-weight: 700;
}

.exchange-title span,
.exchange-state small,
.exchange-equity span,
.exchange-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.exchange-state {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.status-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: currentColor;
}

.status-dot.ok { color: var(--green); }
.status-dot.warn { color: var(--amber); }
.status-dot.bad { color: var(--red); }

.exchange-equity {
  display: grid;
  gap: 5px;
  padding-top: 2px;
}

.exchange-equity b {
  font-size: 30px;
  line-height: 1;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.exchange-equity small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.exchange-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.exchange-metrics div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  background: var(--surface-2);
}

.exchange-metrics b {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 730;
  white-space: nowrap;
}

.exchange-actions {
  display: flex;
  gap: 7px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
}

.exchange-card:hover .exchange-actions,
.exchange-card:focus-within .exchange-actions {
  opacity: 1;
  transform: translateY(0);
}

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

.position-list {
  padding: 0;
}

.position-table {
  display: grid;
}

.position-head,
.position-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.15fr) minmax(150px, .9fr) repeat(3, minmax(96px, .55fr)) minmax(136px, .7fr);
  align-items: center;
  column-gap: 12px;
}

.position-head {
  min-height: 40px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
}

.position-row {
  position: relative;
  min-height: var(--row-h);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 18px;
  background: #fff;
}

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

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

.position-row.warn {
  border-color: var(--line);
  background: #fff;
}

.position-row.warn::before,
.position-row.bad::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--amber);
}

.position-row.bad::before {
  background: var(--red);
}

.position-row .cell span {
  display: none;
}

.position-row .cell b {
  font-size: 15px;
}

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

.status-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.ok {
  color: var(--green);
  border-color: #abefc6;
  background: #f6fef9;
}

.status-pill.warn {
  color: var(--amber);
  border-color: #fedf89;
  background: #fffcf5;
}

.status-pill.bad {
  color: var(--red);
  border-color: #fecdca;
  background: #fffbfa;
}

.row-actions {
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity .16s ease;
}

.position-row:hover .row-actions,
.position-row:focus-within .row-actions {
  opacity: 1;
}

.row-actions button {
  width: 30px;
  min-height: 30px;
  padding: 0;
}

.multi-trader-row .row-actions {
  opacity: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 30px;
}

.multi-trader-row .row-actions button {
  width: auto;
  min-height: 32px;
  padding: 6px 9px;
}

.multi-trader-row {
  position: relative;
  padding-right: 48px;
}

.multi-trader-row.module-paused {
  background: #fffdf7;
  border-color: #fedf89;
}

.multi-trader-edit-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-color: #b2ccff;
  background: #eff6ff;
  color: var(--blue);
}

.multi-trader-edit-btn:hover,
.multi-trader-edit-btn:focus-visible {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.multi-trader-edit-btn svg {
  width: 15px;
  height: 15px;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: 260px;
  padding: 7px 9px;
  border: 1px solid #344054;
  border-radius: 6px;
  background: #101828;
  color: #fff;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .14);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
}

.empty-state {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  align-items: center;
}

.empty-state b,
.empty-state span {
  display: block;
}

.empty-state span {
  margin-top: 4px;
  color: var(--quiet);
  font-size: 12px;
}

.empty-visual {
  width: 82px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  display: grid;
  place-items: center;
}

.empty-visual svg {
  width: 72px;
  height: 34px;
}

.empty-visual path {
  fill: none;
  stroke: #667085;
  stroke-width: 2;
}

.empty-visual circle {
  fill: #98a2b3;
}

.ui-loading .decision-cell b,
.ui-loading .exchange-equity b,
.ui-loading .exchange-metrics b {
  color: transparent;
  border-radius: 4px;
  background: linear-gradient(90deg, #eef2f6 25%, #f8fafc 38%, #eef2f6 63%);
  background-size: 400% 100%;
  animation: skeleton 1.1s ease infinite;
}

@keyframes skeleton {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

@media (max-width: 1180px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: static;
    height: auto;
    grid-template-rows: auto auto;
  }
  nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nav-group { align-content: start; }
  .rail-note { display: none; }
  .decision { grid-template-columns: 1fr 1fr; }
  .exchange-grid, .exchange-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tutorial-page { grid-template-columns: 1fr; }
  .tutorial-page-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .tutorial-step { grid-template-columns: minmax(0, 1fr) 240px; }
  .onboarding-steps, .help-section-grid { grid-template-columns: 1fr; }
  .help-center { grid-template-columns: 1fr; }
  .help-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .span3, .span4, .span5, .span6, .span7, .span8 { grid-column: 1 / -1; }
  .setup-workspace, .setup-grid, .trader-setup-grid, .readonly-source-layout, .readonly-source-form, .check-lanes, .credential-fields, .wizard-multi-fields, .inline-form, .activation-box, .multi-trader-form, .advanced-settings-grid, .advanced-form-section, .preflight-grid, .lead-guide-summary, .lead-account-slots { grid-template-columns: 1fr; }
  .setup-tutorial-panel, .trader-tutorial-panel { position: static; }
  .about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .totp-setup-grid { grid-template-columns: 1fr; }
  .totp-qr { width: 100%; min-height: 180px; }
  .numbered-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  .main { padding: 14px; }
  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }
  .top-actions {
    width: 100%;
    justify-self: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .context-actions { min-width: 0; justify-content: stretch; }
  .context-actions:empty { display: none; }
  .title-switch-card {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    justify-content: stretch;
  }
  .title-switch-card > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .top-actions .icon-btn { display: none; }
  .top-actions .primary { display: none; }
  h1 { font-size: 28px; }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decision, .exchange-grid, .exchange-grid.two, .kpis, .module-grid, .permission-grid, .api-choice-row, .numbered-steps, .workbench-summary, .about-grid, .preflight-metrics, .lead-guide-summary, .lead-account-slots, .onboarding-steps, .help-section-grid, .tutorial-permission-grid, .tutorial-step, .readonly-source-layout, .readonly-source-form { grid-template-columns: 1fr; }
  .decision-main, .decision-cell { border-right: 0; border-bottom: 1px solid var(--line); }
  .decision-cell:last-child { border-bottom: 0; }
  .nav-group-label { padding-top: 4px; }
  .exchange-card { min-height: auto; }
  .exchange-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exchange-actions { opacity: 1; transform: none; flex-wrap: wrap; }
  .source-row { grid-template-columns: 48px 1fr; }
  .source-actions { grid-column: 1 / -1; justify-self: end; }
  .position-head { display: none; }
  .position-table { gap: 8px; }
  .position-row {
    grid-template-columns: 1fr;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px 14px;
  }
  .position-row .cell span { display: block; }
  .position-status { align-items: flex-start; }
  .row-actions { opacity: 1; }
  .position-row .symbol, .position-row .position-status { grid-column: 1 / -1; }
  .event-row { grid-template-columns: 1fr; }
  .event-main { grid-template-columns: 1fr; }
  .event-row.expanded .event-detail { padding: 0 12px 12px; }
  .page-decor { display: none; }
  .module-empty { grid-template-columns: 1fr; }
  .lead-step {
    grid-template-columns: 34px minmax(0, 1fr);
  }
  .lead-step > button,
  .lead-step > .switch-action {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
  .action-strip, .compact-actions, .form-actions { display: grid; grid-template-columns: 1fr; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-form { grid-template-columns: 1fr; }
  .auth-form .primary { width: 100%; }
  .setup-workspace { grid-template-columns: 1fr; }
  .tutorial-page { grid-template-columns: 1fr; min-height: auto; }
  .tutorial-page-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .tutorial-article { padding: 18px; }
  .tutorial-hero h2 { font-size: 26px; }
  .tutorial-alert { border-radius: 10px; padding: 12px; }
  .tutorial-step { min-height: auto; gap: 18px; }
  .tutorial-phone-shot { width: min(100%, 230px); min-height: 390px; }
  .tutorial-full-image.asset-image-frame,
  .tutorial-full-image .asset-image,
  .tutorial-shot-placeholder { min-height: 390px; height: 390px; }
  .help-center { grid-template-columns: 1fr; min-height: auto; }
  .help-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .help-article { padding: 18px; }
  .setup-tabs { grid-template-columns: 1fr; }
  .setup-tutorial-panel { position: static; }
  .tutorial-phone-frame { width: min(100%, 300px); border-radius: 32px; padding: 5px; }
  .tutorial-phone-screen { border-radius: 27px; }
  .tutorial-slide-image.asset-image-frame { min-height: 0; border-radius: 25px; }
  .confirm-modal, .purchase-modal, .purchase-facts { grid-template-columns: 1fr; }
  .multi-trader-modal { padding: 18px; }
  .account-settings-modal { padding: 0; width: min(100%, calc(100vw - 20px)); max-height: calc(100vh - 20px); }
  .account-settings-head { padding: 18px 18px 14px; }
  .account-settings-form { padding: 12px; max-height: calc(100vh - 184px); }
  .account-settings-form .advanced-form-section,
  .account-settings-form .advanced-form-section:first-of-type {
    grid-template-columns: 1fr;
  }
  .account-settings-form .advanced-form-section:first-of-type label:first-of-type {
    grid-row: auto;
  }
  .account-settings-actions {
    display: grid;
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .account-settings-actions .multi-trader-save {
    width: 100%;
  }
  .modal-actions { display: grid; grid-template-columns: 1fr; }
}

/* === Gate 一级化：平台总控 + Gate 信号源提示（class 名沿用王站前端；样式按主线设计令牌补齐，王站 styles.css 本轮不可达，留待主进程比对）=== */
.platform-control-panel .platform-control-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.platform-control-panel .platform-control-body > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.platform-control-panel .platform-control-body > div:first-child b {
  font-size: 15px;
  color: var(--ink);
}

.platform-control-panel .platform-control-body > div:first-child span {
  color: var(--muted);
  font-size: 13px;
}

.runtime-guide {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  margin-bottom: 10px;
}

.runtime-guide > div:not(.runtime-guide-pulse) {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.runtime-guide b {
  font-size: 14px;
  color: var(--ink);
}

.runtime-guide span {
  font-size: 12.5px;
  color: var(--muted);
}

.runtime-guide .runtime-guide-pulse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: #ecfdf5;
  color: #0f766e;
}

.runtime-guide button {
  flex: none;
}

.gate-source-guide {
  border-color: var(--line-strong);
}

/* === 王站主页移植 2026-06-08 === */
.runtime-guide b,
.first-look-item b {
  display: block;
  color: var(--ink);
}
.runtime-guide span,
.first-look-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}
.runtime-guide-pulse,
.first-look-pulse {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fffaeb;
  color: var(--amber);
  box-shadow: 0 0 0 0 rgba(181, 71, 8, .24);
  animation: guidePulse 1.8s ease-out infinite;
}
.command-center {
  padding: 18px;
  border-color: #d9e0ea;
}
.command-center.ok { border-left: 4px solid var(--green); }
.command-center.warn { border-left: 4px solid var(--orange); }
.command-center.bad { border-left: 4px solid var(--red); }
.command-center.info { border-left: 4px solid var(--blue); }
.command-primary {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, 1.35fr);
  gap: 18px;
  align-items: stretch;
}
.command-status {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 9px;
}
.command-status h2 {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.command-status > span {
  color: var(--muted);
  line-height: 1.55;
}
.command-pnl {
  display: block;
  font-size: 46px;
  line-height: .98;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.command-pnl.pos,
.home-exchange-money.pos b,
.home-mini-position .pos b {
  color: var(--green);
}
.command-pnl.neg,
.home-exchange-money.neg b,
.home-mini-position .neg b {
  color: var(--red);
}
.command-pnl.flat,
.home-exchange-money.flat b,
.home-mini-position .flat b {
  color: var(--ink);
}
.command-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
}
.command-kpi-grid > div {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  background: var(--surface-2);
}
.command-kpi-grid span,
.command-kpi-grid small,
.home-exchange-money span,
.home-mini-position span,
.home-event-row span,
.home-risk-item small {
  color: var(--muted);
  font-size: 12px;
}
.command-kpi-grid b {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 780;
  white-space: nowrap;
}
.command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.first-look-guide {
  border-color: #fedf89;
  background:
    linear-gradient(90deg, rgba(255, 248, 235, .96), rgba(255, 255, 255, .98)),
    var(--panel);
}
.first-look-head {
  padding: 16px 18px 4px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.first-look-head span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 3px;
}
.first-look-grid {
  padding: 12px 18px 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.first-look-item {
  width: 100%;
  min-height: 96px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #fff;
  text-align: left;
  justify-content: stretch;
}
.first-look-item.warn { border-color: #fedf89; }
.first-look-item.bad { border-color: #fecdca; }
.first-look-item.info { border-color: #b2ccff; }
.first-look-item > i,
.first-look-item > svg {
  color: var(--amber);
}
.first-look-item.bad > i,
.first-look-item.bad > svg {
  color: var(--red);
}
.first-look-item.info > i,
.first-look-item.info > svg {
  color: var(--blue);
}
.first-look-item em {
  color: var(--blue);
  font-style: normal;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.home-exchange-list,
.home-risk-list,
.home-event-list,
.home-mini-position-list {
  display: grid;
  gap: 9px;
}
.home-exchange-row {
  display: grid;
  grid-template-columns: 38px minmax(120px, 1fr) minmax(82px, .38fr) minmax(82px, .38fr) minmax(56px, .25fr) 38px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
}
.home-exchange-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.home-exchange-main b,
.home-exchange-money b,
.home-mini-position b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-exchange-main span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-exchange-money {
  min-width: 0;
  display: grid;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}
.home-exchange-row > button {
  width: 38px;
  padding: 0;
}
.home-exchange-row > button span {
  display: none;
}
.home-risk-item,
.home-event-row {
  width: 100%;
  min-height: 46px;
  justify-content: stretch;
  text-align: left;
  background: #fff;
}
.home-risk-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}
.home-risk-item > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.home-risk-item b,
.home-event-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-event-row b small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  margin-top: 2px;
}
.home-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.home-details summary {
  min-height: 46px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.home-details summary::-webkit-details-marker {
  display: none;
}
.home-details[open] summary {
  border-bottom: 1px solid var(--line);
}
.home-details[open] summary svg {
  transform: rotate(180deg);
}
.home-mini-position-list {
  padding: 10px;
}
.home-mini-position {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(110px, .65fr) minmax(100px, .55fr) minmax(92px, .45fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-2);
}
.home-mini-position > div:not(.symbol) {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.home-event-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}
.ui-loading .decision-cell b,
.ui-loading .exchange-equity b,
.ui-loading .exchange-metrics b,
.ui-loading .command-pnl,
.ui-loading .command-kpi-grid b {
  color: transparent;
  border-radius: 4px;
  background: linear-gradient(90deg, #eef2f6 25%, #f8fafc 38%, #eef2f6 63%);
  background-size: 400% 100%;
  animation: skeleton 1.1s ease infinite;
}

@media (max-width: 760px) {
  .runtime-guide,
    .first-look-item {
      grid-template-columns: 28px minmax(0, 1fr);
    }
  .runtime-guide button,
    .first-look-item em {
      grid-column: 1 / -1;
      justify-self: stretch;
    }
  .command-center { padding: 14px; }
  .command-pnl { font-size: 36px; }
  .command-actions { display: grid; grid-template-columns: 1fr; }
  .home-exchange-row,
    .home-mini-position,
    .home-event-row {
      grid-template-columns: 1fr;
      align-items: stretch;
    }
  .home-exchange-row .exchange-logo { display: none; }
  .home-exchange-row button,
    .home-event-row button {
      width: 100%;
    }
}
