@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap");

:root {
  --brand: #f07a28;
  --bg0: #f5f7fb;
  --bg1: #e8eef8;
  --panel: #ffffff;
  --panel-border: rgba(27, 58, 107, 0.08);
  --text: #121826;
  --muted: #7a8499;
  --accent: #f07a28;
  --accent-dim: rgba(240, 122, 40, 0.14);
  --accent-soft: #fff1e6;
  --navy: #1b3a6b;
  --navy-soft: #e8eef8;
  --up: #16a34a;
  --up-soft: #e8f8ee;
  --down: #e5484d;
  --down-soft: #fdecec;
  --warn: #d97706;
  --radius: 16px;
  --tab-h: 62px;
  --page-x: 16px;
  --page-top: 10px;
  --card-gap: 10px;
  --card-pad-y: 14px;
  --card-pad-x: 16px;
  --list-row-y: 13px;
  --section-gap: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Android WebView 常拿不到 env(safe-area-*)，在原生注入前至少预留状态栏高度 */
  --status-pad: max(var(--safe-top), 28px);
  --font: "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow: 0 8px 28px rgba(27, 58, 107, 0.08);
  --shadow-sm: 0 2px 10px rgba(27, 58, 107, 0.06);
  --z-toast: 80;
  --z-modal: 90;
  --z-status: 50;
  --page-bg:
    radial-gradient(900px 420px at 8% -8%, rgba(27, 58, 107, 0.28), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(240, 122, 40, 0.18), transparent 50%),
    linear-gradient(180deg, #e8eef8 0%, var(--bg0) 42%, #f5f7fb 100%);
  --page-veil:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.55), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(27, 58, 107, 0.2), transparent 30%);
  --status-fill: linear-gradient(180deg, rgba(232, 238, 248, 0.95) 0%, rgba(232, 238, 248, 0.55) 70%, transparent 100%);
  --tab-bg: rgba(255, 255, 255, 0.94);
  --tab-border: rgba(27, 58, 107, 0.08);
  --skeleton-a: #e8eef8;
  --skeleton-b: #f5f7fb;
  --control-bg: #f3f6fb;
  --control-bg-strong: #ffffff;
  --segment-bg: #e8eef8;
  --chrome-bg: rgba(255, 255, 255, 0.72);
  --chrome-bg-strong: rgba(255, 255, 255, 0.92);
  --callout-info-bg: #fff1e6;
  --callout-info-fg: #5c3a1f;
  --callout-info-border: rgba(240, 122, 40, 0.22);
  --callout-warn-bg: #fff7e8;
  --callout-warn-fg: #9a6700;
  --callout-warn-border: rgba(217, 119, 6, 0.22);
  color-scheme: light;
}

html[data-theme="dark"] {
  --brand: #f07a28;
  --bg0: #0c1118;
  --bg1: #151c27;
  --panel: #161e2b;
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #e8eef5;
  --muted: #8b97a8;
  --accent: #f07a28;
  --accent-dim: rgba(240, 122, 40, 0.22);
  --accent-soft: rgba(240, 122, 40, 0.16);
  --navy: #d7e3f4;
  --navy-soft: rgba(215, 227, 244, 0.12);
  --up: #2ee6a6;
  --up-soft: rgba(46, 230, 166, 0.14);
  --down: #ff6b73;
  --down-soft: rgba(255, 107, 115, 0.14);
  --warn: #f0b429;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.28);
  --page-bg:
    radial-gradient(900px 420px at 8% -8%, rgba(240, 122, 40, 0.16), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(27, 58, 107, 0.45), transparent 50%),
    linear-gradient(180deg, #121820 0%, var(--bg0) 45%, #0a0e14 100%);
  --page-veil:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.05), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(240, 122, 40, 0.12), transparent 30%);
  --status-fill: linear-gradient(180deg, rgba(12, 17, 24, 0.92) 0%, rgba(12, 17, 24, 0.45) 70%, transparent 100%);
  --tab-bg: rgba(18, 24, 32, 0.94);
  --tab-border: rgba(255, 255, 255, 0.08);
  --skeleton-a: rgba(255, 255, 255, 0.06);
  --skeleton-b: rgba(255, 255, 255, 0.12);
  --control-bg: rgba(255, 255, 255, 0.06);
  --control-bg-strong: rgba(255, 255, 255, 0.1);
  --segment-bg: rgba(255, 255, 255, 0.06);
  --chrome-bg: rgba(22, 30, 43, 0.82);
  --chrome-bg-strong: rgba(22, 30, 43, 0.94);
  --callout-info-bg: rgba(240, 122, 40, 0.16);
  --callout-info-fg: #ffd7b0;
  --callout-info-border: rgba(240, 122, 40, 0.34);
  --callout-warn-bg: rgba(240, 180, 41, 0.14);
  --callout-warn-fg: #ffd666;
  --callout-warn-border: rgba(240, 180, 41, 0.32);
  color-scheme: dark;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  background: var(--page-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/*
 * Android WebView: 原生 <button> 边框可圆角，但背景填充常呈直角。
 * 统一去掉默认外观，并让背景按圆角裁剪。
 */
button,
.btn-primary,
.btn-ghost,
.btn-logout,
.icon-btn,
.qp-chip,
.qp-tab,
.chip,
.segment button,
.preset-row button,
.auth-lang-trigger,
.auth-lang-item,
.refresh-chip,
.ui-modal-btn,
.cal-nav {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  background-clip: padding-box;
}

button:not(.qp-tab):not(.tab),
.btn-primary,
.btn-ghost,
.btn-logout,
.icon-btn,
.qp-chip,
.chip,
.segment button,
.preset-row button,
.refresh-chip,
.ui-modal-btn,
.cal-nav {
  overflow: hidden;
}

html::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background: var(--page-veil);
  z-index: 0;
}

#app, .app-shell { position: relative; z-index: 1; }

#app {
  height: 100%;
  overflow: hidden;
}

.app-shell {
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1;
  padding: calc(var(--page-top) + var(--status-pad)) var(--page-x) calc(var(--tab-h) + 16px + var(--safe-bottom));
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  animation: page-enter 0.28s ease-out;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.app-content > .page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  /* 默认可滚动：旧版 Android WebView 不支持 :has()，不能依赖下面的增强规则 */
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/*
 * Flex 列 + 子项 overflow:hidden/auto 时，min-height:auto 会按 0 算，
 * 卡片会被压扁（欢迎条曾被压到 ~30px）。滚动由 .page 负责，子项不应被挤扁。
 */
.app-content > .page > *:not(.ptr-host):not(.grow) {
  flex-shrink: 0;
}

/* 有 RefreshableList 时由 .ptr-scroll 负责滚动（需较新的 Chromium） */
@supports selector(:has(*)) {
  .app-content > .page:has(.ptr-host) {
    overflow: hidden;
  }
}

.app-content.no-tabs {
  padding-bottom: calc(16px + var(--safe-bottom));
}

.status-bar-fill {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--status-pad);
  z-index: var(--z-status);
  pointer-events: none;
  background: var(--status-fill);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.page-header.centered-title {
  position: relative;
  justify-content: space-between;
}

.page-header.centered-title h1 {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.05rem;
  font-weight: 700;
  max-width: calc(100% - 96px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.header-spacer { width: 36px; }

.page-header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.brand-logo {
  display: block;
  object-fit: contain;
  border-radius: 16px;
  background: #000;
  margin: 0 auto 12px;
}

.brand-logo.sm { width: 28px; height: 28px; border-radius: 8px; margin: 0; }
.brand-logo.md { width: 48px; height: 48px; border-radius: 14px; }
.brand-logo.lg { width: 72px; height: 72px; border-radius: 18px; }
.brand-logo.hero { width: 96px; height: 96px; border-radius: 24px; margin-bottom: 16px; }

.brand-en {
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
}

.brand-sub {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

.back {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 12px;
  background: var(--chrome-bg);
  border: 1px solid var(--panel-border);
  line-height: 1;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: var(--card-pad-y) var(--card-pad-x);
  margin-bottom: var(--card-gap);
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
  text-transform: none;
}

.hero-pnl .pnl-value {
  font-family: var(--mono);
  font-size: 2.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 4px 0 14px;
  animation: pnl-enter 0.28s ease-out;
}

.pnl-value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.pnl-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  font-size: 0.8rem;
}

.pnl-row strong {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.95rem;
}

.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); font-size: 0.85rem; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: var(--tab-h);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--tab-bg);
  border-top: 1px solid var(--tab-border);
  max-width: 480px;
  margin: 0 auto;
  z-index: 20;
  backdrop-filter: blur(16px);
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -6px 24px rgba(27, 58, 107, 0.06);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #8a93a6;
  font-size: 0.72rem;
  gap: 2px;
  transition: color 0.2s ease;
  font-weight: 500;
}

.tab.active { color: var(--accent); font-weight: 700; }

.tab.active::after {
  content: none;
}

.tab-icon { font-size: 1.15rem; opacity: 0.95; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f28a3d 0%, #f07a28 55%, #e56a18 140%);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 13px 18px;
  font-weight: 700;
  font-family: var(--font);
  text-decoration: none;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(240, 122, 40, 0.28);
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
  overflow: hidden;
  background-clip: padding-box;
}

.btn-primary:active { transform: scale(0.985); filter: brightness(0.96); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary.small, .btn-ghost.small {
  width: auto;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-ghost {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(240, 122, 40, 0.18);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font);
  font-weight: 600;
  overflow: hidden;
  background-clip: padding-box;
}

.btn-logout {
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  border: 1px solid rgba(229, 72, 77, 0.28);
  border-radius: 14px;
  background: var(--down-soft);
  color: var(--down);
  font-size: 1rem;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.02em;
  overflow: hidden;
  background-clip: padding-box;
  cursor: pointer;
}

.btn-logout:active {
  transform: scale(0.985);
  filter: brightness(0.96);
}

html[data-theme="dark"] .btn-logout {
  border-color: rgba(255, 107, 115, 0.35);
  color: #ff8a90;
  background: rgba(255, 107, 115, 0.16);
}

.input, select.input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(27, 58, 107, 0.12);
  border-radius: 12px;
  padding: 12px;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--control-bg);
  color: var(--text);
}

.input:focus, select.input:focus {
  outline: 1px solid rgba(240, 122, 40, 0.45);
  border-color: rgba(240, 122, 40, 0.35);
}

/* Native <select> popup: force readable colors in dark theme (esp. Windows) */
select,
select.input {
  color-scheme: light;
}

html[data-theme="dark"] select,
html[data-theme="dark"] select.input {
  color-scheme: dark;
  background-color: var(--control-bg);
  color: var(--text);
  border-color: var(--panel-border);
}

html[data-theme="dark"] select option,
html[data-theme="dark"] select optgroup {
  background-color: #161e2b;
  color: #e8eef5;
}

.settings-lang-card > label {
  display: block;
  margin-bottom: 8px;
}

.settings-lang .auth-lang {
  width: 100%;
  z-index: 8;
}

.settings-lang .auth-lang-trigger {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  justify-content: flex-start;
  padding: 0 14px;
  box-sizing: border-box;
}

.settings-lang .auth-lang-menu {
  left: 0;
  right: 0;
  min-width: 100%;
  z-index: 9;
}

html[data-theme="dark"] .settings-lang .auth-lang-trigger {
  color: var(--text);
}

html[data-theme="dark"] .settings-lang .auth-lang-label {
  color: var(--text);
}

html[data-theme="dark"] .auth-lang-item {
  color: var(--text);
}

html[data-theme="dark"] .auth-lang-item:hover,
html[data-theme="dark"] .auth-lang-item:focus-visible {
  background: rgba(240, 122, 40, 0.16);
  color: var(--text);
}

.field { margin-bottom: 12px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.85rem; }

.segment {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: var(--section-gap);
  background: var(--segment-bg);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.segment button {
  border: none;
  background: transparent;
  padding: 10px 8px;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  overflow: hidden;
  background-clip: padding-box;
}

.segment button.on {
  background: var(--control-bg-strong);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  border-radius: 10px;
}

.segment-compact {
  padding: 3px;
  border-radius: 11px;
}

.segment-compact button {
  padding: 8px 6px;
  font-size: 0.8rem;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--list-row-y) 0;
  border-bottom: 1px solid rgba(27, 58, 107, 0.06);
  min-height: 52px;
  box-sizing: border-box;
}

.list-row:last-child { border-bottom: none; padding-bottom: 2px; }
.list-row:first-child { padding-top: 2px; }
.grow { flex: 1; min-width: 0; }

.rank {
  width: 32px;
  flex-shrink: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
}

.highlight {
  margin: 0 calc(-1 * var(--card-pad-x));
  padding-left: calc(var(--card-pad-x) - 3px);
  padding-right: var(--card-pad-x);
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-dim), transparent 70%);
  border-radius: 0;
}

.menu-list .menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(27, 58, 107, 0.06);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  transition: color 0.15s ease;
  min-height: 56px;
  box-sizing: border-box;
}

.menu-list .menu-item:first-child { padding-top: 2px; }
.menu-list .menu-item:last-child { border-bottom: none; padding-bottom: 2px; }

.menu-ico {
  width: 28px;
  text-align: center;
  opacity: 0.75;
  flex-shrink: 0;
}

.chev { color: #a8b0c0; font-size: 1.1rem; }

.link-pill {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.8rem;
  border: 1px solid rgba(240, 122, 40, 0.18);
  white-space: nowrap;
  font-weight: 600;
}

.auth-page {
  padding-top: 4px;
  padding-bottom: 28px;
  text-align: center;
  min-height: 0;
  position: relative;
  background:
    radial-gradient(ellipse 90% 55% at 12% -10%, rgba(27, 58, 107, 0.32), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(240, 122, 40, 0.22), transparent 50%),
    linear-gradient(180deg, #e8eef8 0%, var(--bg0) 48%, #f5f7fb 100%);
}

.auth-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
  margin: 0 0 8px;
  min-height: 44px;
}

.auth-lang {
  position: relative;
  z-index: 6;
  text-align: left;
}

.auth-lang-scrim {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: transparent;
}

.auth-lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px 0 16px;
  margin: 0;
  border: 1px solid rgba(27, 58, 107, 0.12);
  border-radius: 999px;
  background: var(--chrome-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  overflow: hidden;
  background-clip: padding-box;
  font-family: var(--font);
}

.auth-lang-trigger:active {
  transform: scale(0.97);
}

.auth-lang.is-open .auth-lang-trigger,
.auth-lang-trigger:hover {
  background: var(--control-bg-strong);
  border-color: rgba(240, 122, 40, 0.35);
}

.auth-lang-code {
  min-width: 1.4em;
  text-align: center;
  font-size: 0.92rem;
  color: var(--accent);
}

.auth-lang-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy);
}

.auth-lang-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(27, 58, 107, 0.45);
  margin-top: 1px;
  transition: transform 0.15s ease;
}

.auth-lang.is-open .auth-lang-caret {
  transform: rotate(180deg);
}

.auth-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 11.5rem;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(27, 58, 107, 0.08);
  box-shadow: 0 10px 28px rgba(27, 58, 107, 0.12);
  animation: authLangPop 0.16s ease-out both;
}

.auth-lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background-clip: padding-box;
  font-family: var(--font);
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.auth-lang-item:hover,
.auth-lang-item:focus-visible {
  background: rgba(240, 122, 40, 0.08);
  outline: none;
}

.auth-lang-item.on {
  background: rgba(27, 58, 107, 0.06);
  color: var(--navy);
  font-weight: 650;
}

.auth-lang-item-code {
  flex: 0 0 1.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-align: center;
}

.auth-lang-item-name {
  flex: 1;
  min-width: 0;
}

@keyframes authLangPop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

html[data-theme="dark"] .auth-lang-label {
  color: var(--text);
}

html[data-theme="dark"] .auth-lang-trigger {
  background: rgba(20, 28, 40, 0.88);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

html[data-theme="dark"] .auth-lang.is-open .auth-lang-trigger,
html[data-theme="dark"] .auth-lang-trigger:hover {
  background: rgba(20, 28, 40, 0.88);
  border-color: rgba(240, 122, 40, 0.4);
}

html[data-theme="dark"] .auth-lang-caret {
  border-top-color: rgba(255, 255, 255, 0.45);
}

html[data-theme="dark"] .auth-lang-menu {
  background: rgba(22, 30, 42, 0.96);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .auth-lang-item.on {
  background: rgba(240, 122, 40, 0.12);
  color: var(--text);
}

.phone-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.phone-dial {
  flex: 0 0 auto;
  width: 7.6rem;
  max-width: 42%;
  padding-left: 8px;
  padding-right: 4px;
  font-size: 0.82rem;
}

.phone-dial-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 7.8rem;
  max-width: 42%;
  z-index: 8;
}

.phone-dial-scrim {
  position: fixed;
  inset: 0;
  z-index: 7;
  background: transparent;
}

.phone-dial-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0 10px;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
}

.phone-dial-code {
  flex: 1;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 0.9rem;
}

.phone-dial-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid color-mix(in srgb, var(--muted) 80%, transparent);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.phone-dial-wrap.is-open .phone-dial-caret {
  transform: rotate(180deg);
}

.phone-flag-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.05rem;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 2px;
  background: color-mix(in srgb, var(--control-bg) 80%, var(--panel-border));
  box-shadow: inset 0 0 0 1px rgba(27, 58, 107, 0.08);
}

.phone-flag-img {
  width: 1.4rem;
  height: 1.05rem;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

.phone-dial-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 9;
  min-width: 12.5rem;
  max-height: min(52vh, 320px);
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(27, 58, 107, 0.08);
  box-shadow: 0 10px 28px rgba(27, 58, 107, 0.12);
  -webkit-overflow-scrolling: touch;
}

.phone-dial-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.phone-dial-item:hover,
.phone-dial-item:focus-visible {
  background: rgba(240, 122, 40, 0.08);
  outline: none;
}

.phone-dial-item.on {
  background: rgba(27, 58, 107, 0.06);
  font-weight: 650;
}

.phone-dial-item-code {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  min-width: 3.2rem;
}

.phone-dial-item-iso {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

html[data-theme="dark"] .phone-dial-menu {
  background: rgba(22, 30, 42, 0.98);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .phone-dial-item.on {
  background: rgba(240, 122, 40, 0.12);
}

html[data-theme="dark"] .phone-dial-item:hover,
html[data-theme="dark"] .phone-dial-item:focus-visible {
  background: rgba(240, 122, 40, 0.16);
}

.phone-national {
  flex: 1;
  min-width: 0;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.field-hint.warn {
  color: var(--down, #c0392b);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-hero {
  margin-bottom: 8px;
  animation: authRise 0.55s ease-out both;
}

.auth-page .brand {
  font-size: 2rem;
  color: var(--navy);
}

html[data-theme="dark"] .auth-page .brand {
  color: var(--text);
}

.auth-page .brand-en {
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 4px;
}

.auth-page .auth-segment {
  margin-top: 8px;
}

.auth-card {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 22px 20px;
  margin-top: 22px;
  box-shadow: var(--shadow);
  animation: authRise 0.6s 0.08s ease-out both;
}

.auth-card .field label {
  color: var(--navy);
  font-weight: 600;
  font-size: 0.86rem;
}

html[data-theme="dark"] .auth-card .field label {
  color: var(--text);
}

.auth-card .input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 122, 40, 0.18);
  outline: none;
}

.auth-page .btn-primary {
  width: 100%;
  margin-top: 8px;
  background: linear-gradient(135deg, #f07a28 0%, #ff8f3d 100%);
  border: none;
  box-shadow: 0 10px 24px rgba(240, 122, 40, 0.32);
  font-weight: 700;
}

.auth-page .btn-primary:active {
  transform: translateY(1px);
}

.auth-hint a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

/* —— Auth agreements —— */
.agree-list {
  text-align: left;
  margin: 14px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agree-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(27, 58, 107, 0.1);
  background: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .agree-item {
  background: rgba(20, 28, 42, 0.55);
  border-color: rgba(255, 255, 255, 0.08);
}

.agree-item.is-on {
  border-color: rgba(240, 122, 40, 0.35);
  background: rgba(240, 122, 40, 0.06);
}

.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  margin: 0;
}

.agree-check {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.agree-text {
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text);
  font-weight: 500;
}

.agree-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 6px 0 0 28px;
}

.agree-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

a.agree-link:hover,
button.agree-link:hover {
  text-decoration: underline;
}

.agree-bullets {
  margin: 8px 0 0 28px;
  padding-left: 16px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.agree-bullets li {
  margin-bottom: 4px;
}

.legal-page {
  padding-bottom: 32px;
  text-align: left;
}

.legal-toolbar {
  margin-bottom: 12px;
}

.legal-back {
  padding: 8px 12px;
}

.legal-card {
  text-align: left;
}

.legal-title {
  font-size: 1.25rem;
  margin: 0 0 8px;
  color: var(--text);
}

.legal-lead {
  margin: 0 0 14px;
  font-size: 0.9rem;
}

.legal-bullets {
  margin: 0 0 20px 0;
  padding-left: 18px;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.55;
}

.legal-bullets li {
  margin-bottom: 8px;
}

@keyframes authRise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.brand::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin: 10px auto 0;
  border-radius: 3px;
  background: var(--accent);
}

.auth-hint { margin-top: 16px; color: var(--muted); font-size: 0.8rem; }
.auth-sub { color: var(--muted); margin-top: 8px; }
.auth-sub-secondary { margin-top: 4px; font-size: 0.82rem; opacity: 0.9; }

.error {
  background: var(--down-soft);
  color: #b42318;
  border: 1px solid rgba(229, 72, 77, 0.2);
  padding: 10px 12px;
  border-radius: 12px;
  margin: 10px 0;
  font-size: 0.9rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
  font-weight: 600;
}

.cal-cell {
  background: #eef2f8;
  border: none;
  border-radius: 11px;
  padding: 7px 2px;
  text-align: center;
  font-size: 0.68rem;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  transition: transform 0.12s ease;
}

.cal-cell.empty { background: transparent; min-height: 0; padding: 0; }

.cal-cell.profit {
  background: var(--up-soft);
}

.cal-cell.loss {
  background: var(--down-soft);
}

.cal-cell.today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  box-shadow: 0 0 0 1px rgba(240, 122, 40, 0.12);
}

.cal-cell .cal-day {
  font-weight: 700;
  color: #5a6478;
}

.cal-cell.profit .cal-day,
.cal-cell.profit small { color: var(--up); }

.cal-cell.loss .cal-day,
.cal-cell.loss small { color: var(--down); }

.cal-cell small {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(27, 58, 107, 0.06);
  font-size: 0.92rem;
}

.kv strong {
  font-family: var(--mono);
  font-weight: 500;
  text-align: right;
}

.row-actions, .bot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.invite-code {
  font-family: var(--mono);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.poster-placeholder {
  margin-top: 12px;
  border: 1px dashed rgba(240, 122, 40, 0.28);
  border-radius: 10px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: var(--accent-dim);
}

.badge {
  display: inline-block;
  margin-left: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(240, 122, 40, 0.2);
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}

.poster-card {
  text-align: center;
  background:
    radial-gradient(600px 240px at 50% 0%, rgba(240, 122, 40, 0.14), transparent 60%),
    var(--panel);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--muted);
  vertical-align: middle;
}

.status-dot.running { background: var(--up); box-shadow: 0 0 8px rgba(46, 230, 166, 0.55); }
.status-dot.stopped { background: var(--muted); }
.status-dot.sellonly { background: #f0c14a; }
.status-dot.suspended { background: var(--down); }

.wallet-card .pnl-value { font-size: 1.9rem; }

.wallet-meta {
  display: flex;
  gap: 16px;
  margin: 4px 0 8px;
}

.invite-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent-soft);
  border: 1px solid rgba(240, 122, 40, 0.16);
  color: var(--text);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.invite-banner .muted { color: var(--muted); }
.invite-banner span { color: var(--accent); font-size: 1.2rem; }

.empty-cta { text-align: center; }
.empty-cta .btn-primary { margin-top: 10px; max-width: 220px; margin-left: auto; margin-right: auto; }

.secondary-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--panel-border); }
.tip { margin: 0 0 10px; }
.break-all { word-break: break-all; }

.preset-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.preset-row button {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--panel-border);
  background: var(--control-bg);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font);
  overflow: hidden;
  background-clip: padding-box;
  -webkit-tap-highlight-color: transparent;
}

.preset-row button.on {
  border-color: rgba(240, 122, 40, 0.45);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
  border-radius: 12px;
}

.principle p { line-height: 1.55; margin: 0; }

.poster-card {
  text-align: center;
  background:
    radial-gradient(600px 240px at 50% 0%, rgba(240, 122, 40, 0.14), transparent 60%),
    var(--panel);
}

.poster-card h2 {
  color: var(--text);
  text-transform: none;
  font-size: 1.35rem;
  margin: 12px 0 6px;
}

.auth-hint a {
  color: var(--accent);
  text-decoration: none;
}

.bot-card { cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.bot-card:active { border-color: rgba(240, 122, 40, 0.35); box-shadow: var(--shadow-sm); }

.tape-pnl {
  font-family: var(--mono);
  font-weight: 500;
  animation: pnl-pulse 0.2s ease;
}

#blazor-error-ui {
  background: #fff5f5;
  color: #b42318;
  border-top: 1px solid rgba(229, 72, 77, 0.25);
  padding: 12px 16px calc(12px + var(--safe-bottom));
  font-family: var(--font);
  z-index: 100;
}

#blazor-error-ui .reload { color: var(--accent); margin-left: 8px; }

/* —— Toast / Modal —— */
.ui-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-bottom) + 18px);
  transform: translateX(-50%);
  z-index: var(--z-toast);
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(27, 58, 107, 0.18);
  backdrop-filter: blur(12px);
  animation: toast-in 0.22s ease-out;
  cursor: pointer;
}

.ui-toast-info {
  background: var(--panel);
  border: 1px solid rgba(240, 122, 40, 0.2);
  color: var(--text);
}

.ui-toast-success {
  background: #ecfdf3;
  border: 1px solid rgba(22, 163, 74, 0.25);
  color: #067647;
}

.ui-toast-error {
  background: #fef3f2;
  border: 1px solid rgba(229, 72, 77, 0.25);
  color: #b42318;
}

.ui-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(28, 26, 42, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px calc(16px + var(--safe-bottom));
  animation: fade-in 0.18s ease-out;
}

.ui-modal {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px 20px 16px 16px;
  padding: 20px 18px 16px;
  box-shadow: 0 -8px 40px rgba(27, 58, 107, 0.18);
  animation: sheet-up 0.24s ease-out;
}

.ui-modal-title {
  font-size: 1.12rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.ui-modal-body {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.ui-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ui-modal-btn { width: 100%; }

.menu-list .menu-item::after {
  content: "›";
  color: var(--muted);
  font-size: 1.15rem;
  flex-shrink: 0;
}

.icon-menu .menu-item::after {
  content: none;
}

.icon-menu .menu-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  opacity: 1;
  flex-shrink: 0;
}

.icon-menu .menu-item .ico {
  color: #a8b0c0;
}

.icon-menu .menu-item .menu-ico .ico {
  color: var(--accent);
}

.page-header .back {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--chrome-bg);
  border: 1px solid var(--panel-border);
  margin-right: 4px;
}

.skeleton,
.skeleton-card .skeleton {
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--skeleton-a), var(--skeleton-b), var(--skeleton-a));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  margin: 8px 0;
}

.skeleton-card {
  background: var(--panel);
  border-color: var(--panel-border);
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheet-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pnl-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tab-indicator {
  from { transform: scaleX(0.4); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}

@keyframes pnl-pulse {
  0% { filter: brightness(1.35); }
  100% { filter: brightness(1); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-pnl .pnl-value,
  .tab.active::after,
  .tape-pnl,
  .app-content,
  .ui-toast,
  .ui-modal,
  .ui-modal-backdrop,
  .skeleton,
  .ptr-spinner {
    animation: none;
  }
}

/* —— Pull to refresh / infinite scroll —— */
.ptr-host {
  position: relative;
  margin: 0 calc(-1 * var(--page-x));
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ptr-scroll {
  --ptr-pull: 0px;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--page-x) 12px;
  transform: translateY(var(--ptr-pull));
  transition: transform 0.12s ease-out;
}

.ptr-host.ptr-refreshing .ptr-scroll,
.ptr-scroll.ptr-refreshing {
  transform: translateY(48px);
}

.ptr-indicator {
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  color: var(--muted);
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.15s ease;
}

.ptr-host:has(.ptr-scroll.ptr-pulling) .ptr-indicator,
.ptr-host.ptr-refreshing .ptr-indicator {
  opacity: 1;
}

.ptr-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(240, 122, 40, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ptr-spin 0.7s linear infinite;
}

.ptr-sentinel { height: 1px; }
.ptr-footer {
  text-align: center;
  padding: 12px 0 4px;
  font-size: 0.78rem;
  min-height: 28px;
}

@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}

/* —— List density —— */
.list-page .page-header,
.list-page .segment,
.list-page .qp-tabs,
.list-page .qp-toolbar,
.list-page .mine-hero {
  flex-shrink: 0;
}

.list-card {
  padding-top: 8px;
  padding-bottom: 8px;
  overflow: hidden;
}

.list-card > .section-head {
  padding: 4px 0 6px;
  margin-bottom: 2px;
}

.list-card > .section-head + .list-row {
  padding-top: 8px;
}

.list-feed {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

.list-feed > .card {
  margin-bottom: 0;
}

.bot-card {
  padding: 14px 16px;
}

.bot-card .bot-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(27, 58, 107, 0.06);
}

.leader-row .rank {
  text-align: center;
}

.leader-row.top-1 .rank,
.leader-row.top-2 .rank,
.leader-row.top-3 .rank {
  color: #b45309;
}

.kv:first-of-type { padding-top: 2px; }
.kv:last-child { border-bottom: none; padding-bottom: 2px; }

/* —— Home dashboard —— */
.home-page {
  padding-top: 0;
}

.home-stack > * {
  animation: home-rise 0.42s ease-out both;
}

.home-stack > *:nth-child(1) { animation-delay: 0ms; }
.home-stack > *:nth-child(2) { animation-delay: 40ms; }
.home-stack > *:nth-child(3) { animation-delay: 80ms; }
.home-stack > *:nth-child(4) { animation-delay: 120ms; }
.home-stack > *:nth-child(5) { animation-delay: 160ms; }
.home-stack > *:nth-child(6) { animation-delay: 200ms; }
.home-stack > *:nth-child(n+7) { animation-delay: 240ms; }

@keyframes home-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-stack > * {
    animation: none;
  }
}

.home-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.home-head-copy {
  min-width: 0;
}

.home-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.home-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-refresh {
  flex-shrink: 0;
  margin-top: 2px;
}

.home-refresh.is-loading .ico {
  animation: ptr-spin 0.75s linear infinite;
}

.home-balance {
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
  padding: 18px 16px 16px;
  flex-shrink: 0;
}

.home-balance-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, #f5a623 55%, rgba(240, 122, 40, 0.2) 100%);
}

.home-balance::after {
  content: "";
  position: absolute;
  top: -28px;
  right: -28px;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: var(--accent-dim);
  pointer-events: none;
}

.home-balance-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.home-balance-label {
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--muted);
}

.home-balance-unit {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
}

.home-balance-value {
  position: relative;
  z-index: 1;
  font-size: 2.85rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text);
}

.home-balance-value.up { color: var(--up); }
.home-balance-value.down { color: var(--down); }

.home-pnl-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.home-pnl-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--bg0);
  border: 1px solid var(--panel-border);
}

.home-pnl-chip-label {
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.25;
}

.home-pnl-chip-value {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.home-pnl-chip-value.up { color: var(--up); }
.home-pnl-chip-value.down { color: var(--down); }

.home-pnl-chip-sub {
  font-size: 0.72rem;
  font-weight: 700;
}

.home-pnl-chip-sub.up { color: var(--up); }
.home-pnl-chip-sub.down { color: var(--down); }

.home-pnl-chip.is-highlight {
  border-color: rgba(240, 122, 40, 0.35);
  background: var(--accent-soft);
}

.home-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.home-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 6px 11px;
  text-align: center;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.home-metric:active {
  transform: scale(0.985);
  border-color: rgba(240, 122, 40, 0.28);
}

.home-metric-ico {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-soft);
  color: var(--navy);
}

.home-metric-ico.running {
  background: var(--up-soft);
  color: var(--up);
}

.home-metric-ico.gift {
  background: var(--accent-soft);
  color: var(--accent);
}

.home-metric-label {
  font-size: 0.64rem;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.25;
}

.home-metric-value {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
  word-break: break-all;
}

.home-metric-value.up { color: var(--up); }
.home-metric-value.down { color: var(--down); }

.home-live {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 650;
}

.home-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--up);
  box-shadow: 0 0 0 3px var(--up-soft);
  animation: home-pulse 1.8s ease-in-out infinite;
}

@keyframes home-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.92); }
}

.home-live .ico-sm {
  color: var(--muted);
  opacity: 0.7;
  flex-shrink: 0;
}

.home-dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px 0;
  margin-bottom: 10px;
  overflow: hidden;
}

.home-dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 4px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  transition: background 0.15s ease;
}

.home-dock-item + .home-dock-item {
  border-left: 1px solid var(--panel-border);
}

.home-dock-item:active {
  background: var(--bg0);
}

.home-dock-ico {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-dock-ico.market {
  background: var(--navy-soft);
  color: var(--navy);
}

.home-dock-ico.quant {
  background: var(--up-soft);
  color: var(--up);
}

.home-dock-ico.invite {
  background: var(--accent-soft);
  color: var(--accent);
}

.home-dock-ico.create {
  background: linear-gradient(135deg, #f28a3d 0%, #f07a28 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(240, 122, 40, 0.28);
}

.home-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
}

.home-tip-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
}

.home-tip .ico-sm:last-child {
  color: var(--muted);
  opacity: 0.7;
  flex-shrink: 0;
}

.home-empty {
  text-align: center;
  margin-bottom: 10px;
}

.home-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  border-radius: 20px;
  background: var(--bg0);
  color: var(--accent);
}

.home-empty h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.home-empty .btn-primary,
.home-empty .btn-ghost {
  margin-top: 10px;
}

.home-section {
  margin-top: 14px;
}

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.home-section-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.home-section-meta {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg0);
  border: 1px solid var(--panel-border);
}

.home-calendar {
  padding-top: 12px;
}

.home-calendar-total {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.home-calendar-total.up { color: var(--up); }
.home-calendar-total.down { color: var(--down); }

.home-page .cal-weekdays {
  margin-bottom: 8px;
}

.home-page .cal-cell {
  min-height: 46px;
  border-radius: 10px;
}

.home-page .cal-cell.today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  box-shadow: inset 0 0 0 1px rgba(240, 122, 40, 0.12);
}

html[data-theme="dark"] .home-page .cal-cell {
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .home-page .cal-cell.profit {
  background: var(--up-soft);
}

html[data-theme="dark"] .home-page .cal-cell.loss {
  background: var(--down-soft);
}

html[data-theme="dark"] .home-page .cal-cell.flat {
  background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .home-page .cal-cell .cal-day {
  color: var(--muted);
}

.home-earnings {
  padding-top: 4px;
  padding-bottom: 4px;
}

.home-earnings-empty {
  margin: 10px 0;
  text-align: center;
  font-size: 0.88rem;
}

.home-earning-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(27, 58, 107, 0.06);
}

html[data-theme="dark"] .home-earning-row {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.home-earning-row:last-child {
  border-bottom: none;
  padding-bottom: 6px;
}

.home-earning-row:first-child {
  padding-top: 6px;
}

.home-earning-row:active {
  opacity: 0.82;
}

.home-earning-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--navy-soft);
  color: var(--navy);
}

.home-earning-pnl {
  font-weight: 700;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.84rem;
}

.home-earning-pnl.up {
  background: var(--up-soft);
  color: var(--up);
}

.home-earning-pnl.down {
  background: var(--down-soft);
  color: var(--down);
}

.home-earning-pnl.flat {
  background: var(--bg0);
  color: var(--text);
}

.home-earning-row .ico-sm {
  color: var(--muted);
  opacity: 0.65;
  flex-shrink: 0;
}

.calendar-card .cal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.calendar-card h2 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.cal-month-total {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cal-nav {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 10px;
  border: none;
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--muted);
  flex-shrink: 0;
  overflow: hidden;
  background-clip: padding-box;
  cursor: pointer;
  font-family: var(--font);
}

html[data-theme="dark"] .cal-nav {
  background: var(--control-bg);
}

.principle-body { line-height: 1.65; margin: 0; }

.notice-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.notice-hero h2 {
  margin: 0;
  font-size: 1.15rem;
}

.notice-hero-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 4px;
}

.notice-tips {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.65;
}

.notice-tips li + li {
  margin-top: 8px;
}

.status-dot.running { background: var(--up); box-shadow: 0 0 8px rgba(22, 163, 74, 0.35); }

/* —— Icon system —— */
.ico {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.ico-sm { width: 16px; height: 16px; }
.ico-md { width: 22px; height: 22px; }
.ico-lg { width: 40px; height: 40px; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  font-family: var(--font);
  overflow: hidden;
  background-clip: padding-box;
}

.icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.icon-btn.is-spinning {
  animation: icon-spin 0.85s linear infinite;
}

@keyframes icon-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .icon-btn.is-spinning {
    animation: none;
  }
}
.icon-btn:focus-visible,
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.tab:focus-visible,
.input:focus-visible,
select.input:focus-visible,
.segment button:focus-visible {
  outline: 2px solid rgba(240, 122, 40, 0.55);
  outline-offset: 2px;
}

.pct-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--up-soft);
  color: var(--up);
}

.pct-pill.down {
  background: var(--down-soft);
  color: var(--down);
}

.refresh-chip {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: var(--chrome-bg);
  color: var(--accent);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  overflow: hidden;
  background-clip: padding-box;
}

.refresh-chip:disabled { opacity: 0.5; }
.refresh-ico { font-size: 0.95rem; }

.tab-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.tab.active .tab-icon { opacity: 1; }

.tab.active::before {
  content: "";
  position: absolute;
  top: 6px;
  width: 18px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  animation: tab-indicator 0.2s ease-out;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.section-head h2 { margin: 0; }

.empty-inline {
  margin: 6px 0 2px;
  text-align: center;
  padding: 8px 0;
}

.text-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
}

.empty-visual {
  width: 64px;
  height: 64px;
  margin: 4px auto 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.cal-cell.flat {
  background: #eef2f8;
  color: var(--muted);
}

html[data-theme="dark"] .cal-cell.flat {
  background: rgba(255, 255, 255, 0.06);
}

.flat { color: var(--text); }

/* —— Mine —— */
.mine-hero {
  position: relative;
  margin: 4px 0 16px;
  padding: 20px 18px 18px;
  border-radius: 22px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(27, 58, 107, 0.96) 0%, rgba(27, 58, 107, 0.88) 42%, rgba(240, 122, 40, 0.92) 100%);
  box-shadow: 0 14px 32px rgba(27, 58, 107, 0.22);
  flex-shrink: 0;
  box-sizing: border-box;
}

.mine-hero-glow {
  position: absolute;
  inset: auto -20% -40% 30%;
  height: 140%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 62%);
  pointer-events: none;
}

.mine-hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.mine-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.mine-identity-text {
  min-width: 0;
}

.mine-avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.mine-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.mine-name {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.2;
}

.mine-tag {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.18);
}

.mine-hero-slogan {
  position: relative;
  z-index: 1;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.86);
}

.mine-hero-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn.mine-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  box-shadow: none;
}

.icon-btn.mine-action-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.22);
}

html[data-theme="dark"] .mine-hero {
  background:
    linear-gradient(145deg, #132033 0%, #1a2c45 48%, #8a4518 100%);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
}

.wallet-balance {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 6px 0 10px;
  color: var(--text);
}

.wallet-meta {
  display: flex;
  gap: 16px;
  margin: 0 0 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
}

.wallet-meta strong {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 600;
}

.wallet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 6px;
}

.wallet-actions .btn-primary,
.wallet-actions .btn-ghost {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  gap: 8px;
  box-sizing: border-box;
  white-space: nowrap;
}

.wallet-actions .btn-primary {
  box-shadow: 0 8px 18px rgba(240, 122, 40, 0.22);
}

.wallet-actions .btn-ghost {
  background: #f3f0fc;
  border: 1px solid rgba(240, 122, 40, 0.14);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* —— Quant —— */
.create-btn {
  gap: 4px;
}

.bot-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.bot-symbol {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.bot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #eef2f8;
  color: #5a6478;
}

.tag.status-running {
  background: var(--up-soft);
  color: var(--up);
}

.tag.status-sellonly {
  background: var(--callout-warn-bg);
  color: var(--callout-warn-fg);
}

.tag.status-suspended {
  background: var(--down-soft);
  color: var(--down);
}

.tag.status-stopped {
  background: var(--control-bg);
  color: var(--muted);
}

.bot-pnl {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.bot-meta {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.price-flash {
  animation: price-flash-pulse 0.9s ease;
}

@keyframes price-flash-pulse {
  0% { transform: scale(1); opacity: 1; }
  35% { transform: scale(1.06); opacity: 0.85; }
  100% { transform: scale(1); opacity: 1; }
}

.market-refresh-hint .mono {
  color: var(--text);
  font-weight: 600;
}

.danger-ghost {
  color: var(--down) !important;
  background: var(--down-soft) !important;
  border-color: rgba(229, 72, 77, 0.18) !important;
  border-radius: 12px;
}

/* Quant chrome: primary underline tabs + filter chips + icon shortcuts */
.qp-tabs {
  display: flex;
  gap: 0;
  margin: 0 0 12px;
  border-bottom: 1px solid rgba(27, 58, 107, 0.08);
  flex-shrink: 0;
}

.qp-tab {
  flex: 1;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 8px 4px 12px;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.qp-tab.on {
  color: var(--text);
}

.qp-tab.on::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: -1px;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}

.qp-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: #e8eef8;
  color: #5a6478;
}

.qp-tab.on .qp-count {
  background: var(--accent-soft);
  color: var(--accent);
}

.qp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.qp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.qp-chip {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid transparent;
  background: var(--control-bg);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
  background-clip: padding-box;
  -webkit-tap-highlight-color: transparent;
}

.qp-chip.on {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(240, 122, 40, 0.22);
  border-radius: 999px;
}

.qp-shortcuts {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.qp-shortcut {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.qp-shortcut:active,
.qp-shortcut:hover {
  background: #eef2f8;
  color: var(--accent);
}

.bot-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bot-title-row .tag {
  margin: 0;
}

.bot-sub {
  margin-top: 4px;
  font-size: 0.72rem;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
}

.bot-pnl-watching {
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0;
}

.buy-dist {
  margin-top: 0.55rem;
}

.buy-dist-inline {
  margin-top: 0.45rem;
  width: 100%;
  flex: 1 0 100%;
}

.buy-dist-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.28rem;
  font-size: 0.82rem;
}

.buy-dist-label {
  color: var(--muted);
}

.buy-dist-value {
  font-weight: 650;
  transition: color 0.25s ease, transform 0.25s ease;
}

.buy-dist.tighter .buy-dist-value,
.buy-dist.is-close .buy-dist-value {
  color: var(--up, #1f9d6a);
  animation: buy-dist-pop 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.buy-dist.wider .buy-dist-value {
  animation: buy-dist-soft 360ms ease;
}

.buy-dist-track {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--control-bg) 80%, var(--panel-border));
  overflow: hidden;
}

.buy-dist-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f07a28, #f5a35a);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.buy-dist-fill.close {
  background: linear-gradient(90deg, #1f9d6a, #3ecf8e);
  animation: buy-dist-pulse 1.6s ease-in-out infinite;
}

.buy-dist-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
}

@keyframes buy-dist-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

@keyframes buy-dist-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes buy-dist-soft {
  0% { opacity: 0.55; }
  100% { opacity: 1; }
}

.cr-chart-stage {
  position: relative;
}

.cr-chart-dist {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  min-width: 108px;
  max-width: 46%;
  padding: 8px 10px 9px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-sm, 0 4px 14px rgba(0, 0, 0, 0.08));
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.cr-chart-dist-label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.cr-chart-dist-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}

.cr-chart-dist.tighter .cr-chart-dist-value,
.cr-chart-dist.close .cr-chart-dist-value {
  color: var(--up, #1f9d6a);
  animation: buy-dist-pop 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cr-chart-dist.wider .cr-chart-dist-value {
  animation: buy-dist-soft 360ms ease;
}

.cr-chart-dist-track {
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--control-bg) 70%, var(--panel-border));
  overflow: hidden;
}

.cr-chart-dist-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f07a28, #f5a35a);
  transition: width 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cr-chart-dist.close .cr-chart-dist-fill {
  background: linear-gradient(90deg, #1f9d6a, #3ecf8e);
  animation: buy-dist-pulse 1.6s ease-in-out infinite;
}

.create-page-compact .create-preview {
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: var(--control-bg);
  border: 1px solid var(--panel-border);
  font-size: 0.86rem;
  line-height: 1.5;
  font-weight: 550;
}

.create-page-compact .create-symbols-line {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  font-weight: 450;
}

.create-page-compact .create-go {
  margin-top: 1rem;
  width: 100%;
}

.create-page-compact .create-more {
  margin-top: 1rem;
}

.create-page-compact .create-more > summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.bot-pool-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 28%, transparent);
  text-underline-offset: 2px;
  cursor: pointer;
}

.bot-pool-link:active {
  color: var(--accent);
}

.pool-synced {
  margin: 8px 0 0;
  font-size: 0.72rem;
  line-height: 1.3;
}

.create-page-compact .create-amount-chips .chip {
  min-width: 4.2rem;
  justify-content: center;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.create-page-compact .create-amount-chips .chip:active {
  transform: scale(0.96);
}

.bot-card {
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .buy-dist-fill,
  .buy-dist-fill.close,
  .buy-dist.tighter .buy-dist-value,
  .buy-dist.wider .buy-dist-value,
  .cr-chart-dist-fill,
  .cr-chart-dist.close .cr-chart-dist-fill,
  .cr-chart-dist.tighter .cr-chart-dist-value,
  .cr-chart-dist.wider .cr-chart-dist-value {
    transition: none;
    animation: none;
  }
}

.detail-watch-dist {
  font-size: 1.05em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.create-page .create-mode-tabs {
  margin-bottom: 10px;
}

.create-page .create-exec-toolbar {
  margin-bottom: 14px;
}

.create-page .qp-chip.on {
  box-shadow: 0 1px 0 rgba(240, 122, 40, 0.08);
}

/* —— Auth (extra) —— */
.btn-primary:disabled { box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .tab.active::before { animation: none; }
}

/* —— Round 2: create / detail / wallet —— */
.callout {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.5;
  font-weight: 550;
  color: var(--text);
  background: var(--control-bg);
  border: 1px solid var(--panel-border);
}

.callout.info {
  background: var(--callout-info-bg);
  color: var(--callout-info-fg);
  border: 1px solid var(--callout-info-border);
}

.callout.warn {
  background: var(--callout-warn-bg);
  color: var(--callout-warn-fg);
  border: 1px solid var(--callout-warn-border);
}

.callout .tag {
  margin-right: 0.35rem;
  vertical-align: middle;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin: 0.35rem 0;
}

.info-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.info-banner p { margin: 4px 0 0; }

.info-banner-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.deposit-page .deposit-lead {
  margin-bottom: 14px;
}

.deposit-block {
  margin-bottom: 16px;
}

.deposit-step-label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 2px 10px;
}

.deposit-step-label strong {
  display: block;
  font-size: 0.95rem;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.deposit-step-label .muted {
  margin: 2px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
}

.deposit-step-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, var(--navy) 0%, #2a4f8a 100%);
  box-shadow: 0 4px 12px rgba(27, 58, 107, 0.22);
}

.deposit-pay-card {
  margin-bottom: 10px;
  padding: 16px;
  animation: deposit-rise 0.45s ease both;
}

.deposit-pay-card.is-loading {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deposit-pay-secondary {
  opacity: 0.96;
}

.deposit-pay-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.deposit-pay-meta .muted {
  font-size: 0.8rem;
}

.deposit-pay-body {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 14px;
  align-items: start;
}

.deposit-qr-frame {
  width: 148px;
  height: 148px;
  border-radius: 14px;
  padding: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
  border: 1px solid var(--panel-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.deposit-qr-frame .deposit-qr {
  width: 132px;
  height: 132px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  display: block;
}

.deposit-pay-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deposit-pay-side .deposit-address {
  margin: 0;
  padding: 12px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--navy);
  background: var(--control-bg);
  border: 1px dashed rgba(27, 58, 107, 0.18);
  border-radius: 12px;
  text-align: left;
}

.deposit-copy {
  width: 100%;
}

.deposit-pay-side .field-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
}

.deposit-form {
  margin-bottom: 8px;
}

@keyframes deposit-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 420px) {
  .deposit-pay-body {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .deposit-pay-side {
    width: 100%;
  }

  .deposit-pay-side .deposit-address {
    text-align: left;
  }
}

html[data-theme="dark"] .deposit-step-num {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .deposit-qr-frame {
  background: linear-gradient(180deg, #1a2332 0%, #121924 100%);
}

html[data-theme="dark"] .deposit-pay-side .deposit-address {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--panel-border);
  background: var(--control-bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  background-clip: padding-box;
  -webkit-tap-highlight-color: transparent;
}

.chip.on {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(240, 122, 40, 0.28);
  border-radius: 999px;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.preset-row button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 64px;
  text-align: left;
}

.preset-row button strong {
  font-size: 0.85rem;
  color: inherit;
}

.preset-row button small {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.75;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}

.detail-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-symbol {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.detail-pnl {
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.82rem;
}

.order-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--panel-border);
}

.order-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.order-row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.cr-chart-wrap {
  margin: 10px 0 4px;
}

.cr-candle-chart {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel-bg, transparent);
}

.cr-chart-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.cr-chart-btn {
  font-size: 0.78rem !important;
  padding: 4px 10px !important;
  min-height: 0 !important;
}

.cr-chart-hint {
  font-size: 0.75rem;
}

.sticky-actions {
  position: sticky;
  bottom: calc(12px + var(--safe-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  background: var(--chrome-bg-strong);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  z-index: 15;
}

.detail-page.has-sticky-actions {
  padding-bottom: 8px;
}

/* —— Clean Room pool detail —— */
.pool-detail .pool-reveal {
  animation: pool-reveal-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--d, 0) * 55ms);
}

@media (prefers-reduced-motion: reduce) {
  .pool-detail .pool-reveal {
    animation: none;
  }
}

@keyframes pool-reveal-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pool-welcome-steps {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.88rem;
  line-height: 1.55;
}

.pool-welcome-steps li + li {
  margin-top: 0.35rem;
}

.pool-hero {
  position: relative;
  overflow: visible;
  padding: 18px 16px 16px;
  background:
    linear-gradient(145deg, rgba(27, 58, 107, 0.12), transparent 55%),
    linear-gradient(200deg, rgba(240, 122, 40, 0.1), transparent 45%),
    var(--panel);
}

.pool-hero-glow {
  position: absolute;
  inset: -40% -20% auto auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 122, 40, 0.28), transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.pool-hero-top {
  position: relative;
  z-index: 1;
}

.pool-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.pool-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
  color: var(--navy);
}

html[data-theme="dark"] .pool-name {
  color: var(--text);
}

.pool-tags {
  margin: 0;
  flex-wrap: wrap;
}

.tag.status-running {
  background: var(--up-soft);
  color: var(--up);
}

.tag.status-stopped {
  background: var(--control-bg);
  color: var(--muted);
}

.pool-hero-pnl,
.pool-hero-equity {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 14px;
  min-width: 0;
  width: 100%;
}

.pool-hero-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 2px;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.35;
}

.pool-equity-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.pool-equity-stats > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pool-equity-stats .muted {
  font-size: 0.72rem;
  line-height: 1.3;
}

.pool-equity-stats strong {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.buy-dist-compact .buy-dist-track {
  margin-top: 0.2rem;
}

.quant-hint {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.quant-hint .btn-ghost {
  flex-shrink: 0;
}

.pool-hero-pnl-label {
  display: block;
  width: 100%;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
  white-space: normal;
}

.pool-hero-pnl-value {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 1.55rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.35;
  padding: 2px 0;
  overflow: visible;
  word-break: normal;
  overflow-wrap: normal;
}

.pool-hero-pnl-unit {
  margin-left: 0.2rem;
  font-size: 0.72em;
  font-weight: 650;
  letter-spacing: 0;
  opacity: 0.72;
  vertical-align: baseline;
}

.pool-equity {
  position: relative;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-border);
}

.pool-equity-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.pool-equity-row strong {
  font-size: 1.05rem;
}

.pool-util {
  height: 8px;
  border-radius: 999px;
  background: var(--control-bg);
  overflow: hidden;
}

.pool-util-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--navy), var(--accent));
  transition: width 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] .pool-util-fill {
  background: linear-gradient(90deg, #6b8fc4, var(--accent));
}

.pool-util-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.78rem;
}

.pool-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 var(--section-gap);
}

.pool-metric {
  padding: 12px 10px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pool-metric span {
  font-size: 0.72rem;
  line-height: 1.3;
}

.pool-metric strong {
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.pool-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.pool-section-head h2 {
  margin: 0;
}

.pool-section-count {
  font-size: 0.8rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  color: var(--accent);
}

.pool-legs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pool-leg {
  position: relative;
  display: block;
  padding: 12px 28px 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: var(--control-bg);
  text-decoration: none;
  color: inherit;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.pool-leg.has-pos {
  background:
    linear-gradient(105deg, var(--accent-dim), transparent 42%),
    var(--panel);
  border-color: rgba(240, 122, 40, 0.22);
}

.pool-leg:active {
  transform: scale(0.985);
}

.pool-leg-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pool-leg-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.pool-leg-title strong {
  font-size: 0.98rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.pool-leg-title .mono {
  font-size: 0.72rem;
}

.pool-leg-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.pool-leg-metrics > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pool-leg-metrics .muted {
  font-size: 0.68rem;
}

.pool-leg-metrics strong {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pool-leg-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.35rem;
  color: var(--muted);
  line-height: 1;
}

.tag.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.pool-config .pool-save {
  margin-top: 14px;
  width: 100%;
}

.pool-sticky {
  grid-template-columns: 1fr;
}

.pool-sticky:has(> :nth-child(2)) {
  grid-template-columns: 1fr 1fr;
}

.referral-hero {
  text-align: center;
  padding-top: 20px;
  padding-bottom: 20px;
}

.referral-hero .pnl-value {
  margin: 8px 0;
  color: var(--text);
  font-size: 2rem;
}

.invite-url {
  margin: 8px 0 14px;
  font-size: 0.78rem;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1b3a6b, #f07a28);
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 8px 18px rgba(240, 122, 40, 0.28);
  flex-shrink: 0;
}

.avatar.sm {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 0.9rem;
  box-shadow: none;
}

.empty-visual.sm {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin-bottom: 8px;
}

.row-otp {
  display: flex;
  gap: 8px;
  align-items: center;
}

.row-otp .input { flex: 1; min-width: 0; }
.row-otp .btn-ghost { width: auto; white-space: nowrap; flex-shrink: 0; }

.mono-input {
  font-family: var(--mono);
  font-size: 0.85rem;
}

.gate-card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.form h2 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.card.form .btn-primary { margin-top: 4px; }

@media (max-width: 360px) {
  .field-grid { grid-template-columns: 1fr; }
  .preset-row { grid-template-columns: 1fr; }
}

/* —— Quant experience polish (beauty + motion) —— */
.quant-page .qp-tabs {
  padding: 2px;
  margin-bottom: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  border-bottom: 1px solid var(--panel-border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.quant-page .qp-tab {
  border-radius: 11px;
  padding: 10px 4px;
  transition: color 0.18s ease, background 0.18s ease;
}

.quant-page .qp-tab.on {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 88%, transparent);
}

.quant-page .qp-tab.on::after {
  display: none;
}

.quant-page .qp-tab.on .qp-count {
  background: var(--accent);
  color: #fff;
}

.quant-feed .bot-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 14px 14px 12px 16px;
  transition:
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.18s ease,
    box-shadow 0.18s ease;
  animation: quant-card-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(min(var(--i, 0), 10) * 42ms);
}

.quant-feed .bot-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 35%, transparent);
}

.quant-feed .bot-card--watching::before {
  background: linear-gradient(180deg, #f07a28, #f5a35a);
}

.quant-feed .bot-card--position::before {
  background: linear-gradient(180deg, #1f9d6a, #3ecf8e);
}

.quant-feed .bot-card--idle::before {
  background: color-mix(in srgb, var(--navy) 28%, transparent);
}

.quant-feed .bot-card:active {
  transform: scale(0.985);
}

.quant-feed .bot-symbol {
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.quant-feed .bot-pnl {
  font-size: 1.02rem;
  font-weight: 750;
}

.quant-empty {
  padding: 28px 18px 24px;
  border-radius: 20px;
  background:
    radial-gradient(420px 180px at 50% 0%, rgba(240, 122, 40, 0.12), transparent 70%),
    var(--panel);
}

.quant-empty .empty-visual {
  background: var(--accent-soft);
  color: var(--accent);
}

@keyframes quant-card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pool-hero {
  border-radius: 22px;
  padding: 18px 16px 16px;
  background:
    radial-gradient(520px 220px at 100% -10%, rgba(240, 122, 40, 0.22), transparent 58%),
    radial-gradient(420px 200px at -10% 0%, rgba(27, 58, 107, 0.16), transparent 55%),
    linear-gradient(165deg, color-mix(in srgb, var(--panel) 92%, #fff) 0%, var(--panel) 100%);
  box-shadow: var(--shadow);
}

.pool-hero-equity .pool-hero-pnl-value {
  font-size: clamp(1.55rem, 6vw, 1.9rem);
  letter-spacing: -0.04em;
}

.pool-hero-sub {
  opacity: 0.92;
}

.pool-equity-stats > div {
  padding: 8px 8px 7px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--control-bg) 88%, transparent);
}

.pool-leg {
  border-radius: 16px;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.pool-leg.has-pos {
  background:
    linear-gradient(90deg, rgba(31, 157, 106, 0.08), transparent 42%),
    var(--panel);
}

.pool-leg:active {
  transform: scale(0.99);
}

.detail-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 16px;
  background:
    radial-gradient(360px 160px at 100% 0%, rgba(240, 122, 40, 0.16), transparent 60%),
    var(--panel);
}

.detail-hero.has-pos {
  background:
    radial-gradient(360px 160px at 100% 0%, rgba(31, 157, 106, 0.14), transparent 60%),
    var(--panel);
}

.detail-hero-glow {
  position: absolute;
  right: -30px;
  top: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 122, 40, 0.22), transparent 68%);
  pointer-events: none;
}

.detail-hero.has-pos .detail-hero-glow {
  background: radial-gradient(circle, rgba(31, 157, 106, 0.2), transparent 68%);
}

.detail-hero-top,
.detail-meta {
  position: relative;
  z-index: 1;
}

.detail-pnl {
  font-size: clamp(1.25rem, 5vw, 1.55rem);
}

.create-page-compact .callout.info {
  border-radius: 16px;
}

.create-page-compact .create-preview {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 14px 14px 12px;
  background:
    radial-gradient(280px 120px at 100% 0%, rgba(240, 122, 40, 0.16), transparent 65%),
    linear-gradient(160deg, var(--accent-soft), var(--control-bg));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--panel-border));
  box-shadow: var(--shadow-sm);
}

.create-preview-kicker {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.create-page-compact .create-go {
  border-radius: 14px;
  min-height: 48px;
  font-weight: 750;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 24px rgba(240, 122, 40, 0.22);
}

.create-page-compact .create-go:active:not(:disabled) {
  transform: translateY(1px);
}

.pool-sticky,
.detail-page .sticky-actions {
  border-radius: 18px;
  background: color-mix(in srgb, var(--chrome-bg-strong) 92%, transparent);
  box-shadow: 0 12px 32px rgba(18, 24, 38, 0.12);
}

.cr-chart-stage {
  border-radius: 14px;
}

.cr-candle-chart {
  border-radius: 14px;
  border-color: color-mix(in srgb, var(--panel-border) 80%, transparent);
}

.cr-chart-dist {
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(18, 24, 38, 0.12);
}

html[data-theme="dark"] .quant-page .qp-tabs {
  background: color-mix(in srgb, var(--panel) 82%, transparent);
}

html[data-theme="dark"] .pool-hero,
html[data-theme="dark"] .detail-hero,
html[data-theme="dark"] .create-page-compact .create-preview {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.pool-welcome {
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--panel-border));
  background:
    radial-gradient(320px 140px at 0% 0%, rgba(240, 122, 40, 0.14), transparent 65%),
    var(--panel);
  min-height: min-content;
}

.pool-welcome .pool-section-head {
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.pool-welcome .pool-section-head h2 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.pool-welcome-steps {
  position: relative;
  z-index: 1;
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
}

.pool-welcome-steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

.create-paper-note {
  margin: 0 0 12px;
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 0.01em;
}

.detail-watch-dist {
  display: inline-block;
  font-size: clamp(1.2rem, 5vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.detail-hero.is-watching .detail-pnl.up .detail-watch-dist {
  color: var(--accent);
}

.quant-empty .btn-primary,
.quant-empty .btn-ghost {
  margin-top: 12px;
  min-width: 11rem;
}

.pool-sticky .btn-primary,
.pool-sticky .btn-ghost {
  min-height: 48px;
  border-radius: 14px;
  font-weight: 700;
}

.quant-hint {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-radius: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .quant-feed .bot-card {
    animation: none;
  }

  .quant-feed .bot-card:active,
  .pool-leg:active,
  .create-page-compact .create-go:active:not(:disabled) {
    transform: none;
  }
}

/* —— Quant beauty 3: surface, pulse, timeline —— */
.quant-page .page-header h1 {
  background: linear-gradient(120deg, var(--navy) 12%, var(--text) 48%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.04em;
}

html[data-theme="dark"] .quant-page .page-header h1 {
  background: linear-gradient(120deg, #f3f7ff 8%, #ffd2a8 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.quant-page .create-btn {
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(240, 122, 40, 0.24);
}

.quant-feed {
  gap: 11px;
}

.quant-feed .bot-card {
  border-color: color-mix(in srgb, var(--panel-border) 88%, transparent);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    var(--shadow-sm);
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 55%, transparent), transparent 42%),
    var(--panel);
}

html[data-theme="dark"] .quant-feed .bot-card {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    var(--shadow-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%),
    var(--panel);
}

.bot-card-sheen {
  position: absolute;
  inset: 0 auto auto 0;
  width: 46%;
  height: 100%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.18), transparent 70%);
  pointer-events: none;
  opacity: 0.55;
}

html[data-theme="dark"] .bot-card-sheen {
  opacity: 0.12;
}

.quant-feed .bot-card--watching {
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 45%, transparent), transparent 38%),
    linear-gradient(105deg, rgba(240, 122, 40, 0.09), transparent 48%),
    var(--panel);
  border-color: color-mix(in srgb, var(--accent) 18%, var(--panel-border));
}

.quant-feed .bot-card--position {
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 45%, transparent), transparent 38%),
    linear-gradient(105deg, rgba(31, 157, 106, 0.1), transparent 48%),
    var(--panel);
  border-color: color-mix(in srgb, var(--up) 16%, var(--panel-border));
}

.bot-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(240, 122, 40, 0.55);
  animation: bot-live-pulse 1.8s ease-out infinite;
  flex-shrink: 0;
}

.pool-leg.has-pos .bot-live-dot {
  display: none;
}

.pool-leg.is-watching .bot-live-dot {
  margin-left: 0;
}

@keyframes bot-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(240, 122, 40, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(240, 122, 40, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 122, 40, 0); }
}

.quant-feed .bot-pnl {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.quant-feed .bot-pnl-watching.up {
  color: var(--accent);
  font-weight: 750;
}

.tag.watching {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag.mode-live {
  background: color-mix(in srgb, var(--up) 16%, transparent);
  color: var(--up);
  font-weight: 700;
}

.tag.mode-paper {
  background: var(--control-bg);
  color: var(--muted);
  font-weight: 650;
}

.tag.mode-exchange {
  background: color-mix(in srgb, var(--navy-soft, #e8eef8) 88%, transparent);
  color: color-mix(in srgb, var(--navy, #1b3a6b) 72%, var(--muted));
  font-weight: 600;
}

html[data-theme="dark"] .tag.mode-exchange {
  background: color-mix(in srgb, var(--panel) 70%, #2a3548);
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
}

.quant-feed .bot-card--live {
  border-color: color-mix(in srgb, var(--up) 22%, var(--panel-border));
}

.quant-feed .bot-card--live::before {
  background: linear-gradient(180deg, var(--up), transparent);
  opacity: 0.85;
}

.quant-feed .bot-card--paper {
  border-color: color-mix(in srgb, var(--panel-border) 92%, transparent);
}

.bot-title-row .tag.mode-live,
.bot-title-row .tag.mode-paper,
.bot-title-row .tag.mode-exchange {
  font-size: 0.68rem;
  padding: 2px 7px;
  line-height: 1.25;
}

.pool-leg.is-watching {
  background:
    linear-gradient(105deg, rgba(240, 122, 40, 0.07), transparent 46%),
    var(--control-bg);
}

.pool-leg.has-pos {
  background:
    linear-gradient(105deg, rgba(31, 157, 106, 0.1), transparent 46%),
    var(--panel) !important;
  border-color: color-mix(in srgb, var(--up) 22%, var(--panel-border)) !important;
}

.pool-leg-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.pool-util {
  position: relative;
  height: 9px;
  background: color-mix(in srgb, var(--control-bg) 90%, var(--panel-border));
}

.pool-util-fill {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #1b3a6b 0%, #3d6aa8 42%, #f07a28 100%);
}

.pool-util-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-120%);
  animation: util-sheen 2.8s ease-in-out infinite;
}

@keyframes util-sheen {
  0%, 35% { transform: translateX(-120%); }
  65%, 100% { transform: translateX(120%); }
}

.pool-equity-stats > div {
  transition: transform 0.16s ease, background 0.16s ease;
}

.pool-hero-equity.up .pool-hero-sub {
  color: var(--up);
}

.pool-hero-equity.down .pool-hero-sub {
  color: var(--down);
}

.detail-page .card > h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.detail-chart-card {
  overflow: hidden;
  background:
    radial-gradient(420px 160px at 100% 0%, rgba(27, 58, 107, 0.1), transparent 60%),
    var(--panel);
}

.detail-hero {
  animation: pool-reveal-in 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.order-row {
  position: relative;
  padding: 12px 12px 12px 14px;
  margin: 0 0 8px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--control-bg) 72%, transparent);
  border-bottom: 1px solid var(--panel-border);
}

.order-row:last-child {
  margin-bottom: 0;
}

.order-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--muted);
}

.order-row.order-buy::before {
  background: linear-gradient(180deg, #1f9d6a, #3ecf8e);
}

.order-row.order-sell::before {
  background: linear-gradient(180deg, #e5484d, #ff8a8e);
}

.order-row .tag.up {
  background: var(--up-soft);
  color: var(--up);
}

.order-row .tag.down {
  background: var(--down-soft);
  color: var(--down);
}

.create-page-compact .create-amount-chips .chip {
  border-radius: 12px;
  min-height: 36px;
  padding: 0 14px;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.create-page-compact .create-amount-chips .chip.on {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(240, 122, 40, 0.28);
  transform: translateY(-1px);
}

.create-page-compact .card.form {
  border-radius: 20px;
  padding: 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    var(--shadow-sm);
}

.create-preview-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.create-preview-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 122, 40, 0.18);
}

.buy-dist-track {
  height: 7px;
  box-shadow: inset 0 1px 2px rgba(27, 58, 107, 0.06);
}

.buy-dist-fill {
  background: linear-gradient(90deg, #e56a18, #f5a35a 55%, #ffc58a);
}

.cr-chart-dist {
  backdrop-filter: blur(12px);
  border-radius: 14px;
}

.cr-chart-dist.close {
  border-color: color-mix(in srgb, var(--up) 35%, var(--panel-border));
  box-shadow: 0 8px 22px rgba(31, 157, 106, 0.16);
}

.quant-empty {
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.back:active {
  transform: scale(0.96);
}

.sticky-actions {
  border-radius: 18px !important;
}

@media (prefers-reduced-motion: reduce) {
  .bot-live-dot,
  .pool-util-fill::after,
  .detail-hero {
    animation: none;
  }

  .create-page-compact .create-amount-chips .chip.on {
    transform: none;
  }
}

/* —— Quant lively: bounce, float, pop —— */
.quant-lively {
  --spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --bounce: cubic-bezier(0.22, 1.6, 0.36, 1);
  position: relative;
}

.quant-lively.quant-page::before,
.quant-lively.create-page::before,
.quant-lively.pool-detail::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 220px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120px 80px at 12% 30%, rgba(240, 122, 40, 0.22), transparent 70%),
    radial-gradient(90px 70px at 88% 18%, rgba(62, 207, 142, 0.16), transparent 70%),
    radial-gradient(70px 60px at 62% 8%, rgba(27, 58, 107, 0.12), transparent 70%);
  animation: lively-orbs 7s ease-in-out infinite alternate;
}

.quant-lively > * {
  position: relative;
  z-index: 1;
}

@keyframes lively-orbs {
  from { transform: translateY(0) scale(1); opacity: 0.85; }
  to { transform: translateY(10px) scale(1.06); opacity: 1; }
}

.quant-lively .qp-tabs {
  animation: lively-pop-in 480ms var(--bounce) both;
}

.quant-lively .qp-tab {
  transition: transform 0.18s var(--spring), color 0.18s ease, background 0.18s ease;
}

.quant-lively .qp-tab:active {
  transform: scale(0.96);
}

.quant-lively .qp-tab.on {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(240, 122, 40, 0.16);
}

.quant-lively .qp-tab.on .qp-count {
  animation: lively-badge-pop 420ms var(--bounce) both;
}

@keyframes lively-badge-pop {
  0% { transform: scale(0.6); }
  70% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.quant-lively .quant-feed .bot-card {
  animation-name: lively-card-in;
  animation-duration: 520ms;
  animation-timing-function: var(--bounce);
  animation-delay: calc(min(var(--i, 0), 10) * 55ms);
}

@keyframes lively-card-in {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.94) rotate(-0.6deg);
  }
  70% {
    opacity: 1;
    transform: translateY(-3px) scale(1.015) rotate(0.2deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

.quant-lively .quant-feed .bot-card--watching {
  animation:
    lively-card-in 520ms var(--bounce) both,
    lively-watch-float 3.2s ease-in-out infinite;
  animation-delay:
    calc(min(var(--i, 0), 10) * 55ms),
    calc(680ms + min(var(--i, 0), 10) * 55ms);
}

@keyframes lively-watch-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.quant-lively .quant-feed .bot-card:active {
  transform: scale(0.97) rotate(-0.4deg);
}

.quant-lively .bot-live-dot {
  width: 8px;
  height: 8px;
  animation: lively-dot 1.25s ease-out infinite;
}

@keyframes lively-dot {
  0% {
    transform: scale(0.85);
    box-shadow: 0 0 0 0 rgba(240, 122, 40, 0.55);
  }
  55% {
    transform: scale(1.2);
    box-shadow: 0 0 0 9px rgba(240, 122, 40, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(240, 122, 40, 0);
  }
}

.quant-lively .bot-pnl.up,
.quant-lively .detail-pnl.up {
  text-shadow: 0 0 18px rgba(31, 157, 106, 0.22);
}

.quant-lively .bot-pnl-watching.up {
  animation: lively-wiggle 2.4s ease-in-out infinite;
}

@keyframes lively-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-2.5deg); }
  75% { transform: rotate(2.5deg); }
}

.quant-lively .buy-dist-fill {
  background: linear-gradient(90deg, #ff7a1a, #ffb347 45%, #ffe08a);
}

.quant-lively .buy-dist-fill.close {
  background: linear-gradient(90deg, #12b76a, #32d583 40%, #6ee7b7);
  animation: buy-dist-pulse 1.1s ease-in-out infinite;
}

.quant-lively .quant-hint {
  animation: lively-pop-in 460ms var(--bounce) both;
  border-radius: 16px;
  background:
    radial-gradient(180px 80px at 0% 0%, rgba(255, 196, 120, 0.35), transparent 70%),
    var(--callout-info-bg);
}

@keyframes lively-pop-in {
  0% { opacity: 0; transform: translateY(12px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.quant-lively .quant-empty {
  background:
    radial-gradient(280px 140px at 50% 0%, rgba(255, 170, 80, 0.28), transparent 68%),
    radial-gradient(180px 100px at 15% 90%, rgba(62, 207, 142, 0.12), transparent 70%),
    var(--panel);
  animation: lively-pop-in 500ms var(--bounce) both;
}

.quant-empty-bounce {
  animation: lively-empty-bob 2.2s ease-in-out infinite;
  box-shadow: 0 10px 22px rgba(240, 122, 40, 0.18);
}

@keyframes lively-empty-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  40% { transform: translateY(-8px) rotate(-4deg); }
  70% { transform: translateY(-2px) rotate(3deg); }
}

.quant-lively .create-btn {
  animation: lively-cta-glow 2.6s ease-in-out infinite;
}

@keyframes lively-cta-glow {
  0%, 100% { box-shadow: 0 8px 20px rgba(240, 122, 40, 0.22); }
  50% { box-shadow: 0 10px 28px rgba(240, 122, 40, 0.42); }
}

.quant-lively.create-page-compact .create-go {
  animation: lively-cta-glow 2.4s ease-in-out infinite;
  transition: transform 0.18s var(--spring), box-shadow 0.18s ease;
}

.quant-lively.create-page-compact .create-go:active:not(:disabled) {
  transform: scale(0.97) translateY(1px);
}

.quant-lively.create-page-compact .create-preview {
  animation: lively-pop-in 520ms var(--bounce) both;
}

.quant-lively.create-page-compact .create-amount-chips .chip:active {
  transform: scale(0.94);
}

.quant-lively.create-page-compact .create-amount-chips .chip.on {
  animation: lively-badge-pop 360ms var(--bounce) both;
}

.pool-welcome-lively {
  position: relative;
  overflow: hidden; /* 裁切角标彩点，勿让 flex 压扁：靠上方 flex-shrink:0 */
  animation: lively-pop-in 560ms var(--bounce) both;
}

.pool-welcome-burst {
  position: absolute;
  inset: -24% auto auto -6%;
  width: 120px;
  height: 120px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 30% 40%, #ffb347 0 3px, transparent 4px),
    radial-gradient(circle at 70% 25%, #3ecf8e 0 2px, transparent 3px),
    radial-gradient(circle at 55% 70%, #f07a28 0 4px, transparent 5px),
    radial-gradient(circle at 20% 75%, #6b8fc4 0 2px, transparent 3px),
    radial-gradient(circle at 80% 60%, #ffd27a 0 3px, transparent 4px);
  animation: lively-burst 2.8s ease-in-out infinite;
  opacity: 0.5;
}

@keyframes lively-burst {
  0%, 100% { transform: rotate(0deg) scale(1); opacity: 0.75; }
  50% { transform: rotate(12deg) scale(1.12); opacity: 1; }
}

.quant-lively .pool-leg {
  transition: transform 0.18s var(--spring), border-color 0.18s ease, background 0.18s ease;
}

.quant-lively .pool-leg:active {
  transform: scale(0.98) rotate(-0.3deg);
}

.quant-lively .pool-leg.is-watching {
  animation: lively-watch-float 3.6s ease-in-out infinite;
}

.quant-lively .detail-hero {
  animation: lively-pop-in 480ms var(--bounce) both;
}

.quant-lively .detail-hero.is-watching .detail-hero-glow {
  animation: lively-glow-breathe 2.4s ease-in-out infinite;
}

@keyframes lively-glow-breathe {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.18); opacity: 1; }
}

.quant-lively .detail-watch-dist {
  animation: lively-wiggle 2.8s ease-in-out infinite;
  transform-origin: right center;
}

.quant-lively .order-row {
  transition: transform 0.16s var(--spring), background 0.16s ease;
  animation: lively-pop-in 420ms var(--bounce) both;
}

.quant-lively .order-row:nth-child(2) { animation-delay: 40ms; }
.quant-lively .order-row:nth-child(3) { animation-delay: 80ms; }
.quant-lively .order-row:nth-child(4) { animation-delay: 120ms; }
.quant-lively .order-row:nth-child(5) { animation-delay: 160ms; }

.quant-lively .cr-chart-dist.close .cr-chart-dist-value {
  animation: lively-badge-pop 500ms var(--bounce) infinite alternate;
}

.quant-lively .pool-sticky .btn-primary {
  animation: lively-cta-glow 2.5s ease-in-out infinite;
}

.quant-lively .pool-util-fill::after {
  animation: util-sheen 1.8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .quant-lively.quant-page::before,
  .quant-lively.create-page::before,
  .quant-lively.pool-detail::before,
  .quant-lively .qp-tabs,
  .quant-lively .qp-tab.on .qp-count,
  .quant-lively .quant-feed .bot-card,
  .quant-lively .quant-feed .bot-card--watching,
  .quant-lively .bot-live-dot,
  .quant-lively .bot-pnl-watching.up,
  .quant-lively .quant-hint,
  .quant-lively .quant-empty,
  .quant-empty-bounce,
  .quant-lively .create-btn,
  .quant-lively.create-page-compact .create-go,
  .quant-lively.create-page-compact .create-preview,
  .quant-lively.create-page-compact .create-amount-chips .chip.on,
  .pool-welcome-lively,
  .pool-welcome-burst,
  .quant-lively .pool-leg.is-watching,
  .quant-lively .detail-hero,
  .quant-lively .detail-hero.is-watching .detail-hero-glow,
  .quant-lively .detail-watch-dist,
  .quant-lively .order-row,
  .quant-lively .cr-chart-dist.close .cr-chart-dist-value,
  .quant-lively .pool-sticky .btn-primary {
    animation: none !important;
  }

  .quant-lively .qp-tab.on,
  .quant-lively .quant-feed .bot-card:active,
  .quant-lively .pool-leg:active {
    transform: none;
  }
}
