@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap");

:root,
[data-theme="light"] {
  /* PocketFlow admin light theme */
  /* Shared motion tokens: one easing curve and three durations for UI transitions. */
  --ease-smooth: cubic-bezier(.2, .8, .2, 1);
  --dur-fast: 0.15s;
  --dur-base: 0.2s;
  --dur-slow: 0.28s;
  --bg: #fafafb;
  --bg-2: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-hover: #f8fafc;
  --text: #0f172a;
  --text-muted: #6b7280;
  --gold: #b7791f;
  --gold-dim: #8a5a12;
  --gold-glow: rgba(183, 121, 31, 0.12);
  --primary: #b7791f;
  --primary-dark: #8a5a12;
  --ok: #22c55e;
  --ok-bg: rgba(34, 197, 94, 0.1);
  --err: #ef4444;
  --err-bg: rgba(239, 68, 68, 0.1);
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(183, 121, 31, 0.04);
  --chart-grid: rgba(183, 121, 31, 0.08);
  --input-bg: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.94);
  --hero-grad: linear-gradient(135deg, rgba(183, 121, 31, 0.06), rgba(245, 184, 46, 0.04));
  --mesh-1: transparent;
  --mesh-2: transparent;
  --mesh-3: transparent;
  --glow: #ffe9a8;
  --topbar-height: 57px;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 74px;
  --sidebar-current-width: var(--sidebar-width);
}

[data-theme="dark"] {
  /* PocketFlow admin dark (zinc) theme */
  --bg: #09090b;
  --bg-2: #18181b;
  --surface: #27272a;
  --surface-2: rgba(39, 39, 42, 0.72);
  --surface-hover: #2f2f33;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  /* Lighter blues for readable text/links on dark surfaces */
  --gold: #f5b82e;
  --gold-dim: #d99a12;
  --gold-glow: rgba(245, 184, 46, 0.16);
  --primary: #f5b82e;
  --primary-dark: #d99a12;
  --ok: #22c55e;
  --ok-bg: rgba(34, 197, 94, 0.14);
  --err: #ef4444;
  --err-bg: rgba(239, 68, 68, 0.14);
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(245, 214, 140, 0.14);
  --shadow: 0 18px 50px rgba(7, 8, 15, 0.55), 0 6px 30px rgba(245, 214, 140, 0.04);
  --chart-grid: rgba(255, 255, 255, 0.06);
  --input-bg: rgba(24, 24, 27, 0.92);
  --nav-bg: rgba(24, 24, 27, 0.92);
  --hero-grad: linear-gradient(135deg, rgba(183, 121, 31, 0.18), rgba(245, 184, 46, 0.08));
  --mesh-1: rgba(183, 121, 31, 0.16);
  --mesh-2: rgba(245, 184, 46, 0.08);
  --mesh-3: rgba(245, 214, 140, 0.04);
  --glow: #ffe9a8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  transition: background 0.4s var(--ease-smooth), color var(--dur-slow) var(--ease-smooth);
}

h1, h2, h3, h4, h5, h6 {
  font-family: Poppins, Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
}

[data-theme="light"] .bg-mesh,
[data-theme="light"] .bg-orb {
  display: none !important;
}

.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-mesh::before,
.bg-mesh::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: meshFloat 18s ease-in-out infinite alternate;
}

.bg-mesh::before {
  width: 55vw;
  height: 55vw;
  top: -15%;
  right: -10%;
  background: var(--mesh-1);
}

.bg-mesh::after {
  width: 45vw;
  height: 45vw;
  bottom: -10%;
  left: -8%;
  background: var(--mesh-2);
  animation-delay: -6s;
}

.bg-orb {
  position: absolute;
  width: 30vw;
  height: 30vw;
  top: 40%;
  left: 35%;
  border-radius: 50%;
  background: var(--mesh-3);
  filter: blur(90px);
  animation: meshFloat 22s ease-in-out infinite alternate-reverse;
}

@keyframes meshFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(3%, 5%) scale(1.08); }
}

.container {
  width: min(1180px, 94%);
  margin: 0 auto;
}

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background var(--dur-slow) var(--ease-smooth);
}

.topbar .container,
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #0c0b09;
  box-shadow: 0 4px 16px var(--gold-glow);
}

.brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand small {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

nav {
  display: flex;
  gap: 0.25rem;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  position: relative;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: color var(--dur-base), background var(--dur-base), transform var(--dur-fast);
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.nav-link.active {
  color: var(--gold);
  background: var(--gold-glow);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

/* ── App shell & sidebar (admin panel) ── */
body.has-sidebar {
  --sidebar-current-width: var(--sidebar-width);
}

body.has-sidebar.sidebar-collapsed {
  --sidebar-current-width: var(--sidebar-collapsed-width);
}

body.admin-layout {
  --topbar-height: 56px;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--dur-slow) var(--ease-smooth);
}

body.has-sidebar .app-shell {
  margin-left: var(--sidebar-current-width);
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-current-width);
  z-index: 120;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: 0 0 18px rgba(112, 126, 174, 0.06);
  display: flex;
  flex-direction: column;
  transition: width var(--dur-slow) var(--ease-smooth), transform var(--dur-slow) var(--ease-smooth);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0.95rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  min-height: calc(var(--topbar-height) + 8px);
}

.sidebar-logo,
.brand-logo,
.login-logo,
.topbar-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(183, 121, 31, 0.22);
  object-fit: cover;
  background: #fff;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
  overflow: hidden;
  transition: opacity var(--dur-base) var(--ease-smooth);
}

.sidebar-brand-text strong {
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--text);
}

.sidebar-brand-text span {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-transform: none;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.7rem 0.85rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar-group-label {
  margin: 0.7rem 0.55rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa6c5;
}

.sidebar-group-label:first-child {
  margin-top: 0.2rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.68rem 0.8rem;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color var(--dur-base), background var(--dur-base), border-color var(--dur-base), box-shadow var(--dur-base);
}

.sidebar-link:hover {
  color: var(--primary);
  background: rgba(183, 121, 31, 0.08);
  transform: none;
}

.sidebar-link.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(183, 121, 31, 0.22);
}

.sidebar-icon {
  width: 1.2rem;
  height: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.sidebar-icon svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}

.sidebar-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--dur-base) var(--ease-smooth);
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.55rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--dur-base), color var(--dur-base), background var(--dur-base);
}

.sidebar-collapse-btn:hover {
  color: var(--gold);
  border-color: var(--border-strong);
  background: var(--gold-glow);
  transform: none;
  filter: none;
  box-shadow: none;
}

.sidebar-collapse-icon {
  display: inline-block;
  transition: transform var(--dur-slow) var(--ease-smooth);
  flex-shrink: 0;
}

body.sidebar-collapsed .sidebar-collapse-icon {
  transform: rotate(180deg);
}

body.sidebar-collapsed .sidebar-label,
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-collapse-label,
body.sidebar-collapsed .sidebar-group-label {
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

body.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

body.sidebar-collapsed .sidebar-collapse-btn {
  justify-content: center;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: var(--topbar-height);
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  color: var(--text);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(183, 121, 31, 0.03);
}

.admin-topbar-left,
.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.topbar-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.admin-topbar-title {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.admin-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--primary);
}

.admin-topbar-title strong {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip,
.logout-btn,
.theme-toggle-btn,
#themeToggle {
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

.logout-btn,
.theme-toggle-btn,
#themeToggle {
  min-height: 2.2rem;
  padding: 0.35rem 0.75rem;
  font-weight: 650;
}

.logout-btn:hover,
.theme-toggle-btn:hover,
#themeToggle:hover {
  transform: none;
  border-color: var(--primary);
  color: var(--primary);
  background: var(--gold-glow);
  box-shadow: none;
  filter: none;
}

.admin-content {
  flex: 1;
  padding: 1.25rem 0 2.5rem;
  overflow-x: clip;
  max-width: 100%;
}

.admin-content.container {
  width: min(1180px, calc(100% - 1.5rem));
}

.admin-footer {
  margin-top: auto;
}

.admin-footer .site-footer-inner {
  justify-content: center;
  text-align: center;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

body.sidebar-mobile-open .sidebar-backdrop {
  display: block;
}

.sidebar-mobile-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.sidebar-mobile-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform var(--dur-slow), opacity var(--dur-slow);
}

.sidebar-mobile-toggle.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.sidebar-mobile-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.sidebar-mobile-toggle.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ── Public home (separate from admin) ── */
body.public-home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.public-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
}

.public-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 0;
  gap: 1rem;
}

.public-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.public-main {
  flex: 1;
  padding: 1.5rem 0 2.5rem;
}

.public-hero {
  padding: 2.5rem 0 1.5rem;
}

.public-footer .site-footer-inner {
  justify-content: center;
  text-align: center;
}

.login-footer {
  position: fixed;
  bottom: 1rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-muted);
  pointer-events: none;
}

#themeToggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 1rem;
  display: grid;
  place-items: center;
  transition: transform var(--dur-base), border-color var(--dur-base), box-shadow var(--dur-base);
}

#themeToggle:hover {
  transform: scale(1.08) rotate(8deg);
  border-color: var(--border-strong);
  box-shadow: 0 0 20px var(--gold-glow);
}

main {
  padding: 1.5rem 0 3rem;
}

/* ── Hero ── */
.hero {
  position: relative;
  padding: 1.35rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.hero h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0;
  color: var(--text-muted);
  max-width: 52ch;
  line-height: 1.55;
}

/* ── Action cards ── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--dur-base), box-shadow var(--dur-base);
  cursor: pointer;
}

.action-card:hover {
  transform: none;
  border-color: var(--border-strong);
  box-shadow: 0 8px 20px rgba(183, 121, 31, 0.08);
}

.action-card .icon {
  font-size: 1.35rem;
  line-height: 1;
}

.action-card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.action-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.action-card .arrow {
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 700;
}

.action-card:hover .arrow {
  transform: none;
}

/* ── Dashboard (clean Algorooms-style) ── */
.dash-page {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.dash-card {
  margin-bottom: 0;
  box-shadow: 0 2px 10px rgba(112, 126, 174, 0.05);
}

.dash-card:hover {
  transform: none;
}

.dash-compare-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.dash-compare-custom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

.dash-compare-custom label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dash-compare-custom input {
  min-height: 36px;
}

.dash-compare-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.dash-compare-totals > div {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border, rgba(112, 126, 174, 0.18));
  border-radius: 12px;
}

.dash-compare-totals span {
  display: block;
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}

.dash-compare-totals strong {
  font-size: 1.15rem;
}

.dash-compare-note {
  margin: 0 0 0.85rem;
}

.dash-compare-days {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dash-compare-day-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  align-items: baseline;
  margin-bottom: 0.45rem;
}

.dash-compare-day-head span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.dash-compare-table-wrap {
  overflow-x: auto;
}

.dash-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.dash-compare-table th,
.dash-compare-table td {
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border, rgba(112, 126, 174, 0.16));
  white-space: nowrap;
}

.dash-compare-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  font-weight: 700;
}

@media (max-width: 720px) {
  .dash-compare-totals {
    grid-template-columns: 1fr 1fr;
  }
}

.dash-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dash-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}

.dash-welcome h2 {
  margin: 0 0 0.3rem;
  font-size: 1.45rem;
}

.dash-sub,
.dash-section-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.dash-primary-btn {
  white-space: nowrap;
}

.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.dash-kpi {
  padding: 1rem 1.1rem;
}

.dash-kpi-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.dash-kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.dash-kpi-text {
  font-size: 1.05rem;
}

.dash-section-head {
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.dash-section-head h3 {
  margin: 0;
}

.dash-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.dash-action {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-hover);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--dur-base), background var(--dur-base), box-shadow var(--dur-base);
}

.dash-action:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dash-action-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-glow);
  color: var(--primary);
  flex-shrink: 0;
}

.dash-action-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.dash-action-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.dash-action-copy strong {
  font-size: 0.92rem;
}

.dash-action-copy em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dash-strategy-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dash-strategy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-hover);
}

.dash-strategy-main {
  min-width: 0;
  flex: 1;
}

.dash-strategy-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.dash-strategy-title h4 {
  margin: 0;
  font-size: 0.95rem;
}

.dash-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--gold-glow);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
}

.dash-strategy-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.dash-flag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-2);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}

.dash-flag.is-on {
  color: var(--ok);
  background: var(--ok-bg);
}

.dash-strategy-meta {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-strategy-actions {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}

.dash-row-btn {
  min-height: 2.15rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
}

.dash-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--bg-2);
}

.dash-empty p {
  margin: 0 0 0.45rem;
  color: var(--text-muted);
}

.dash-empty .btn {
  margin-top: 0.55rem;
}

@media (max-width: 860px) {
  .dash-kpi-row,
  .dash-action-grid {
    grid-template-columns: 1fr;
  }

  .dash-strategy-row {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-strategy-actions {
    width: 100%;
  }

  .dash-strategy-actions .btn {
    flex: 1;
  }
}

/* ── Panels ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.35rem;
  margin-bottom: 1.1rem;
  backdrop-filter: none;
  box-shadow: 0 2px 10px rgba(112, 126, 174, 0.05);
  transition: border-color var(--dur-slow) var(--ease-smooth), box-shadow var(--dur-slow) var(--ease-smooth);
}

.panel:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 18px rgba(183, 121, 31, 0.06);
}

.panel h2,
.panel h3 {
  margin-top: 0;
  letter-spacing: -0.02em;
}

.panel h2 {
  font-size: 1.25rem;
}

/* ── Reveal animation ── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease-smooth), transform 0.55s var(--ease-smooth);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── Forms ── */
.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem 1rem;
}

.strategy-form {
  padding-bottom: 1.25rem;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  font-weight: 600;
  gap: 0.4rem;
  color: var(--text-muted);
}

input,
select,
button {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  background: var(--input-bg);
  transition: border-color var(--dur-base), box-shadow var(--dur-base), background var(--dur-base);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
  background: var(--surface-2);
}

button.btn,
a.btn,
.btn {
  position: relative;
  overflow: hidden;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  border: none;
  letter-spacing: 0.02em;
  transition: transform var(--dur-fast), box-shadow var(--dur-base), filter var(--dur-base);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover,
button.btn:hover,
a.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px var(--gold-glow);
  filter: brightness(1.05);
  color: #fff;
}

.btn-secondary,
button.btn-secondary,
a.btn.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}

.btn-secondary:hover,
button.btn-secondary:hover,
a.btn.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--primary);
  border-color: var(--primary);
  filter: none;
}

button:active,
.btn:active {
  transform: translateY(0);
}

.has-ripple .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: ripple 0.55s ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to { transform: scale(2.5); opacity: 0; }
}

.strategy-fields { display: contents; }
.hidden { display: none !important; }

code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82em;
  padding: 0.15em 0.4em;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--gold);
}

/* ── Strategy cards ── */
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.strategy-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  background: var(--surface-2);
  transition: transform var(--dur-base), border-color var(--dur-base), box-shadow var(--dur-base);
}

.strategy-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px var(--gold-glow);
}

.strategy-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.strategy-card strong {
  font-size: 0.95rem;
}

.strategy-card .edit-link,
.edit-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: background var(--dur-base);
}

.strategy-card .edit-link:hover,
.edit-link:hover {
  background: var(--gold-glow);
}

.strategy-params {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.param-chip {
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--gold-glow);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 0.75rem;
}

.stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: var(--surface-2);
  transition: transform var(--dur-base), border-color var(--dur-base), box-shadow var(--dur-base);
  cursor: default;
}

.stat:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.stat span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.05rem;
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
}

.stat.highlight {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--gold-glow), transparent);
  grid-column: span 1;
}

.stat.highlight strong {
  font-size: 1.2rem;
}

.kicker {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.muted {
  color: var(--text-muted);
  margin: 0.2rem 0;
  line-height: 1.5;
}

.page-head h2,
.page-head h3 {
  margin: 0.35rem 0;
}

/* ── Charts ── */
#revenueChart,
#drawdownChart {
  width: 100%;
  height: 360px;
  min-height: 360px;
  max-height: none;
}

#perTradeChart {
  width: 100%;
  height: 190px;
  min-height: 190px;
  max-height: 190px;
}

.chart-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.chart-panel-full {
  margin-bottom: 1rem;
}

.chart-panel-full:last-child {
  margin-bottom: 0;
}

.chart-panel-full h3 {
  margin: 0 0 0.65rem;
}

.chart-panel h3 { margin-top: 0; }

.chart-shell {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  background: var(--surface-2);
  transition: border-color var(--dur-base);
}

.chart-shell.equity-chart {
  padding: 0.75rem;
  min-height: 360px;
}

.chart-shell:hover {
  border-color: var(--border-strong);
}

.chart-shell.wide { min-height: 220px; }

#candleChart,
#chatCandleChart,
.day-candle-chart {
  width: 100%;
  height: 460px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
}

.chart-meta-line {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.day-filter-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.day-replay-block {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.selected-day-trades {
  margin-top: 1rem;
}

.selected-day-trades h4 {
  margin: 0 0 0.65rem;
}

.daily-card.is-selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-glow), 0 8px 24px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}

.run-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.run-summary-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 0.84rem;
}

.saved-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
}

.saved-result-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.saved-result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.saved-result-title {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}

.saved-result-title h4 {
  margin: 0;
  font-size: 1rem;
}

.saved-result-title p {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
}

.saved-result-icon {
  font-size: 1.2rem;
  line-height: 1.4;
}

.saved-result-pnl {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  white-space: nowrap;
}

.saved-result-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.75rem;
}

.saved-result-meta span {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.saved-result-meta strong {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.saved-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
}

.saved-result-actions form {
  margin: 0;
}

.saved-result-delete {
  color: #f87171;
}

.day-trade-table {
  min-width: 1100px;
}

.chart-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.chart-meta > div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
}

.chart-meta span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chart-meta strong {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.95rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--gold);
}

/* ── Params grid ── */
.params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.6rem;
}

.params-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.strategy-param-sections {
  display: grid;
  gap: 1rem;
}

.strategy-param-section h4 {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
  color: var(--text);
}

.param-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: var(--surface-2);
  transition: border-color var(--dur-base);
}

.param-item:hover {
  border-color: var(--border-strong);
}

.param-item span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.param-item strong {
  font-size: 0.9rem;
  font-family: "JetBrains Mono", monospace;
}

.backtest-leg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.8rem;
}

.backtest-leg-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem;
  background: var(--surface-2);
}

.backtest-leg-card.buy {
  border-color: color-mix(in srgb, var(--ok) 36%, var(--border));
}

.backtest-leg-card.sell {
  border-color: color-mix(in srgb, var(--err) 36%, var(--border));
}

.backtest-leg-card.is-disabled {
  opacity: 0.65;
}

.backtest-leg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.backtest-leg-head strong {
  display: block;
  margin-top: 0.2rem;
}

.backtest-leg-side {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.strategy-form .form-section-title {
  grid-column: 1 / -1;
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.strategy-form .form-section-title.side-buy {
  color: var(--ok);
}

.strategy-form .form-section-title.side-sell {
  color: var(--err);
}

.side-fields {
  /* grid layout handled by .form-block-grid */
}

.form-block.side-disabled {
  opacity: 0.55;
}

.form-block-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem 1.1rem;
  align-items: start;
}

.form-block-grid .wait-field {
  grid-column: 1 / -1;
}

label.wait-field {
  gap: 0.35rem;
}

.wait-field > span:first-child {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.wait-field > span.wait-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.wait-optional-toggle {
  margin: 0;
  flex: 0 0 auto;
}

.wait-field .field-hint {
  display: block;
  margin-top: 0.1rem;
}

.wait-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  max-width: 420px;
}

.wait-direction {
  width: 3.2rem;
  min-width: 3.2rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.buy-wait.dir-up .wait-direction,
.sell-wait.dir-up .wait-direction {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.35);
  background: var(--ok-bg);
}

.buy-wait.dir-down .wait-direction,
.sell-wait.dir-down .wait-direction {
  color: var(--err);
  border-color: rgba(248, 113, 113, 0.35);
  background: var(--err-bg);
}

.wait-unit {
  min-width: 5.5rem;
  font-weight: 700;
}

.strategy-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.strategy-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.9rem;
}

.strategies-head-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.strategies-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-muted);
}

.strategies-sort select {
  min-height: 2.2rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-weight: 650;
}

/* ── Icon-style strategy cards (Saved Strategies page) ── */
.strategies-search {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-muted);
}

.strategies-search input {
  min-width: 180px;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.strategies-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  margin: 0 0 0.75rem;
}

.strategies-count {
  margin: 0 0 0.75rem;
}

.strategy-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.strategy-page-switch {
  display: inline-flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.strategy-page-switch button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 700;
  padding: 0.5rem 0.95rem;
  border-radius: 9px;
  cursor: pointer;
}

.strategy-page-switch button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.strategy-public-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.strategy-template-owner {
  margin: 0.15rem 0 0.45rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.strategy-public-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
  font-size: 0.86rem;
  color: var(--text);
}

.strategy-public-check input {
  width: 1rem;
  height: 1rem;
}

.strategy-icon-primary-row {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 0.4rem;
  min-width: 0;
}

.strategy-icon-primary-row > .strategy-icon-btn-primary {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.paper-deploy-compact {
  display: block;
}

.paper-deploy-compact .strategy-icon-btn {
  width: 100%;
}

.strategy-icon-card[hidden],
.strategy-card-pro[hidden] {
  display: none !important;
}

.strategy-icon-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
  transition: transform var(--dur-slow) var(--ease-smooth), border-color var(--dur-slow), box-shadow var(--dur-slow);
}

.strategy-icon-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow), 0 0 28px var(--gold-glow);
}

.strategy-icon-card-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.75rem 0.55rem;
  background: linear-gradient(180deg, var(--gold-glow), transparent 85%);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.strategy-icon-badge {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  font-size: 1.2rem;
  line-height: 1;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.strategy-icon-type {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.strategy-icon-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.95rem 1rem 0.25rem;
  flex: 1;
}

.strategy-icon-name {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-align: center;
}

.strategy-icon-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.strategy-icon-meta-item.paper,
.strategy-icon-meta-item.live {
  grid-column: 1 / -1;
}

.strategy-icon-meta-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.38rem 0.45rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.55;
}

.strategy-icon-meta-item .meta-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.strategy-icon-meta-item.buy.is-on {
  color: var(--ok);
  background: var(--ok-bg);
  border-color: rgba(74, 222, 128, 0.35);
  opacity: 1;
}

.strategy-icon-meta-item.sell.is-on {
  color: var(--err);
  background: var(--err-bg);
  border-color: rgba(248, 113, 113, 0.35);
  opacity: 1;
}

.strategy-icon-meta-item.live.is-on {
  color: #166534;
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.45);
  opacity: 1;
}

.strategy-icon-meta-item.paper.is-on {
  color: var(--gold);
  background: rgba(212, 168, 83, 0.14);
  border-color: rgba(212, 168, 83, 0.4);
  opacity: 1;
}

.strategy-icon-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.strategy-icon-facts li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.strategy-icon-facts .fact-icon {
  flex-shrink: 0;
  margin-top: 0.12rem;
  font-size: 0.45rem;
  color: var(--gold);
}

.strategy-icon-card-footer {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 1rem 1rem;
  margin-top: auto;
}

.paper-deploy-form,
.paper-deploy-inline,
.paper-deploy-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.paper-deploy-form label,
.paper-deploy-inline label,
.paper-deploy-card label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.paper-deploy-form select,
.paper-deploy-inline select,
.paper-deploy-card select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.78rem;
}

.strategy-deploy-paper-btn {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.paper-deploy-card {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.strategy-icon-btn-primary {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.strategy-icon-secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  align-items: stretch;
}

.strategy-icon-secondary-actions > a,
.strategy-icon-secondary-actions > form {
  display: flex;
  margin: 0;
  min-width: 0;
}

.strategy-icon-secondary-actions .strategy-icon-btn {
  flex: 1;
  width: 100%;
  min-height: 2.15rem;
  padding: 0.38rem 0.35rem;
  font-size: 0.72rem;
  line-height: 1.1;
  white-space: nowrap;
}

.strategy-icon-secondary-actions > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.strategy-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.42rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-base), border-color var(--dur-base), transform var(--dur-fast);
}

.strategy-icon-btn:hover {
  background: var(--input-bg);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.strategy-icon-btn.danger {
  color: var(--err);
  background: var(--err-bg);
  border-color: rgba(248, 113, 113, 0.35);
}

.strategy-icon-btn.danger:hover {
  background: rgba(248, 113, 113, 0.22);
}

.strategy-icon-details {
  border-top: 1px dashed var(--border);
  padding: 0.55rem 1rem 0.85rem;
}

.strategy-icon-details summary {
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold);
  user-select: none;
  list-style: none;
  text-align: center;
}

.strategy-icon-details summary::-webkit-details-marker {
  display: none;
}

.strategy-icon-details summary::before {
  content: "▶ ";
  font-size: 0.62rem;
}

.strategy-icon-details[open] summary::before {
  content: "▼ ";
}

.strategy-icon-details .strategy-detail-grid {
  margin-top: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.strategy-card-pro {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
  padding: 1rem 1.05rem;
  transition: border-color var(--dur-base), box-shadow var(--dur-base), transform var(--dur-base);
}

.strategy-card-pro:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}

.strategy-card-pro-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.strategy-card-pro-title h4 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.strategy-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}

.btn-run {
  font-size: 0.78rem;
  padding: 0.38rem 0.7rem;
  border-radius: 8px;
  white-space: nowrap;
}

.strategy-card-details {
  border-top: 1px dashed var(--border);
  padding-top: 0.55rem;
}

.strategy-card-details summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  user-select: none;
  list-style: none;
}

.strategy-card-details summary::-webkit-details-marker {
  display: none;
}

.strategy-card-details summary::before {
  content: "▶ ";
  font-size: 0.65rem;
}

.strategy-card-details[open] summary::before {
  content: "▼ ";
}

.strategy-card-details .strategy-detail-grid {
  margin-top: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.strategy-selected-panel {
  border-color: var(--border-strong);
  background: linear-gradient(135deg, var(--gold-glow), var(--surface-2) 55%);
}

.strategy-selected-card {
  display: grid;
  gap: 0.75rem;
}

.strategy-selected-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.strategy-selected-head h3 {
  margin: 0.15rem 0 0.45rem;
}

.strategy-card-full {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color var(--dur-base), box-shadow var(--dur-base);
}

.strategy-card-full:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.strategy-card-full-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--input-bg);
}

.strategy-card-full-head h4 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.strategy-card-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.delete-strategy-form {
  margin: 0;
}

.copy-strategy-form {
  margin: 0;
  display: inline;
}

.copy-strategy-form button.edit-link {
  cursor: pointer;
  font: inherit;
}

.auto-paper-toggle-form {
  margin: 0;
  display: inline;
}

.auto-paper-toggle-form button.edit-link,
.auto-paper-toggle-form button.strategy-icon-btn {
  cursor: pointer;
  font: inherit;
}

.auto-paper-toggle-form button.strategy-icon-btn.is-active,
.auto-paper-toggle-form button.edit-link.auto-paper-on {
  color: var(--gold);
  border-color: rgba(212, 168, 83, 0.45);
}

.delete-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--err);
  background: var(--err-bg);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  transition: background var(--dur-base), transform var(--dur-fast);
}

.delete-link:hover {
  background: rgba(248, 113, 113, 0.22);
  transform: translateY(-1px);
}

.strategy-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0;
}

.strategy-detail-group {
  padding: 0.85rem 1rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.strategy-detail-group:last-child {
  border-right: none;
}

.strategy-detail-group h5 {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gold);
}

.strategy-detail-rows {
  margin: 0;
}

.strategy-detail-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(90px, 1fr);
  gap: 0.5rem;
  padding: 0.28rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .strategy-detail-row {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.strategy-detail-row:last-child {
  border-bottom: none;
}

.strategy-detail-row dt {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.strategy-detail-row dd {
  margin: 0;
  font-size: 0.84rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--text);
  text-align: right;
  word-break: break-word;
}

@media (max-width: 700px) {
  .strategy-card-full-head {
    flex-direction: column;
  }

  .strategy-detail-group {
    border-right: none;
  }

  .strategy-detail-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .strategy-detail-row dd {
    text-align: left;
  }
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.trade-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.trade-table th,
.trade-table td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.84rem;
}

.trade-table th {
  background: var(--input-bg);
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}

.trade-table tbody tr {
  transition: background var(--dur-fast);
}

.trade-table tbody tr:hover {
  background: var(--gold-glow);
}

.trade-table tbody tr:nth-child(2n) {
  background: rgba(255, 255, 255, 0.02);
}

.trade-table td.entry-logic {
  max-width: 22rem;
  white-space: normal;
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 500;
}

.trade-detail-row td {
  background: var(--input-bg);
  padding-top: 0.35rem;
  padding-bottom: 0.75rem;
}

.trade-entry-details {
  display: grid;
  gap: 0.45rem;
}

.trade-entry-details.compact .trade-entry-chip {
  font-size: 0.78rem;
}

.trade-detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.trade-entry-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.trade-entry-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.8rem;
}

.trade-entry-chip strong {
  color: var(--gold);
  font-size: 0.76rem;
}

[data-theme="light"] .trade-table tbody tr:nth-child(2n) {
  background: rgba(0, 0, 0, 0.02);
}

/* ── Daily cards ── */
.daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.7rem;
}

.daily-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.8rem;
  background: var(--surface-2);
  cursor: pointer;
  transition: transform var(--dur-base), box-shadow var(--dur-base), border-color var(--dur-base);
}

.daily-card:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.daily-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-family: "JetBrains Mono", monospace;
}

.daily-card p {
  margin: 0.15rem 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.daily-card strong {
  font-size: 1rem;
  font-family: "JetBrains Mono", monospace;
}

.daily-card .daily-balance {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.day-profit {
  border-color: rgba(52, 211, 153, 0.4);
  background: var(--ok-bg);
}

.day-loss {
  border-color: rgba(248, 113, 113, 0.4);
  background: var(--err-bg);
}

.day-flat {
  opacity: 0.75;
}

/* ── Details ── */
.day-details {
  margin-bottom: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color var(--dur-slow), box-shadow var(--dur-slow);
}

.day-details[open] {
  border-color: var(--border-strong);
}

.day-details.pulse-highlight {
  animation: pulseBorder 1.2s ease;
}

@keyframes pulseBorder {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 3px var(--gold-glow), 0 0 24px var(--gold-glow); }
}

.day-details summary {
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  background: var(--input-bg);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background var(--dur-base);
  user-select: none;
}

.day-details summary::-webkit-details-marker { display: none; }

.day-details summary::before {
  content: "▶";
  font-size: 0.65rem;
  color: var(--gold);
  transition: transform var(--dur-base);
}

.day-details[open] summary::before {
  transform: rotate(90deg);
}

.day-details summary:hover {
  background: var(--gold-glow);
}

.trade-day-toolbar {
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.trade-day-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.trade-day-list {
  display: grid;
  gap: 0.7rem;
}

.trade-day summary {
  flex-wrap: wrap;
}

.trade-day-title {
  min-width: 11rem;
}

.trade-day-meta {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
}

.trade-day-pnl {
  margin-left: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
}

.trade-day-table {
  min-width: 880px;
}

.trade-table td.mono,
.trade-table th.mono {
  font-family: "JetBrains Mono", monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trade-date-chip {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.08rem 0.35rem;
  border-radius: 6px;
  background: var(--gold-glow);
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.trade-day[hidden] {
  display: none;
}

/* ── Chat ── */
.chat-run {
  border-left: 3px solid var(--gold);
}

.chat-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

/* ── Chart terminal (TradingView-style) ── */
body:has(.chart-terminal) .admin-footer {
  display: none;
}

body:has(.chart-terminal) .admin-content {
  height: calc(100vh - var(--topbar-height));
  padding: 0.4rem 0 0.4rem;
  overflow: hidden;
}

body:has(.chart-terminal) .admin-content.container {
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  padding: 0 0.55rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chart-terminal {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 0.5rem 0.6rem 0.55rem;
  box-shadow: none;
}

.chart-terminal-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.chart-terminal-meta h2 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
}

.chart-terminal-meta p {
  margin: 0;
  font-size: 0.82rem;
}

.chart-terminal-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 0.5rem;
}

.chart-terminal-filters select {
  width: 100%;
  font-size: 0.82rem;
}

.chart-terminal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.chart-tool-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 0.42rem 0.72rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-base), border-color var(--dur-base), color var(--dur-base);
}

.chart-tool-btn:hover,
.chart-tool-btn.is-active {
  border-color: var(--gold);
  background: var(--gold-glow);
  color: var(--gold);
}

.chart-tool-btn-primary {
  background: linear-gradient(135deg, rgba(212, 168, 83, 0.22), rgba(212, 168, 83, 0.08));
  border-color: rgba(212, 168, 83, 0.45);
}

.chart-terminal-status {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.2;
}

.chart-replay-bar {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.1fr);
  gap: 0.55rem;
  align-items: center;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.chart-replay-controls {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  align-items: center;
}

.replay-speed-label,
.replay-progress-label {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.replay-speed-label input,
.replay-progress-label input {
  width: 100%;
}

.replay-speed-label span {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  color: var(--gold);
}

.chart-replay-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 0.55rem;
}

.replay-hud-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.28rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.replay-hud-item span {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.replay-hud-item strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
}

.replay-hud-total {
  border-color: rgba(212, 168, 83, 0.45);
  background: var(--gold-glow);
}

.replay-clock {
  color: var(--gold);
}

.chart-tool-btn-play {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
}

.chart-tool-btn-play:hover {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
}

.trade-data-row.is-live-open {
  background: rgba(212, 168, 83, 0.08);
}

.trade-data-row.is-live-closed {
  opacity: 0.72;
}

.trade-data-row.is-live-pending {
  opacity: 0.45;
}

.chart-terminal-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.tv-ohlc {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 16px;
  display: flex;
  gap: 0.7rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  color: #d1d4dc;
  pointer-events: none;
}

.tv-ohlc em {
  font-style: normal;
  color: #787b86;
  margin-right: 0.2rem;
}

.tv-ohlc .tv-stamp {
  color: #d1d4dc;
  margin-right: 0.15rem;
}

.tv-ohlc.is-up { color: #26a69a; }
.tv-ohlc.is-down { color: #ef5350; }

.tv-legend {
  position: absolute;
  z-index: 2;
  top: 30px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  pointer-events: none;
}

.tv-legend span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tv-legend i {
  width: 10px;
  height: 2px;
  border-radius: 1px;
}

.tv-legend em {
  font-style: normal;
  color: #787b86;
}

.chart-terminal-stage #chatCandleChart,
.chart-terminal-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  border: 1px solid #2a2e39;
  border-radius: 14px;
  overflow: hidden;
  background: #131722;
}

.chart-trades-drawer {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  overflow: hidden;
}

.chart-trades-drawer[open] > div {
  max-height: 180px;
  overflow: auto;
}

.chart-trades-drawer summary {
  cursor: pointer;
  padding: 0.75rem 0.9rem;
  font-weight: 600;
  font-size: 0.88rem;
  list-style: none;
}

.chart-trades-drawer summary::-webkit-details-marker {
  display: none;
}

.chart-trades-drawer[open] summary {
  border-bottom: 1px solid var(--border);
}

.chart-trades-drawer > #chatDayTrades {
  padding: 0.75rem 0.9rem 0.9rem;
  max-height: 280px;
  overflow: auto;
}

.chart-run-list {
  margin-top: 1rem;
}

body.chart-fullscreen-active {
  overflow: hidden;
}

body.chart-fullscreen-active .app-sidebar,
body.chart-fullscreen-active .admin-topbar,
body.chart-fullscreen-active .admin-footer,
body.chart-fullscreen-active .chart-run-list,
body.chart-fullscreen-active .flash-wrap {
  display: none !important;
}

body.chart-fullscreen-active .app-shell {
  margin-left: 0 !important;
}

body.chart-fullscreen-active .admin-content.container {
  max-width: none;
  padding: 0;
  margin: 0;
}

.chart-terminal.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  margin: 0;
  border-radius: 0;
  border: none;
  min-height: 100vh;
  padding: 0.75rem;
}

body:has(.chart-terminal) .chart-run-list {
  display: none;
}

.chart-terminal.is-fullscreen .chart-trades-drawer > #chatDayTrades {
  max-height: 220px;
}

@media (max-width: 980px) {
  .chart-terminal-toolbar {
    grid-template-columns: 1fr;
  }

  .chart-replay-bar {
    grid-template-columns: 1fr;
  }

  .chart-replay-hud {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }

  .chart-terminal-actions {
    justify-content: flex-start;
  }
}

.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.chat-head h3 { margin: 0; font-size: 1rem; }

.chat-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chat-metrics span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: var(--input-bg);
  font-size: 0.78rem;
  font-family: "JetBrains Mono", monospace;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-msg {
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--input-bg);
  font-size: 0.84rem;
  transition: transform var(--dur-fast);
}

.chat-msg:hover {
  transform: translateX(4px);
}

.system-msg { opacity: 0.8; }
.buy-msg { border-left: 3px solid var(--ok); }
.sell-msg { border-left: 3px solid var(--err); }

/* ── PnL colors ── */
.pnl-pos { color: var(--ok); font-weight: 700; }
.pnl-neg { color: var(--err); font-weight: 700; }

/* ── Flash messages ── */
.flash-wrap { margin-bottom: 1rem; }

.flash {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  animation: slideIn 0.4s ease both;
  transition: opacity 0.4s, transform 0.4s;
}

.flash.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.flash.success {
  background: var(--ok-bg);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--ok);
}

.flash.error {
  background: var(--err-bg);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--err);
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0 2rem;
  margin-top: 1rem;
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-credit {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ── Hero stats ── */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-stat strong {
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--input-bg);
}

.empty-state .empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.85;
}

.empty-state p {
  margin: 0.35rem 0;
  color: var(--text-muted);
}

.empty-state a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

.empty-state a:hover {
  text-decoration: underline;
}

/* ── Form blocks & side panels ── */
.form-block {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem 1.15rem 1.2rem;
  background: var(--surface-2);
}

.form-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

.form-block-head h4 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.reference-block {
  border-color: var(--border-strong);
}

.buy-block {
  border-left: 3px solid var(--ok);
  background: linear-gradient(135deg, var(--ok-bg), var(--surface-2) 45%);
}

.sell-block {
  border-left: 3px solid var(--err);
  background: linear-gradient(135deg, var(--err-bg), var(--surface-2) 45%);
}

.buy-block .form-block-head h4 { color: var(--ok); }
.sell-block .form-block-head h4 { color: var(--err); }

.form-subsection-title {
  grid-column: 1 / -1;
  margin: 0.35rem 0 0;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 0.75rem;
}

.avg-fields,
.leg-ema-fields,
.leg-rsi-fields,
.leg-candle-fields {
  display: contents;
}

.confirm-rules-wrap {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.confirm-rules {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.confirm-rule,
.confirm-rule.algo-cond-pair {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.confirm-rule label {
  margin: 0;
  font-size: 0.72rem;
}

.confirm-rule .rule-field[hidden] {
  display: none;
}

.rule-join-wrap {
  min-width: 0;
}

.confirm-rule.is-last-rule .rule-join-wrap,
.confirm-rule.is-first-rule:only-child .rule-join-wrap {
  display: none;
}

.algo-cond-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.confirm-rule:not(.is-last-rule):not(.can-remove) .algo-cond-footer {
  justify-content: center;
}

.confirm-rule.is-last-rule .algo-cond-footer {
  justify-content: flex-end;
}

.confirm-rule:not(.can-remove) .algo-cond-remove {
  display: none;
}

.rule-join-toggle {
  width: fit-content;
}

.rule-join-toggle .rule-join-or + span {
  color: var(--gold);
}

/* Algorooms-style condition pairs */
.style-confirm-block.algo-entry-conditions {
  grid-column: 1 / -1;
}

.algo-entry-box {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 0.85rem 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.algo-entry-title {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.algo-entry-title.is-long {
  color: #16a34a;
}

.algo-entry-title.is-short {
  color: #ef4444;
}

.algo-cond-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

@media (min-width: 768px) {
  .algo-cond-grid,
  .algo-cond-summaries {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.algo-ind-pick,
.algo-ind-comp {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 650;
  padding: 0.55rem 0.8rem;
  text-align: left;
}

.algo-ind-pick {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast), color var(--dur-fast);
}

.algo-ind-pick:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--gold-glow);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.algo-ind-pick:focus-visible,
.algo-ind-comp:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.algo-ind-pick-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.algo-ind-pick-hint {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--primary);
  opacity: 0.85;
}

.algo-ind-pick.is-disabled,
.algo-ind-pick:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.algo-ind-comp {
  appearance: auto;
  cursor: pointer;
}

.algo-ind-comp:disabled {
  opacity: 0.75;
  cursor: default;
}

.confirm-rule.is-pattern-rule .algo-ind-comp {
  font-weight: 650;
}

.algo-cond-vs {
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

@media (min-width: 768px) {
  .algo-cond-vs {
    display: flex;
  }
}

.algo-entry-help {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.algo-join-label {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--text-muted);
  margin-right: 0.35rem;
}

.rule-join-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.algo-add-pair-row {
  margin-top: 0.65rem;
}

.algo-add-pair-row .btn {
  min-height: 2.35rem;
  border-radius: 10px;
  padding: 0.45rem 0.9rem;
}

.algo-cond-summaries {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem 0.55rem;
  min-height: 1rem;
}

.algo-ind-sum {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.algo-andor {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.algo-andor label {
  margin: 0;
}

.algo-andor input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.algo-andor span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2rem;
  min-height: 1.85rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
}

.algo-andor label + label span {
  border-left: 1px solid var(--border);
}

.algo-andor input:checked + span {
  background: #3b82f6;
  color: #fff;
}

.algo-cond-remove {
  border: 0;
  background: transparent;
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
}

.algo-add-pair-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.algo-ind-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem 0.75rem;
  overflow: auto;
}

.algo-ind-modal[hidden] {
  display: none !important;
}

.algo-ind-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.algo-ind-modal-card {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  margin-top: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 1rem 1.05rem 1.1rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.algo-ind-modal-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.algo-ind-search {
  width: 100%;
  margin-bottom: 0.75rem;
}

.algo-ind-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: min(58vh, 520px);
  overflow: auto;
  padding-right: 0.2rem;
}

.algo-ind-item {
  display: block;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: var(--surface);
}

.algo-ind-item.is-active {
  border-color: #f5b82e;
  background: rgba(59, 130, 246, 0.1);
}

.algo-ind-item-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.algo-ind-item-head input {
  margin: 0;
}

.algo-ind-item-head span {
  font-size: 0.86rem;
  font-weight: 650;
}

.algo-ind-params {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.algo-ind-params label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.algo-ind-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.form-block-grid .avg-fields > .wait-field {
  grid-column: 1 / -1;
}

.form-actions-bar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.35rem 0 0;
}

.form-actions-bar .paper-deploy-source {
  margin-right: auto;
  min-width: 180px;
  max-width: 280px;
}

.builder-type-wrap,
.builder-snapshot {
  grid-column: 1 / -1;
}

.builder-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.55rem;
}

.type-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.type-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

.type-card span:last-child {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.type-card-icon {
  font-size: 1.15rem;
}

.type-card:hover {
  filter: none;
  transform: none;
  background: var(--surface-hover);
  color: var(--text);
  box-shadow: none;
}

.type-card.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
  background: linear-gradient(135deg, var(--gold-glow), var(--surface-2) 55%);
  color: var(--text);
}

.builder-snapshot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.builder-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

.builder-snapshot p {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  font-size: 0.84rem;
}

.builder-snapshot-stats {
  display: flex;
  gap: 1.1rem;
}

.builder-snapshot-stats div {
  display: flex;
  flex-direction: column;
}

.builder-snapshot-stats em {
  font-style: normal;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.05rem;
  color: var(--gold);
}

.builder-snapshot-stats span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chip-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-toggle label {
  margin: 0;
}

.chip-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-toggle span {
  display: inline-flex;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.chip-toggle input:checked + span {
  color: var(--gold);
  background: var(--gold-glow);
  border-color: var(--border-strong);
}

.tf-chip-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  grid-column: 1 / -1;
}

.tf-chip-field .chip-toggle span {
  padding: 0.32rem 0.55rem;
  font-size: 0.75rem;
}

.pattern-cards {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
}

.pattern-card {
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  cursor: pointer;
}

.pattern-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pattern-card strong {
  color: var(--text);
}

.pattern-card span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pattern-card:has(input:checked) {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.avg-fields.side-disabled,
.module-body.side-disabled,
.trail-fields.side-disabled,
.risk-fields.side-disabled,
.risk-capital-field.side-disabled,
.wait-distance-fields.side-disabled {
  opacity: 0.45;
}

.style-confirm-block {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.45rem;
}

.strategy-form[data-style="time_based"] .style-confirm-block,
.strategy-form[data-style="time_based"] .wait-optional-toggle,
.strategy-form[data-style="time_based"] .wait-hint-optional,
.strategy-form[data-style="time_based"] .style-hint-indicator,
.strategy-form[data-style="time_based"] .style-hint-candle,
.strategy-form[data-style="time_based"] .style-only-indicator {
  display: none;
}

.strategy-form[data-style="indicator_based"] .style-only-candle,
.strategy-form[data-style="indicator_based"] .style-hint-time,
.strategy-form[data-style="indicator_based"] .style-hint-candle,
.strategy-form[data-style="indicator_based"] .wait-hint-time {
  display: none;
}

.strategy-form[data-style="candle_formation"] .style-only-indicator,
.strategy-form[data-style="candle_formation"] .style-hint-time,
.strategy-form[data-style="candle_formation"] .style-hint-indicator,
.strategy-form[data-style="candle_formation"] .wait-hint-time {
  display: none;
}

.btn-secondary,
button.btn-secondary,
a.btn.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover,
button.btn-secondary:hover,
a.btn.btn-secondary:hover {
  filter: none;
  background: var(--surface-hover);
  color: var(--primary);
  border-color: var(--primary);
}

.field-hint {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: -0.15rem;
}

/* ── Segment toggle ── */
.segment-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  gap: 2px;
}

.segment-toggle label {
  margin: 0;
  cursor: pointer;
}

.segment-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment-toggle span {
  display: block;
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: background var(--dur-base), color var(--dur-base), box-shadow var(--dur-base);
}

.segment-toggle input:checked + span {
  background: var(--gold-glow);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.segment-toggle.buy-toggle input:checked + span {
  background: var(--ok-bg);
  color: var(--ok);
}

.segment-toggle.sell-toggle input:checked + span {
  background: var(--err-bg);
  color: var(--err);
}

.date-range-field {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.date-range-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.date-range-toggle {
  flex-wrap: wrap;
  align-self: flex-start;
}

.custom-range-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.custom-range-panel.hidden {
  display: none !important;
}

.custom-range-panel .field-hint {
  grid-column: 1 / -1;
  margin: 0;
}

.candle-coverage {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.4rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.candle-coverage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 0.9rem;
  font-size: 0.88rem;
  font-family: "JetBrains Mono", monospace;
}

.candle-coverage-row strong {
  min-width: 4.5rem;
  color: var(--gold);
}

.candle-coverage-row.is-empty {
  opacity: 0.7;
}

.candle-coverage-hint {
  margin: 0;
  font-size: 0.8rem;
}

.candle-coverage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
}

.candle-save-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  margin-left: auto;
}

.candle-save-form .edit-link,
.candle-save-form .btn {
  white-space: nowrap;
}

.candle-gap-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.15rem 0 0.35rem;
}

.candle-gap-chip {
  font-size: 0.75rem;
  font-family: "JetBrains Mono", monospace;
  color: #f0b429;
  background: rgba(240, 180, 41, 0.12);
  border: 1px solid rgba(240, 180, 41, 0.28);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
}

.leg-type-block {
  margin-bottom: 0.25rem;
}

.leg-type-field > span:first-child {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.leg-type-toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: 420px;
}

.leg-type-toggle span {
  text-align: center;
  padding: 0.55rem 0.75rem;
}

.leg-type-toggle input:checked + span.leg-buy {
  color: var(--ok);
  background: var(--ok-bg);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.35);
}

.leg-type-toggle input:checked + span.leg-sell {
  color: var(--err);
  background: var(--err-bg);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.35);
}

.leg-type-toggle input:checked + span.leg-both {
  color: var(--gold);
  background: var(--gold-glow);
}

.leg-side-toggle.hidden {
  display: none;
}

.form-block.hidden {
  display: none;
}

.custom-legs-block .form-block-head {
  align-items: flex-start;
}

.legs-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.btn-small {
  font-size: 0.76rem;
  padding: 0.38rem 0.7rem;
}

.legs-hint {
  margin: 0 0 0.85rem;
}

.leg-count-label {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
}

.custom-legs-grid {
  display: grid;
  gap: 0.9rem;
}

.custom-leg-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
  padding: 0.95rem 1rem 1rem;
  transition: border-color var(--dur-base), box-shadow var(--dur-base);
}

.custom-leg-card.buy-leg-card {
  border-color: rgba(74, 222, 128, 0.28);
}

.custom-leg-card.sell-leg-card {
  border-color: rgba(248, 113, 113, 0.28);
}

.custom-leg-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.custom-leg-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 180px;
}

.custom-leg-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.custom-leg-title-wrap .leg-name {
  flex: 1;
  min-width: 120px;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-weight: 700;
}

.custom-leg-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.custom-leg-grid {
  margin-top: 0.15rem;
}

.unit-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.unit-field > span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.unit-field .wait-input-row {
  grid-template-columns: minmax(0, 1fr) auto;
  max-width: none;
}

.unit-field.sl-field,
.unit-field.tp-field {
  gap: 0.45rem;
}

.unit-field .leg-sl_mode,
.unit-field .leg-target_mode {
  width: 100%;
  min-height: 2.4rem;
}

.sl-structure-fields {
  display: grid;
  gap: 0.4rem;
}

.sl-mini-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.sl-buffer-row,
.sl-ema-row,
.sl-indicator-period-row,
.sl-swing-row,
.sl-candle-row,
.tp-ratio-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.sl-candle-row,
.sl-indicator-row {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
}

.sl-ema-row,
.sl-indicator-period-row,
.sl-swing-row,
.tp-ratio-row {
  grid-template-columns: auto minmax(0, 1fr);
}

.sl-mode-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.wait-distance-fields.side-disabled {
  display: none;
}

.style-confirm-block .form-subsection-title {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.leg-more {
  grid-column: 1 / -1;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.35rem 0.75rem 0.65rem;
  background: var(--surface);
}

.leg-more > summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  list-style: none;
  padding: 0.4rem 0;
}

.leg-more > summary::-webkit-details-marker {
  display: none;
}

.leg-more > summary::after {
  content: "▾";
  float: right;
  opacity: 0.6;
}

.leg-more[open] > summary::after {
  content: "▴";
}

.leg-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
  padding-top: 0.35rem;
}

.leg-more-grid .wait-field {
  grid-column: auto;
}

.leg-more .avg-fields.side-disabled {
  display: none;
}

.strategy-form[data-style="indicator_based"] .wait-distance-block,
.strategy-form[data-style="candle_formation"] .wait-distance-block {
  grid-column: auto;
}

@media (max-width: 720px) {
  .custom-leg-card-head {
    flex-direction: column;
  }

  .custom-leg-actions {
    width: 100%;
  }

  .legs-toolbar {
    width: 100%;
    justify-content: stretch;
  }

  .legs-toolbar .btn {
    flex: 1;
  }
}

/* ── Result hero ── */
.result-hero {
  display: grid;
  grid-template-columns: 1.4fr auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--hero-grad);
  margin-bottom: 1rem;
}

.result-hero-pnl {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.result-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.result-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
}

.result-hero-side {
  display: grid;
  gap: 0.55rem;
  min-width: 160px;
}

.result-mini-stat {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: var(--surface-2);
  text-align: right;
}

.result-mini-stat span {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-mini-stat strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
}
.result-mini-stat strong span {
  display: inline;
  font-size: inherit;
  color: inherit;
  letter-spacing: 0;
  text-transform: none;
}
.result-dd-sep {
  color: var(--text-muted);
  font-weight: 500;
}

.result-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
}

.result-stat-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: var(--surface-2);
}

.result-stat-card span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.result-stat-card strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.15rem;
}

/* ── Section nav ── */
.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  position: sticky;
  top: 4.5rem;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.section-nav a {
  padding: 0.38rem 0.7rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  transition: background var(--dur-base), color var(--dur-base);
}

.section-nav a:hover,
.section-nav a.is-active {
  color: var(--gold);
  background: var(--gold-glow);
}

.section-nav-download {
  margin-left: auto;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
}

.panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.panel-head-row h3 {
  margin: 0;
}

.table-pagination {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.page-size-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.page-size-label select {
  min-width: 4.5rem;
  padding: 0.35rem 0.5rem;
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.pagination-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 6.5rem;
  text-align: center;
}

[data-no-reveal].reveal,
[data-no-reveal] .reveal {
  opacity: 1;
  transform: none;
}

/* ── Table tools ── */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.table-search {
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}

.table-search input {
  width: 100%;
}

.table-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Direction badges ── */
.dir-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.dir-badge.buy {
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.dir-badge.sell {
  color: var(--err);
  background: var(--err-bg);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

/* ── Strategy status chips ── */
.strategy-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.status-chip {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.status-chip.on-buy {
  color: var(--ok);
  background: var(--ok-bg);
}

.status-chip.off-buy,
.status-chip.off-sell {
  opacity: 0.55;
}

.status-chip.on-sell {
  color: var(--err);
  background: var(--err-bg);
}

/* ── Loading state ── */
form.is-submitting .btn[type="submit"] {
  opacity: 0.75;
  pointer-events: none;
}

form.is-submitting .btn[type="submit"]::after {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.5rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -0.1em;
}

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

/* ── Panel section title ── */
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
}

.panel-head .muted {
  margin-top: 0.35rem;
}

.indicator-note {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--surface-2);
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

/* ── Login ── */
body.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(420px, 92vw);
  padding: 1.5rem 0 3rem;
}

.login-card {
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 1.5rem 1.35rem 1.4rem;
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.login-brand h1 {
  margin: 0;
  font-size: 1.2rem;
}

.login-brand p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.login-form {
  display: grid;
  gap: 0.85rem;
}

.signup-form-page {
  gap: 0.75rem;
}

.login-submit {
  width: 100%;
  margin-top: 0.35rem;
}

.user-chip {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--gold-glow);
}

a.user-chip-link {
  text-decoration: none;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.user-chip-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.profile-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  padding: 0.42rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

.profile-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--gold-glow);
}

.profile-panel .profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.profile-form {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.profile-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.profile-form input,
.profile-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.profile-form input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.profile-form .btn {
  justify-self: start;
  margin-top: 0.25rem;
}

.profile-meta {
  margin: 0;
  font-size: 0.78rem;
}

.profile-danger {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, #dc2626 40%, var(--border));
}

.profile-danger .form-section-title {
  color: #b91c1c;
}

.profile-danger .muted {
  margin: 0;
}

@media (max-width: 860px) {
  .profile-panel .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-link {
    display: none;
  }
}

.logout-form {
  margin: 0;
}

.logout-btn {
  display: none;
}

.profile-menu {
  position: relative;
}

.wallet-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.backtest-credit-note {
  margin: 0.2rem 0 0.55rem;
  font-weight: 700;
  color: var(--text);
}

.wallet-chip em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.wallet-page {
  display: grid;
  gap: 1rem;
  max-width: 920px;
}

.wallet-head h2 {
  margin: 0.15rem 0 0.35rem;
}

.wallet-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.wallet-balance-card,
.wallet-ledger-card {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.wallet-balance-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(280px, 1fr);
  gap: 1.1rem;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 1.25rem 1.3rem;
  border-radius: 18px;
  background:
    radial-gradient(90% 140% at 100% 0%, var(--gold-glow), transparent 55%),
    var(--surface);
}

.wallet-balance-main > span,
.wallet-rate > span {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wallet-balance-main strong {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0.3rem 0 0.45rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: clamp(2.4rem, 4.5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.wallet-balance-main strong em {
  font-family: Inter, sans-serif;
  font-size: 0.95rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-muted);
}

.wallet-balance-main p,
.wallet-head .muted {
  margin: 0;
}

.wallet-rates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.wallet-rate {
  display: grid;
  align-content: center;
  gap: 0.15rem;
  padding: 0.8rem 0.85rem;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.wallet-rate strong {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.wallet-rate em {
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.wallet-ledger-card {
  border-radius: 18px;
  overflow: hidden;
}

.wallet-ledger-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.wallet-ledger-head h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.wallet-ledger-head .muted {
  margin: 0;
}

.wallet-count {
  min-width: 2rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--gold-glow);
  color: var(--gold);
  font-weight: 700;
  text-align: center;
}

.wallet-ledger {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wallet-ledger li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.wallet-ledger li:last-child {
  border-bottom: 0;
}

.wallet-mark {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1;
}

.wallet-mark.plus {
  background: var(--ok-bg);
  color: var(--ok);
}

.wallet-mark.minus {
  background: var(--err-bg);
  color: var(--err);
}

.wallet-tx {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.wallet-tx em {
  font-style: normal;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wallet-tx time {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.wallet-delta {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}

.wallet-delta-plus {
  color: var(--ok);
  background: var(--ok-bg);
}

.wallet-delta-minus {
  color: var(--err);
  background: var(--err-bg);
}

.wallet-empty {
  margin: 0;
  padding: 1.4rem 1.15rem 1.5rem;
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .wallet-balance-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .wallet-rates {
    grid-template-columns: 1fr;
  }

  .wallet-ledger li {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .wallet-delta {
    grid-column: 2;
    justify-self: start;
  }
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.admin-table th,
.admin-table td {
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-sub {
  display: block;
  font-size: 0.75rem;
}

.admin-credit-balance {
  margin: 0 0 0.4rem;
  font-weight: 700;
}

.admin-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: end;
}

.issue-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
}
.issue-stat {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}
.issue-stat span {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}
.issue-stat strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}
.issue-stat.is-active {
  border-color: #b7791f;
  box-shadow: inset 0 0 0 1px #b7791f;
}
.issue-stat small {
  display: block;
  margin-top: 0.1rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
}
.issue-stat.is-pending strong { color: #b45309; }
.issue-stat.is-open strong { color: #b45309; }
.issue-stat.is-in_progress strong { color: #b7791f; }
.issue-stat.is-solved strong { color: #15803d; }
.issue-stat.is-all strong { color: var(--text); }
.issue-stat.is-approved strong { color: #15803d; }
.issue-stat.is-rejected strong { color: #b91c1c; }
.issue-stats.is-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.issue-stat.is-pending {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.35);
}
.issue-filters {
  display: grid;
  grid-template-columns: 240px 200px minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: end;
  margin-top: 0.9rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
}
.issue-filters.is-three {
  grid-template-columns: 260px minmax(0, 1fr) auto;
}
.issue-filters label,
.issue-reply label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}
.issue-filters select,
.issue-filters input,
.issue-reply select,
.issue-reply input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.issue-filter-actions {
  display: flex;
  gap: 0.45rem;
}
.issue-count {
  margin: 0.8rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 650;
}
.issue-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.7rem;
}
.issue-card {
  padding: 1rem 1rem 0.9rem;
  border: 1px solid var(--border);
  border-left: 4px solid #d97706;
  border-radius: 16px;
  background: var(--surface);
}
.issue-card.is-in_progress { border-left-color: #b7791f; }
.issue-card.is-solved { border-left-color: #16a34a; }
.issue-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}
.issue-card-top h3 {
  margin: 0.1rem 0 0;
  font-size: 1.05rem;
}
.issue-id {
  margin: 0;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.issue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.issue-meta span {
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 650;
}
.issue-body,
.ticket-note {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: var(--bg);
  white-space: pre-wrap;
}
.issue-group {
  margin-top: 1.2rem;
}
.issue-group-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-size: 1rem;
}
.issue-group-count {
  font-weight: 800;
}
.issue-group-hint {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.issue-group.is-solved .issue-card {
  opacity: 0.85;
}
.issue-age {
  flex: none;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #fff4d6;
  color: #8a5a00;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.issue-age.is-done {
  background: #e5f7ea;
  color: #0d6b32;
}
.issue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.issue-reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}
.issue-empty {
  margin-top: 0.8rem;
  padding: 1.4rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  text-align: center;
  color: var(--text-muted);
}
.user-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.user-card.is-inactive { opacity: 0.72; }
.user-card-top {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}
.user-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  background: #b7791f;
  color: #fff;
  font-weight: 700;
}
.user-identity { min-width: 0; flex: 1; }
.user-identity h3 { margin: 0; font-size: 1.05rem; }
.user-identity h3 em {
  margin-left: 0.35rem;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b7791f;
}
.user-identity p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}
.user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}
.user-balance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--bg);
}
.user-balance span {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}
.user-balance strong {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.user-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: end;
  margin-top: 0.8rem;
}
.user-tool {
  display: flex;
  gap: 0.45rem;
  align-items: end;
}
.user-tool label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}
.user-tool select {
  min-width: 8rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.credit-rates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
.credit-rate {
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.credit-rate span,
.credit-editor label > span {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}
.credit-rate strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 2rem;
  letter-spacing: -0.04em;
}
.credit-rate em {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-style: normal;
  font-size: 0.82rem;
}
.credit-editor {
  margin-top: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
}
.credit-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.credit-editor label { display: grid; gap: 0.35rem; }
.credit-editor input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
}
.credit-editor small {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}
.credit-editor .btn { margin-top: 0.9rem; }
@media (max-width: 720px) {
  .credit-rates,
  .credit-fields { grid-template-columns: 1fr; }
}
.ticket-status {
  display: inline-block;
  flex: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
}
.ticket-status.open { background: #fff4d6; color: #8a5a00; }
.ticket-status.in_progress { background: #e7f1ff; color: #b7791f; }
.ticket-status.solved { background: #e5f7ea; color: #0d6b32; }
.support-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.support-layout h3 { margin: 0 0 0.75rem; }
@media (max-width: 860px) {
  .issue-stats,
  .issue-filters,
  .issue-reply,
  .support-layout {
    grid-template-columns: 1fr;
  }
  .issue-stats,
  .issue-stats.is-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .issue-filters.is-three { grid-template-columns: 1fr; }
  .issue-stat.is-pending { grid-column: 1 / -1; }
  .user-card-top { flex-wrap: wrap; }
  .user-badges { justify-content: flex-start; }
}

.admin-inline input,
.admin-inline select,
.admin-gateway-form select,
.profile-form select {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.admin-inline input[type="number"],
.admin-inline input[type="text"] {
  width: 8.5rem;
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 650;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.admin-stat {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.admin-stat span {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-stat strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.35rem;
}

body.admin-desk {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.desk-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.desk-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}

.desk-brand img {
  width: 2rem;
  height: 2rem;
}

.desk-brand strong,
.desk-brand em {
  display: block;
}

.desk-brand em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.desk-nav {
  display: flex;
  gap: 0.35rem;
}

.desk-nav a,
.desk-back {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.desk-nav a.is-active {
  background: var(--gold-glow);
  color: var(--text);
}

.desk-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 720px) {
  .desk-topbar {
    flex-wrap: wrap;
  }

  .desk-brand {
    margin-right: 0;
  }
}

.profile-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 12.5rem;
  padding: 0.28rem 0.55rem 0.28rem 0.28rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.profile-menu-btn:hover,
.profile-menu.is-open .profile-menu-btn {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: var(--gold-glow);
}

.profile-menu-avatar {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #b7791f, #8a5a12);
  color: #fff;
  flex-shrink: 0;
}

.profile-menu-avatar svg {
  width: 0.95rem;
  height: 0.95rem;
}

.profile-menu-name {
  font-size: 0.78rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 10.5rem;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 80;
}

.profile-menu-panel[hidden] {
  display: none;
}

.profile-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}

.profile-menu-item:hover {
  background: var(--gold-glow);
  color: var(--primary);
}

.profile-menu-logout {
  color: var(--err);
}

.profile-menu-logout:hover {
  background: var(--err-bg);
  color: var(--err);
}

@media (max-width: 720px) {
  .profile-menu-name {
    display: none;
  }

  .profile-menu-btn {
    padding: 0.2rem;
  }
}

.landing-hero {
  padding: 2.5rem 1.5rem 2rem;
  margin-bottom: 1.25rem;
}

.landing-lead {
  max-width: 58ch;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0.75rem 0 1.25rem;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.landing-features .action-card {
  cursor: default;
}

.landing-features .action-card:hover {
  transform: translateY(-4px);
}

.landing-panel h3 {
  margin-top: 0;
}

.landing-steps {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.65rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.landing-steps strong {
  color: var(--text);
}

.signup-panel {
  margin-bottom: 1.5rem;
}

.signup-lead {
  margin: 0 0 1rem;
}

.signup-form {
  max-width: 720px;
}

.signup-submit {
  align-self: end;
}

.signup-signin-link {
  margin: 1rem 0 0;
  font-size: 0.88rem;
}

.signup-signin-link a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

.login-home-link {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.82rem;
}

.login-home-link a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

.login-home-link a:hover {
  text-decoration: underline;
}

body.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  align-content: center;
  justify-items: center;
  background:
    radial-gradient(ellipse at 75% 0%, rgba(0, 212, 255, 0.18), transparent 42%),
    #06090e;
  color: #cbd7e4;
  font-family: Inter, -apple-system, "Segoe UI", sans-serif;
}
body.login-page .bg-mesh { display: none; }
body.login-page .login-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)), #0e141d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: none;
}
body.login-page .login-brand h1 {
  font-family: "Space Grotesk", Inter, sans-serif;
  color: #f4f9ff;
  letter-spacing: -0.028em;
  font-weight: 700;
}
body.login-page .login-fx { color: #f5b82e; }
body.login-page .login-brand p {
  color: #f0f7ff;
  font-size: 15px;
  font-weight: 300;
}
body.login-page .login-form label { color: #55677d; }
body.login-page .login-form input {
  background: #090d14;
  border: 1px solid #1c2531;
  color: #f4f9ff;
  border-radius: 10px;
}
body.login-page .login-form input:focus {
  border-color: #f5b82e;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.35);
  background: #090d14;
}
body.login-page .login-submit {
  background: linear-gradient(135deg, #2fe0ff, #00a9e8 80%);
  color: #001018;
  border: 0;
  border-radius: 14px;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.7px;
  box-shadow: 0 4px 18px rgba(0, 212, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
body.login-page .login-home-link,
body.login-page .login-home-link a { color: #55677d; }
body.login-page .login-home-link a:hover { color: #f5b82e; }
body.login-page .login-footer {
  position: static;
  pointer-events: auto;
  color: #55677d;
  display: flex;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  padding: 0 1rem 1.25rem;
}
body.login-page .login-footer a {
  color: #f5b82e;
  text-decoration: none;
}

body.auth-desk {
  display: block;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 78% 42%, rgba(0, 212, 255, 0.08), transparent 36%),
    #0a0c0f;
  color: #c8d6e5;
  font-family: "Roboto Mono", ui-monospace, monospace;
}
.auth-split {
  width: min(1120px, calc(100% - 2.5rem));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}
.auth-card {
  background: #151a22;
  border: 1px solid #1f2733;
  border-radius: 18px;
  padding: 1.6rem 1.45rem 1.35rem;
  box-shadow: none;
}
.auth-mark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.auth-mark .login-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}
.auth-mark h1 {
  margin: 0;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #f4f9ff;
}
.auth-kicker {
  margin: 0.15rem 0 0;
  color: #4a5568;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.auth-blurb {
  margin: 0.95rem 0 0;
  color: #8fa6bd;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  text-align: center;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 1.1rem 0 0.95rem;
}
.auth-tab {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 9px;
  border-radius: 4px;
  border: 1px solid #1f2733;
  background: #0a0c0f;
  color: #4a5568;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.auth-tab.is-active {
  background: rgba(0, 212, 255, 0.08);
  border-color: #f5b82e;
  color: #fff;
}
body.auth-desk .auth-form {
  gap: 0.75rem;
}
body.auth-desk .auth-form label {
  display: grid;
  gap: 0.35rem;
  color: #8fa6bd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
body.auth-desk .auth-form input[type="text"],
body.auth-desk .auth-form input[type="email"],
body.auth-desk .auth-form input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  background: #0a0c0f;
  border: 1px solid #1f2733;
  color: #fff;
  border-radius: 4px;
  padding: 11px 14px;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
body.auth-desk .auth-form input:focus {
  outline: none;
  border-color: #f5b82e;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.18);
  background: #0a0c0f;
}
.auth-check,
.auth-agree {
  display: flex !important;
  align-items: flex-start;
  gap: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #c8d6e5 !important;
  font-size: 11px !important;
}
body.auth-desk .auth-form label.auth-agree {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  line-height: 1.45;
}
.auth-check input,
.auth-agree input {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  accent-color: #f5b82e;
}
.auth-agree a {
  color: #f5b82e;
  text-decoration: none;
}
.auth-agree a:hover { text-decoration: underline; }
body.auth-desk .login-submit {
  width: 100%;
  margin-top: 0.25rem;
  background: #f5b82e;
  color: #000;
  border: 0;
  border-radius: 4px;
  padding: 12px;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  box-shadow: none;
}
body.auth-desk .login-submit:hover { filter: brightness(1.05); }
.pw-field {
  position: relative;
  display: block;
}
.pw-field input {
  padding-right: 72px !important;
}
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #f5b82e;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 6px;
}
.auth-forgot {
  margin: -0.15rem 0 0.15rem;
  text-align: right;
  text-transform: none;
  letter-spacing: 0;
}
.auth-forgot a {
  color: #f5b82e;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
}
.auth-forgot a:hover { text-decoration: underline; }
.auth-switch,
body.auth-desk .login-home-link,
.auth-legal {
  margin: 0.85rem 0 0;
  text-align: center;
  color: #4a5568;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}
.auth-switch a,
body.auth-desk .login-home-link a,
.auth-legal a {
  color: #f5b82e;
  text-decoration: none;
}
.auth-switch a:hover,
body.auth-desk .login-home-link a:hover,
.auth-legal a:hover { text-decoration: underline; }
.auth-aside {
  min-height: 420px;
  padding: 2rem 1rem 2rem 2rem;
  background:
    linear-gradient(rgba(0, 212, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 62% 62%, rgba(0, 212, 255, 0.16), transparent 28%);
  background-size: 42px 42px, 42px 42px, auto;
  border-radius: 18px;
}
.auth-aside h2 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(2rem, 3.4vw, 42px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: #f7fbff;
}
.auth-aside h2 span { color: #f5b82e; }
.auth-pill {
  display: inline-block;
  margin: 1.15rem 0 0;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 197, 66, 0.45);
  color: #f5c542;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.terms-wrap {
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}
.terms-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.terms-brand,
.terms-top a {
  color: #f5b82e;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.terms-page h1 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(1.8rem, 4vw, 36px);
  letter-spacing: -0.03em;
  color: #f4f9ff;
}
.terms-updated {
  margin: 0.45rem 0 1.4rem;
  color: #4a5568;
  font-size: 12px;
}
.terms-page section {
  margin: 0 0 1.15rem;
  padding: 1rem 1rem 0.2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}
.terms-page h2 {
  margin: 0 0 0.55rem;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f4f9ff;
}
.terms-page p {
  margin: 0 0 0.85rem;
  color: #c8d6e5;
  font-family: Inter, sans-serif;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
}
.terms-page a { color: #f5b82e; }
@media (max-width: 900px) {
  .auth-split {
    grid-template-columns: 1fr;
    width: min(440px, calc(100% - 1.5rem));
    padding: 1.25rem 0 2rem;
  }
  .auth-aside { display: none; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ── Responsive ── */
@media (max-width: 760px) {
  #chatCandleChart { height: 350px; }
  .chart-terminal-stage #chatCandleChart { height: 100%; }

  #revenueChart,
  #drawdownChart,
  #perTradeChart {
    height: 150px;
    min-height: 150px;
    max-height: 150px;
  }
}

@media (max-width: 900px) {
  body.has-sidebar .app-shell {
    margin-left: 0;
  }

  .sidebar-mobile-toggle {
    display: inline-flex;
  }

  .app-sidebar {
    width: min(270px, 86vw);
    transform: translateX(-105%);
    box-shadow: var(--shadow);
  }

  body.sidebar-mobile-open .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-collapse-btn {
    display: none;
  }

  body.sidebar-collapsed .sidebar-brand-text,
  body.sidebar-collapsed .sidebar-label {
    opacity: 1;
    width: auto;
  }
}

@media (max-width: 700px) {
  .topbar-inner {
    flex-wrap: wrap;
    position: relative;
  }

  .topbar-right {
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .site-nav {
    display: flex;
    gap: 0.25rem;
  }

  .result-hero {
    grid-template-columns: 1fr;
  }

  .result-hero-side {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-actions-bar {
    flex-direction: column;
  }

  .form-actions-bar .btn {
    width: 100%;
  }

  .strategy-card-pro-top {
    flex-direction: column;
  }

  .strategy-card-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .strategy-icon-grid {
    grid-template-columns: 1fr;
  }

  .strategy-icon-meta {
    grid-template-columns: 1fr;
  }

  .btn-run {
    flex: 1;
    text-align: center;
  }
}

/* ── Paper trading ── */
.paper-start-form {
  display: grid;
  gap: 1rem;
  align-items: end;
}

.paper-stop-form {
  margin-top: 0.5rem;
}

.paper-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.metric-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: var(--input-bg);
}

.metric-card .metric-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
  margin-bottom: 0.25rem;
}

.paper-tick {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
}

.paper-log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
  font-size: 0.84rem;
}

.paper-log li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.paper-log time {
  font-family: "JetBrains Mono", monospace;
  opacity: 0.65;
  margin-right: 0.5rem;
}

.btn-danger,
button.btn.btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: transparent;
}
.btn-ok,
button.btn.btn-ok {
  background: #15803d;
  color: #fff;
  border-color: transparent;
}
.btn-warn,
button.btn.btn-warn {
  background: #b45309;
  color: #fff;
  border-color: transparent;
}

.btn-danger:hover {
  filter: brightness(1.08);
}

.paper-chart-panel {
  margin-top: 0.5rem;
}

.paper-chart-status {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
}

.live-chart-header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.live-chart-controls {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.live-chart-quote-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.live-tv-stage {
  position: relative;
  height: min(72vh, 760px);
  min-height: 480px;
  border-radius: 12px;
  overflow: hidden;
  background: #131722;
  border: 1px solid #2a2e39;
}

.live-chart-canvas {
  width: 100%;
  height: 100%;
  min-height: 480px;
  background: #131722;
  border: 0;
  border-radius: 0;
}

.live-chart-panel .panel-head {
  margin-bottom: 0.65rem;
}

.paper-live-header-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.paper-deploy-bar {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.paper-live-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.paper-session-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.paper-session-tab {
  display: flex;
    flex-direction: column;
    align-items: flex-start;
  gap: 0.25rem;
  min-width: 160px;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.paper-session-tab:hover {
  border-color: var(--gold);
}

.paper-session-tab.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.paper-tab-name {
  font-weight: 700;
  font-size: 0.88rem;
}

.paper-tab-pnl {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  font-weight: 700;
}

.paper-empty-hint {
  margin: 0;
  padding: 0.5rem 0;
}

.paper-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 1rem;
}

.paper-detail-head {
  margin-bottom: 0.75rem;
}

.paper-detail-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.paper-stop-inline {
  margin: 0;
}

.paper-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.paper-config-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: var(--surface-2);
}

.paper-config-item span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.paper-config-item strong {
  font-size: 0.86rem;
}

.paper-pnl-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.paper-pnl-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: var(--input-bg);
}

.paper-pnl-card span {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.paper-pnl-card strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
}

.paper-stop-banner {
  margin: 0.5rem 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 180, 0, 0.12);
  border: 1px solid rgba(255, 180, 0, 0.35);
  font-size: 0.85rem;
}

.paper-detail-log {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  background: var(--input-bg);
  max-height: 720px;
  overflow: auto;
}

.paper-detail-log h4,
.paper-trades-wrap h4 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
}

.paper-trades-wrap {
  margin-top: 1rem;
}

.btn-small {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

@media (max-width: 960px) {
  .paper-detail-grid {
    grid-template-columns: 1fr;
  }

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

.paper-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.paper-history-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: var(--input-bg);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.paper-history-card.is-selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.paper-history-card[hidden] {
  display: none;
}

.paper-history-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.paper-history-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.paper-history-meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.paper-history-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

.paper-history-trades {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.paper-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.paper-history-field {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: var(--surface-2);
}

.paper-history-field span {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.paper-history-field strong {
  font-size: 0.84rem;
  font-family: "JetBrains Mono", monospace;
}

.paper-history-note {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: var(--surface-2);
}

.paper-history-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.paper-history-orders {
  margin: 0.55rem 0 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.paper-history-orders h5 {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.paper-order-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 160px;
  overflow: auto;
}

.paper-order-log li {
  font-size: 0.78rem;
  line-height: 1.35;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  background: var(--input-bg);
}

.paper-order-log time {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  color: var(--muted);
  margin-right: 0.35rem;
}

.paper-order-log-order {
  border-left: 3px solid var(--gold);
}

.paper-order-log-fill {
  border-left: 3px solid #3fb950;
}

.paper-order-log-info {
  border-left: 3px solid var(--border);
}

tr.paper-trade-open td {
  background: rgba(212, 175, 55, 0.08);
}

.status-chip.paper-status-completed {
  background: rgba(46, 160, 67, 0.15);
  color: #3fb950;
  border-color: rgba(46, 160, 67, 0.35);
}

.status-chip.paper-status-stopped {
  background: rgba(210, 153, 34, 0.12);
  color: #d29922;
  border-color: rgba(210, 153, 34, 0.35);
}

.paper-history-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}

.paper-history-filters {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.paper-filter-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.paper-filter-btn.is-active {
  border-color: var(--gold);
  color: var(--gold);
}

.paper-history-table td {
  vertical-align: top;
  font-size: 0.82rem;
}

.paper-hist-primary {
  display: block;
  font-weight: 600;
}

.paper-hist-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.paper-hist-sub.mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
}

.paper-hist-error {
  color: var(--err);
}

.paper-hist-actions {
  white-space: nowrap;
}

.paper-history-row.is-selected {
  background: rgba(212, 175, 55, 0.08);
}

.paper-history-row[hidden] {
  display: none;
}

.paper-history-wrap {
  overflow-x: auto;
}

/* ── FxTruebook Backtesting Studio product home ── */
body.home-product {
  font-family: "DM Sans", system-ui, sans-serif;
  overflow-x: clip;
}

body.home-product .home-brand-mark,
body.home-product .home-hero-title,
body.home-product .home-section-head h3,
body.home-product .home-plan h4,
body.home-product .home-feature h4,
body.home-product .home-steps h4,
body.home-product .home-cta-band h3,
body.home-product .home-family-panel h3,
body.home-product .brand h1 {
  font-family: Syne, "DM Sans", system-ui, sans-serif;
}

.home-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.home-atmosphere-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(212, 168, 83, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 168, 83, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 20%, transparent 75%);
}

.home-atmosphere-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: homeGlowDrift 14s ease-in-out infinite alternate;
}

.home-atmosphere-glow-a {
  width: min(55vw, 520px);
  height: min(55vw, 520px);
  top: -12%;
  left: -8%;
  background: rgba(212, 168, 83, 0.18);
}

.home-atmosphere-glow-b {
  width: min(45vw, 420px);
  height: min(45vw, 420px);
  top: 18%;
  right: -10%;
  background: rgba(52, 211, 153, 0.1);
  animation-delay: -4s;
}

@keyframes homeGlowDrift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(3%, 4%) scale(1.08); }
}

.home-chart-plane {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8%;
  height: min(42vh, 420px);
  opacity: 0.28;
}

.home-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.home-chart-line {
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: homeDrawLine 2.4s ease-out forwards 0.2s;
}

.home-chart-area {
  opacity: 0;
  animation: homeFadeArea 1.4s ease-out forwards 0.8s;
}

@keyframes homeDrawLine {
  to { stroke-dashoffset: 0; }
}

@keyframes homeFadeArea {
  to { opacity: 1; }
}

body.home-product .public-topbar,
body.home-product .public-main,
body.home-product .public-footer {
  position: relative;
  z-index: 1;
}

.home-topbar {
  border-bottom-color: rgba(212, 168, 83, 0.12);
}

.home-nav {
  display: none;
  align-items: center;
  gap: 1.15rem;
}

.home-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color var(--dur-base);
}

.home-nav a:hover {
  color: var(--gold);
}

.home-main {
  padding: 0 0 0;
}

.home-hero {
  position: relative;
  min-height: calc(100vh - var(--topbar-height));
  display: flex;
  align-items: flex-end;
  padding: clamp(3rem, 10vh, 6rem) 0 clamp(3.5rem, 8vh, 5.5rem);
  overflow: hidden;
}

.home-hero-falcon {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.home-hero-falcon::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 8%, rgba(12, 11, 9, 0.72) 42%, rgba(12, 11, 9, 0.2) 68%, transparent 100%),
    linear-gradient(180deg, rgba(12, 11, 9, 0.35) 0%, transparent 28%, rgba(12, 11, 9, 0.55) 100%);
}

.home-hero-falcon-img {
  position: absolute;
  right: -6%;
  top: 50%;
  transform: translateY(-48%);
  width: min(68vw, 720px);
  height: auto;
  object-fit: cover;
  opacity: 0.92;
  filter: saturate(1.05) contrast(1.05);
  animation: homeFalconIn 1.2s ease-out both 0.15s;
  mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}

@keyframes homeFalconIn {
  from { opacity: 0; transform: translateY(-44%) scale(1.04); }
  to { opacity: 0.92; transform: translateY(-48%) scale(1); }
}

.home-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  animation: homeHeroIn 0.9s ease-out both;
}

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

.home-brand-mark {
  margin: 0 0 0.85rem;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
  background: linear-gradient(120deg, #f0d9a0 0%, var(--gold) 45%, #8fd9b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-hero-title {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  max-width: 22ch;
  color: var(--text);
}

.home-hero-lead {
  margin: 0 0 1.6rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 42ch;
}

.home-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.home-btn-primary {
  background: linear-gradient(135deg, #e0bc6a, var(--gold-dim));
  color: #0c0b09;
  border: none;
  box-shadow: 0 10px 28px rgba(212, 168, 83, 0.28);
}

.home-btn-primary:hover {
  filter: brightness(1.05);
}

.home-strip {
  border-block: 1px solid rgba(212, 168, 83, 0.14);
  background: rgba(12, 11, 9, 0.45);
  backdrop-filter: blur(10px);
}

.home-strip-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 0.95rem 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.home-strip-inner strong {
  color: var(--gold);
  font-weight: 600;
}

.home-strip-inner a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 168, 83, 0.35);
}

.home-section {
  padding: clamp(3rem, 7vh, 5rem) 0;
}

.home-section-head {
  max-width: 40rem;
  margin-bottom: 2rem;
}

.home-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.home-section-head h3 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.home-section-head p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.home-feature {
  padding: 1.25rem 1.2rem 1.35rem;
  border-top: 1px solid rgba(212, 168, 83, 0.35);
  background: transparent;
}

.home-feature h4 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.home-feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.home-plans-section {
  background: linear-gradient(180deg, rgba(212, 168, 83, 0.05), transparent 40%);
}

.home-plan-toggle {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.3rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(12, 11, 9, 0.5);
}

.home-plan-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--dur-base), color var(--dur-base);
}

.home-plan-tab.is-active {
  background: rgba(212, 168, 83, 0.18);
  color: var(--gold);
}

.home-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.home-plan {
  display: flex;
  flex-direction: column;
    gap: 0.65rem;
  padding: 1.4rem 1.3rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(22, 20, 17, 0.72);
  transition: opacity var(--dur-slow), transform var(--dur-slow), border-color var(--dur-slow), box-shadow var(--dur-slow);
}

.home-plan.is-dimmed {
  opacity: 0.42;
  transform: scale(0.985);
}

.home-plan-featured {
  border-color: rgba(212, 168, 83, 0.55);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(212, 168, 83, 0.12);
  background: linear-gradient(165deg, rgba(212, 168, 83, 0.14), rgba(22, 20, 17, 0.92) 42%);
}

.home-plan-badge {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.home-plan h4 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.home-plan-price {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.home-plan-price span {
  font-family: Syne, sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.home-plan-price small {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.home-plan-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.home-plan ul {
  margin: 0.35rem 0 0.75rem;
  padding: 0;
  list-style: none;
  flex: 1;
}

.home-plan li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid rgba(212, 168, 83, 0.08);
}

.home-plan li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 1px;
  background: var(--gold);
}

.home-plan-cta {
  width: 100%;
  text-align: center;
  justify-content: center;
}

.home-plans-footnote {
  margin: 1.25rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.home-plans-footnote a {
  color: var(--gold);
}

.home-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  counter-reset: none;
}

.home-step-num {
  display: block;
  margin-bottom: 0.55rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.home-steps h4 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.home-steps p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.home-family-panel {
  padding: clamp(1.75rem, 4vw, 2.5rem);
  border: 1px solid rgba(212, 168, 83, 0.28);
  border-radius: 18px;
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, rgba(212, 168, 83, 0.16), transparent 55%),
    rgba(22, 20, 17, 0.7);
}

.home-family-panel p:not(.home-kicker) {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 58ch;
}

.home-family-panel strong {
  color: var(--text);
}

.home-family-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.home-faq-list {
  display: grid;
  gap: 0.65rem;
  max-width: 46rem;
}

.home-faq-list details {
  border-bottom: 1px solid rgba(212, 168, 83, 0.16);
  padding: 0.35rem 0 0.85rem;
}

.home-faq-list summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  padding: 0.45rem 0;
}

.home-faq-list summary::-webkit-details-marker {
  display: none;
}

.home-faq-list details p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.home-cta-band {
  margin-top: 1rem;
  padding: clamp(3rem, 8vh, 5rem) 0;
  border-top: 1px solid rgba(212, 168, 83, 0.16);
  background: linear-gradient(180deg, rgba(212, 168, 83, 0.08), transparent);
}

.home-cta-band-inner {
  max-width: 36rem;
}

.home-cta-band h3 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.home-cta-band p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
}

.home-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
  align-items: center;
}

.home-footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
}

.home-footer a:hover {
  color: var(--gold);
}

@media (min-width: 900px) {
  .home-nav {
    display: flex;
  }

  .home-hero {
    align-items: center;
  }

  .home-hero-inner {
    max-width: 42rem;
  }

  .home-hero-falcon-img {
    right: -2%;
    width: min(58vw, 680px);
  }
}

@media (max-width: 720px) {
  .home-hero-falcon-img {
    right: -18%;
    width: min(92vw, 460px);
    opacity: 0.55;
    top: 38%;
  }

  .home-hero-falcon::after {
    background:
      linear-gradient(180deg, rgba(12, 11, 9, 0.2) 0%, rgba(12, 11, 9, 0.82) 58%, var(--bg) 100%),
      linear-gradient(90deg, rgba(12, 11, 9, 0.75) 0%, rgba(12, 11, 9, 0.35) 100%);
  }
}

@media (max-width: 900px) {
  .home-plans {
    grid-template-columns: 1fr;
  }

  .home-plan.is-dimmed {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .home-brand-mark {
    font-size: clamp(2.1rem, 11vw, 3rem);
  }

  .public-topbar-inner {
    flex-wrap: wrap;
  }
}

[data-theme="light"] body.home-product .home-brand-mark {
  background: linear-gradient(120deg, #7a5a18 0%, #9a6b1f 50%, #1f7a4f 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

[data-theme="light"] .home-hero-falcon::after {
  background:
    linear-gradient(90deg, var(--bg) 10%, rgba(245, 240, 232, 0.82) 44%, rgba(245, 240, 232, 0.25) 70%, transparent 100%),
    linear-gradient(180deg, rgba(245, 240, 232, 0.4) 0%, transparent 30%, rgba(245, 240, 232, 0.7) 100%);
}

[data-theme="light"] .home-plan {
  background: rgba(255, 252, 247, 0.9);
}

[data-theme="light"] .home-plan-featured {
  background: linear-gradient(165deg, rgba(154, 107, 31, 0.12), rgba(255, 252, 247, 0.95) 42%);
}

[data-theme="light"] .home-atmosphere-grid {
  background-image:
    linear-gradient(rgba(154, 107, 31, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(154, 107, 31, 0.07) 1px, transparent 1px);
}

/* ---- Trade Copier tree (master → slave) ---- */
.fx-tree {
  padding: 0.35rem 0.15rem 0.75rem;
}
.fx-tree-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 0.35rem;
  align-items: stretch;
  margin: 0.2rem 0;
}
.fx-tree-row.is-root {
  grid-template-columns: 0 minmax(0, 1fr);
}
.fx-tree-guide {
  position: relative;
}
.fx-tree-guide i,
.fx-tree-guide::before,
.fx-tree-guide::after {
  content: "";
  position: absolute;
  background: var(--border-strong);
}
.fx-tree-guide::before {
  left: 12px;
  top: 0;
  bottom: 0;
  width: 1px;
}
.fx-tree-guide.last::before {
  bottom: 50%;
}
.fx-tree-guide::after {
  left: 12px;
  top: 50%;
  width: 14px;
  height: 1px;
}
.fx-tree-children {
  margin-left: 28px;
  padding-left: 0;
  border-left: 1px solid var(--border-strong);
  margin-bottom: 0.55rem;
}
.fx-tree-children.is-last-branch {
  border-left-color: transparent;
}
.fx-tree-children .fx-tree-row {
  margin-left: 0;
}
.fx-tree-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  min-width: 0;
}
.fx-tree-card.owner {
  border-color: var(--border-strong);
  background: var(--hero-grad);
}
.fx-tree-card.master {
  border-color: rgba(212, 168, 83, 0.45);
  box-shadow: inset 3px 0 0 var(--gold);
}
.fx-tree-card.slave {
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: inset 3px 0 0 var(--ok);
}
.fx-tree-card.unlinked {
  box-shadow: inset 3px 0 0 var(--text-muted);
  opacity: 0.92;
}
.fx-tree-card.muted-card {
  border-style: dashed;
  color: var(--text-muted);
}
.fx-tree-card.online {
  outline: 1px solid rgba(52, 211, 153, 0.45);
}
.fx-tree-badge {
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-muted);
}
.fx-tree-badge.master {
  background: rgba(212, 168, 83, 0.18);
  color: var(--gold);
}
.fx-tree-badge.slave {
  background: var(--ok-bg);
  color: var(--ok);
}
.fx-tree-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}
.fx-tree-body strong {
  font-size: 0.95rem;
}
.fx-tree-body .mono,
.fx-tree-body .muted {
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fx-tree-body .mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--text-muted);
}
.fx-tree-status {
  flex: 0 0 auto;
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.fx-tree-status.on {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.4);
  background: var(--ok-bg);
}
.fx-tree-status.off {
  opacity: 0.8;
}

/* ---- Xalgos-inspired Trade Copier groups ---- */
.xa-copier {
  --xa-orange: #f97316;
  --xa-orange-dim: rgba(249, 115, 22, 0.18);
  --xa-dark: #101013;
  --xa-glass: rgba(255, 255, 255, 0.1);
  --xa-line: rgba(255, 255, 255, 0.28);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.xa-copier-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
.xa-kicker {
  margin: 0;
  color: var(--xa-orange);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.xa-title {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
}
.xa-head-stats {
  display: flex;
  gap: 0.45rem;
}
.xa-pill {
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--xa-orange-dim);
  color: var(--xa-orange);
  border: 1px solid rgba(249, 115, 22, 0.35);
}
.xa-pill.slave {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.35);
}
.xa-empty {
  text-align: center;
  padding: 2rem 1rem;
  border: 1px dashed rgba(249, 115, 22, 0.35);
  border-radius: 14px;
  background: rgba(16, 16, 19, 0.35);
}
.xa-empty-icon {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
  color: var(--xa-orange);
}
.xa-empty p {
  margin: 0.35rem auto 0;
  max-width: 28rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.xa-group {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #121216;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}
.xa-group-banner {
  position: relative;
  min-height: 9.5rem;
  background:
    radial-gradient(120% 90% at 12% 20%, rgba(249, 115, 22, 0.35), transparent 55%),
    linear-gradient(135deg, #1a1510 0%, #101013 45%, #0b1220 100%);
}
.xa-group-banner-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), transparent 55%);
  pointer-events: none;
}
.xa-broker-chip {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 2;
  padding: 0.28rem 0.65rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}
.xa-float-master,
.xa-float-slaves {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 10px;
  border: 1px solid var(--xa-line);
  background: var(--xa-glass);
  backdrop-filter: blur(10px);
  color: #fff;
}
.xa-float-master {
  left: 0.85rem;
  top: 3.2rem;
  padding: 0.35rem;
}
.xa-float-slaves {
  right: 0.85rem;
  bottom: 0.85rem;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}
.xa-float-slaves.is-collapsed {
  opacity: 0.75;
}
.xa-icon-master,
.xa-icon-slave {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}
.xa-icon-master {
  background: var(--xa-orange);
  color: #111;
}
.xa-icon-slave {
  background: #22c55e;
  color: #052e16;
}
.xa-group-name {
  position: absolute;
  left: 0.95rem;
  bottom: 0.85rem;
  z-index: 2;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  max-width: calc(100% - 7rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xa-group-body {
  display: none;
  padding: 0.9rem;
  background: rgba(16, 16, 19, 0.96);
}
.xa-group-body.is-open {
  display: block;
}
.xa-master-row,
.xa-slave-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.xa-master-row {
  border-color: rgba(249, 115, 22, 0.35);
  box-shadow: inset 3px 0 0 var(--xa-orange);
}
.xa-role-tag {
  display: none;
}
.xa-account-main {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex: 1;
}
.xa-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}
.xa-avatar.master {
  background: var(--xa-orange-dim);
  color: var(--xa-orange);
}
.xa-avatar.slave {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}
.xa-account-text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
.xa-account-text strong {
  font-size: 0.95rem;
  color: #fff;
}
.xa-account-text span {
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xa-online {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}
.xa-online.on {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}
.xa-slave-stack {
  margin-top: 0.85rem;
  padding-left: 0.85rem;
  border-left: 2px solid rgba(249, 115, 22, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.xa-slave-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
  padding-left: 0.15rem;
}
.xa-muted {
  color: #94a3b8;
  font-weight: 500;
}
.xa-slave-row {
  position: relative;
  margin-left: 0.35rem;
  box-shadow: inset 3px 0 0 #22c55e;
}
.xa-slave-row.is-pending {
  opacity: 0.78;
  border-style: dashed;
}
.xa-rail {
  display: none;
}
.xa-slave-empty {
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 0.55rem 0.2rem;
  font-style: italic;
}
.xa-unlinked {
  opacity: 0.9;
}
.xa-group-banner .xa-float-slaves strong {
  font-size: 0.9rem;
}
@media (max-width: 640px) {
  .xa-account-text span {
    white-space: normal;
  }
  .xa-master-row,
  .xa-slave-row {
    flex-wrap: wrap;
  }
}

/* Live onboard preview uses same tokens */
.xa-live-preview .xa-group {
  margin-top: 0.5rem;
}

/* ---- FxTruebook home (PocketFlow navy) ---- */
body.xa-home,
body.mfx-home {
  --mfx-blue: #b7791f;
  --mfx-blue-2: #8a5a12;
  --mfx-soft: rgba(183, 121, 31, 0.14);
  --xa-orange: #b7791f;
  --xa-orange-2: #8a5a12;
  --xa-dark: #09090b;
  --xa-panel: #27272a;
  --gold: #b7791f;
  --gold-dim: #8a5a12;
  --gold-glow: rgba(183, 121, 31, 0.12);
  --primary: #b7791f;
  --primary-dark: #8a5a12;
  --bg: #fafafb;
  --bg-2: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-hover: #f8fafc;
  --text: #0f172a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --mesh-1: rgba(183, 121, 31, 0.1);
  --mesh-2: rgba(245, 184, 46, 0.05);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
html[data-theme="dark"] body.xa-home,
html[data-theme="dark"] body.mfx-home {
  --bg: #09090b;
  --bg-2: #18181b;
  --surface: #27272a;
  --surface-2: rgba(39, 39, 42, 0.72);
  --surface-hover: #2f2f33;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(245, 214, 140, 0.14);
  --nav-bg: rgba(24, 24, 27, 0.92);
  --primary: #f5b82e;
  --primary-dark: #d99a12;
  --gold: #f5b82e;
  --gold-dim: #d99a12;
  --gold-glow: rgba(245, 184, 46, 0.16);
  --xa-orange: #f5b82e;
  --xa-orange-2: #d99a12;
  --xa-dark: #09090b;
  --xa-panel: #27272a;
}
body.xa-home .home-brand-mark,
body.xa-home .home-hero-title,
body.xa-home .home-section-head h3,
body.xa-home .home-plan h4,
body.xa-home .home-feature h4,
body.xa-home .home-steps h4,
body.xa-home .home-cta-band h3,
body.xa-home .home-family-panel h3,
body.xa-home .brand h1,
body.xa-home .xa-title {
  font-family: "Outfit", "Plus Jakarta Sans", system-ui, sans-serif;
}
body.xa-home .home-atmosphere,
body.xa-home .bg-mesh { display: none; }

.xa-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1100px 560px at 8% -8%, rgba(183, 121, 31, 0.16), transparent 55%),
    radial-gradient(900px 480px at 92% 8%, rgba(5, 205, 153, 0.08), transparent 50%),
    var(--bg);
}
html[data-theme="dark"] body.xa-home .xa-bg {
  background:
    radial-gradient(1100px 560px at 8% -8%, rgba(183, 121, 31, 0.2), transparent 55%),
    radial-gradient(900px 480px at 92% 8%, rgba(52, 211, 153, 0.08), transparent 50%),
    var(--bg);
}
.xa-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(183, 121, 31, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(183, 121, 31, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 78%);
  animation: xa-grid-drift 28s linear infinite;
}
html[data-theme="dark"] body.xa-home .xa-bg-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
}
@keyframes xa-grid-drift {
  from { transform: translateY(0); }
  to { transform: translateY(48px); }
}
.xa-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.5;
  animation: xa-orb-float 12s ease-in-out infinite;
}
.xa-orb-a {
  width: 360px; height: 360px;
  background: rgba(183, 121, 31, 0.35);
  top: -80px; left: -60px;
}
.xa-orb-b {
  width: 280px; height: 280px;
  background: rgba(183, 121, 31, 0.22);
  top: 30%; right: -80px;
  animation-delay: -4s;
}
.xa-orb-c {
  width: 220px; height: 220px;
  background: rgba(5, 205, 153, 0.16);
  bottom: 10%; left: 35%;
  animation-delay: -7s;
}
@keyframes xa-orb-float {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(30px,-24px,0) scale(1.08); }
}
.xa-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.xa-particles span {
  position: absolute;
  bottom: -10px;
  border-radius: 50%;
  background: var(--primary);
  animation: xa-rise linear infinite;
}
@keyframes xa-rise {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-110vh) scale(0.6); opacity: 0; }
}
.xa-chart-wave {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: min(42vh, 420px);
  opacity: 0.5;
  pointer-events: none;
}
.xa-chart-wave svg { width: 100%; height: 100%; display: block; }
.xa-wave-line {
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: xa-draw 3.2s ease forwards 0.4s, xa-pulse-line 3.5s ease-in-out infinite 3.6s;
}
.xa-wave-area { opacity: 0; animation: xa-fade-in 1.4s ease forwards 1.2s; }
@keyframes xa-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes xa-pulse-line {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(27,68,254,0)); }
  50% { filter: drop-shadow(0 0 8px rgba(27,68,254,0.45)); }
}
@keyframes xa-fade-in {
  to { opacity: 1; }
}

body.xa-home .xa-topbar {
  backdrop-filter: blur(16px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
body.xa-home .brand,
body.xa-home .brand h1,
body.xa-home .home-nav a {
  color: var(--text);
}
body.xa-home .brand small,
body.xa-home .home-nav a {
  color: var(--text-muted);
}
body.xa-home .home-nav a:hover {
  color: var(--primary);
}
body.xa-home .xa-hero {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  padding: 3.5rem 0 4rem;
}
body.xa-home .home-hero-falcon-img,
body.xa-home .mfx-hero-logo {
  filter: none;
  mix-blend-mode: normal;
  opacity: 0.9;
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(183, 121, 31, 0.22);
  animation: xa-falcon 8s ease-in-out infinite;
}
@keyframes xa-falcon {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(-12px,8px,0) scale(1.03); }
}
body.xa-home .home-hero-falcon::after,
body.xa-home .mfx-hero-mark::after {
  background:
    linear-gradient(90deg, var(--bg) 8%, color-mix(in srgb, var(--bg) 75%, transparent) 42%, transparent 78%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 35%, transparent) 0%, transparent 40%, color-mix(in srgb, var(--bg) 85%, transparent) 100%);
}
.xa-welcome-eyebrow {
  display: inline-block;
  margin: 0 0 0.65rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(90deg, #b7791f, #3b82f6);
  box-shadow: 0 0 24px rgba(183, 121, 31, 0.28);
  animation: xa-pop 0.7s cubic-bezier(.2,.9,.2,1) both;
}
.xa-brand-pulse {
  color: var(--text) !important;
  letter-spacing: 0.04em;
  animation: xa-pop 0.8s cubic-bezier(.2,.9,.2,1) 0.1s both;
}
.xa-hero-title {
  max-width: 16ch;
  color: var(--text);
}
.xa-title-line {
  display: block;
  animation: xa-slide-up 0.85s cubic-bezier(.2,.9,.2,1) both;
}
.xa-title-line:nth-child(2) { animation-delay: 0.12s; }
.xa-title-accent {
  background: linear-gradient(90deg, #b7791f, #3b82f6 55%, #05cd99);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@keyframes xa-slide-up {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes xa-pop {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.xa-forever {
  margin: 0.85rem 0 1rem;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
  text-transform: uppercase;
  animation: xa-shimmer 2.8s ease-in-out infinite;
}
@keyframes xa-shimmer {
  0%, 100% { opacity: 0.55; letter-spacing: 0.1em; }
  50% { opacity: 1; letter-spacing: 0.16em; }
}
body.xa-home .home-hero-lead {
  animation: xa-slide-up 0.9s cubic-bezier(.2,.9,.2,1) 0.2s both;
  color: var(--text-muted);
}
body.xa-home .home-hero-cta {
  animation: xa-slide-up 0.9s cubic-bezier(.2,.9,.2,1) 0.32s both;
}
.xa-btn,
body.xa-home .home-btn-primary {
  background: linear-gradient(135deg, #b7791f, #8a5a12) !important;
  border-color: transparent !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 28px rgba(183, 121, 31, 0.28);
}
.xa-btn:hover,
body.xa-home .home-btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  color: #fff !important;
}
.xa-btn-glow {
  position: relative;
}
.xa-btn-glow::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(27,68,254,0.55), transparent 60%);
  z-index: -1;
  filter: blur(12px);
  opacity: 0.75;
  animation: xa-glow 2.4s ease-in-out infinite;
}
@keyframes xa-glow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.04); }
}
.xa-hero-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
  animation: xa-slide-up 0.9s cubic-bezier(.2,.9,.2,1) 0.42s both;
}
.xa-hero-stats > div {
  min-width: 7.5rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  box-shadow: 0 8px 20px rgba(183, 121, 31, 0.06);
}
.xa-hero-stats strong {
  color: var(--primary);
  font-size: 0.95rem;
}
.xa-hero-stats span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.xa-marquee {
  overflow: hidden;
  border-block: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, var(--primary) 4%);
  padding: 0.85rem 0;
}
.xa-marquee-track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: xa-marquee 28s linear infinite;
  color: var(--text);
  font-size: 0.92rem;
}
.xa-marquee-track strong { color: var(--primary); margin-right: 0.35rem; }
@keyframes xa-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

body.xa-home .home-kicker {
  color: var(--primary);
}
body.xa-home .home-section-head h3,
body.xa-home .home-feature h4,
body.xa-home .home-steps h4,
body.xa-home .home-family-panel h3,
body.xa-home .home-cta-band h3 {
  color: var(--text);
}
body.xa-home .home-section-head p,
body.xa-home .home-feature p,
body.xa-home .home-steps p {
  color: var(--text-muted);
}
body.xa-home .xa-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform 0.35s var(--ease-smooth), border-color 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
  box-shadow: 0 2px 10px rgba(112, 126, 174, 0.05);
}
body.xa-home .home-feature.xa-card,
body.xa-home .home-plan.xa-card {
  padding: 1.25rem;
}
body.xa-home .xa-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  box-shadow: 0 18px 40px rgba(183, 121, 31, 0.12);
}
.xa-card-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 0.75rem;
  background: var(--gold-glow);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
}
body.xa-home .home-plan-featured {
  background:
    linear-gradient(160deg, rgba(27,68,254,0.12), transparent 42%),
    var(--surface);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}
body.xa-home .home-plan-badge {
  color: var(--primary);
}
body.xa-home .home-plan-tab.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
body.xa-home .home-step-num {
  color: var(--primary);
}
body.xa-home .xa-glass,
body.xa-home .home-family-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(183, 121, 31, 0.08);
}
body.xa-home .xa-cta-band {
  background:
    radial-gradient(800px 240px at 50% 0%, rgba(27,68,254,0.16), transparent 60%),
    var(--bg-2);
  border-block: 1px solid var(--border);
}
body.xa-home .home-faq-list details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  transition: border-color var(--dur-slow) var(--ease-smooth);
}
body.xa-home .home-faq-list details[open] {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}
body.xa-home .home-faq-list summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}
body.xa-home .public-footer,
body.xa-home .home-footer {
  background: transparent;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}
body.xa-home .btn-secondary {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border-strong) !important;
  box-shadow: none;
}
body.xa-home .btn-secondary:hover {
  color: var(--primary) !important;
  border-color: var(--primary) !important;
  background: var(--surface-hover) !important;
}
body.xa-home #themeToggle {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.xa-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.xa-reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

.backtest-job-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(12, 11, 9, 0.72);
  backdrop-filter: blur(8px);
  padding: 1.5rem;
}

.backtest-job-overlay[hidden] {
  display: none;
}

.backtest-job-card {
  max-width: 28rem;
  width: min(100%, 28rem);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 1.4rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.backtest-job-spinner {
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.85rem;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: backtest-spin 0.8s linear infinite;
}

.backtest-job-overlay.is-error .backtest-job-spinner {
  animation: none;
  border-top-color: var(--err);
}

.backtest-job-overlay.is-done .backtest-job-spinner {
  animation: none;
  border-top-color: var(--ok, #2f9e44);
}

.data-import-form .data-force-label {
  display: grid;
  gap: 0.45rem;
}

.data-force-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.6rem;
  font-size: 0.9rem;
}

.data-import-progress {
  margin: 0.85rem 0 0.35rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
  border: 1px solid var(--border);
}

.data-import-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--gold, #c9a227);
  transition: width 0.35s var(--ease-smooth);
}

.data-coverage-block {
  margin-top: 0.25rem;
}

.portfolio-strategy-wrap {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.55rem;
}

.portfolio-strategy-wrap.hidden,
#singleStrategyWrap.hidden {
  display: none;
}

.portfolio-strategy-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.45rem;
  max-height: 16rem;
  overflow: auto;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.portfolio-strategy-chip {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.88rem;
}

.portfolio-strategy-chip:hover {
  border-color: var(--border);
  background: var(--surface);
}

.portfolio-strategy-chip input {
  margin-top: 0.15rem;
}

.portfolio-strategy-chip span {
  display: grid;
  gap: 0.1rem;
  line-height: 1.25;
}

.portfolio-strategy-chip em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.78rem;
}

.portfolio-strategy-chip:has(input:checked) {
  border-color: var(--gold, #c9a227);
  background: color-mix(in srgb, var(--gold, #c9a227) 12%, transparent);
}

/* ── Live MT5 desk ── */
.desk-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.desk-pill.on {
  color: #1f7a3f;
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.12);
}

.desk-pill.off {
  color: var(--muted);
}

.desk-setup-steps {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.desk-setup-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.85rem;
}

.desk-inline-form {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.desk-terminal-card,
.desk-bot-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  margin-bottom: 0.65rem;
}

.desk-terminal-card.is-live {
  border-color: rgba(52, 211, 153, 0.45);
}

.desk-terminal-card header,
.desk-bot-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.desk-terminal-meta,
.desk-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem 0.85rem;
  font-size: 0.86rem;
}

.desk-terminal-meta span,
.desk-account-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.desk-key-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.75rem;
}

.desk-key-row code,
.desk-key-input {
  font-size: 0.78rem;
  word-break: break-all;
}

.desk-key-input {
  flex: 1 1 220px;
  min-width: 180px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border, #2a3344);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
}

.desk-key-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
}

.admin-content.container.live-deploy-page {
  width: min(1440px, calc(100% - 1.5rem));
}

.live-deploy-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.live-deploy-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.live-deploy-main > .panel {
  margin: 0;
}

.live-deploy-side,
body.pf-admin .live-deploy-side.panel {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: calc(var(--topbar-height, 64px) + 0.75rem);
  max-height: calc(100vh - var(--topbar-height, 64px) - 1.5rem);
  overflow: hidden;
  margin: 0;
}

.live-deploy-counts .live-deploy-summary-grid {
  margin-bottom: 0.75rem;
}

.live-deploy-rail {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-height: 8rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.live-deploy-rail-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name pnl"
    "meta pnl";
  gap: 0.1rem 0.65rem;
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.live-deploy-rail-item.is-active {
  border-color: var(--accent, #2563eb);
  box-shadow: inset 0 0 0 1px var(--accent, #2563eb);
}

.live-deploy-rail-name {
  grid-area: name;
  font-weight: 700;
  line-height: 1.25;
}

.live-deploy-rail-meta {
  grid-area: meta;
  font-size: 0.75rem;
}

.live-deploy-rail-item strong {
  grid-area: pnl;
  align-self: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .live-deploy-workspace {
    grid-template-columns: 1fr;
  }

  .live-deploy-side,
  body.pf-admin .live-deploy-side.panel {
    position: static;
    max-height: none;
    overflow: hidden;
    order: -1;
  }

  .live-deploy-rail {
    max-height: min(50vh, 22rem);
  }
}

.live-bot-sessions {
  display: grid;
  gap: 0.85rem;
}

.live-deploy-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 0.85rem;
}

.live-deploy-summary-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.live-deploy-summary-card strong {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.55rem;
  line-height: 1.1;
}

.live-deploy-summary-card em {
  font-style: normal;
  font-size: 0.78rem;
}

.live-deploy-summary-card.is-running {
  border-color: color-mix(in srgb, #2e7d32 45%, var(--border));
  background: linear-gradient(160deg, rgba(46, 125, 50, 0.12), transparent 70%),
    var(--surface-2);
}

.live-deploy-summary-card.is-waiting {
  border-color: color-mix(in srgb, #f59e0b 45%, var(--border));
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.12), transparent 70%),
    var(--surface-2);
}

.live-deploy-summary-card.is-squared {
  border-color: color-mix(in srgb, #64748b 40%, var(--border));
}

@media (max-width: 820px) {
  .live-deploy-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.live-bot-hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid color-mix(in srgb, #2e7d32 30%, var(--border));
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(46, 125, 50, 0.08), transparent 55%),
    var(--surface-2);
}

.live-bot-hud-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.live-bot-hud-value {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.05rem;
}

.live-bot-refresh-btn.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

.live-bot-empty-state {
  padding: 1.1rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
}

.live-bot-empty-state strong {
  display: block;
  margin-bottom: 0.25rem;
}

.live-bot-card {
  display: grid;
  gap: 0.75rem;
  transition: border-color var(--dur-base) var(--ease-smooth), box-shadow var(--dur-base) var(--ease-smooth), transform var(--dur-base) var(--ease-smooth);
}

.live-bot-card.is-running {
  border-color: color-mix(in srgb, #2e7d32 45%, var(--border));
  box-shadow: 0 0 0 1px rgba(46, 125, 50, 0.12);
}

.live-bot-card:hover {
  transform: translateY(-1px);
}

.live-bot-card-meta {
  margin-top: 0.2rem;
  font-size: 0.74rem;
}

.live-bot-mismatch-banner {
  margin: 0.55rem 0 0.35rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
  font-size: 0.86rem;
  line-height: 1.45;
}
.live-bot-mismatch-banner strong {
  font-weight: 650;
}
.live-bot-reset-form {
  display: inline-flex;
  margin: 0;
}
.live-bot-reset-btn {
  white-space: nowrap;
}
.live-bot-reset-form.is-resetting .live-bot-reset-btn {
  opacity: 0.7;
}
.live-bot-history-note.is-mismatch {
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.06);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
}

.live-bot-header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.live-bot-pulse {
  position: relative;
}

.live-bot-pulse::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -0.55rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #34d399;
  transform: translateY(-50%);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  animation: live-bot-pulse 1.6s ease-out infinite;
}

@keyframes live-bot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.live-bot-legs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.live-bot-card.is-waiting {
  border-color: color-mix(in srgb, var(--gold, #c9a227) 40%, var(--border));
}

.live-bot-card.is-squared {
  border-color: color-mix(in srgb, #f59e0b 45%, var(--border));
}

.live-bot-board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.35rem 0 0.85rem;
}

.live-bot-board-count {
  margin-left: auto;
  font-size: 0.82rem;
}

.live-bot-card-compact header {
  align-items: flex-start;
}

.live-bot-card-compact .live-bot-card-meta {
  margin-top: 0.2rem;
  font-size: 0.8rem;
}

.live-bot-pnl-compact {
  margin-top: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(7.2rem, 1fr));
}

.live-bot-pnl-compact .paper-pnl-card {
  min-width: 5.5rem;
}

.live-bot-bridge-details {
  margin-top: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.75rem 0.55rem;
  background: color-mix(in srgb, var(--input-bg) 92%, transparent);
}

.live-bot-bridge-details > summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted, #8a8794);
  padding: 0.35rem 0;
  list-style: none;
}

.live-bot-bridge-details > summary::-webkit-details-marker {
  display: none;
}

.live-bot-bridge-details[open] > summary {
  margin-bottom: 0.35rem;
  color: inherit;
}

.live-bot-history-card.is-waiting {
  border-color: color-mix(in srgb, var(--gold, #c9a227) 40%, var(--border));
}

.live-bot-stop-banner {
  margin: 0.55rem 0 0.15rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.84rem;
  line-height: 1.4;
}

.live-bot-stop-banner.is-restart {
  border-color: color-mix(in srgb, var(--gold, #c9a227) 55%, var(--border));
  background: color-mix(in srgb, var(--gold, #c9a227) 12%, transparent);
}

.live-bot-stop-banner.is-final {
  border-color: color-mix(in srgb, #c62828 45%, var(--border));
  background: color-mix(in srgb, #c62828 10%, transparent);
}

.live-bot-history-note.is-restart {
  color: inherit;
}

.live-bot-history-note.is-final {
  color: #b71c1c;
}

.live-bot-signals {
  margin: 0.55rem 0 0.15rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--input-bg) 88%, transparent);
}

.live-bot-signals-head {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #8a8794);
  margin-bottom: 0.35rem;
}

.live-bot-signals-levels {
  font-size: 0.86rem;
  font-weight: 600;
}

.live-bot-signals-bar {
  font-size: 0.74rem;
  margin: 0.2rem 0 0.45rem;
}

.live-bot-signals-empty {
  margin: 0;
  font-size: 0.8rem;
}

.live-bot-signal-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.28rem 0.4rem;
  margin-top: 0.2rem;
  border-radius: 8px;
  border-left: 3px solid var(--border);
}

.live-bot-signal-row strong {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

.live-bot-signal-row.is-hot {
  border-left-color: #2e7d32;
  background: color-mix(in srgb, #2e7d32 10%, transparent);
}

.live-bot-signal-row.is-armed {
  border-left-color: var(--gold, #c9a227);
  background: color-mix(in srgb, var(--gold, #c9a227) 12%, transparent);
}

.live-bot-signal-row.is-watch {
  border-left-color: color-mix(in srgb, var(--border) 80%, #888);
}

.live-bot-signal-row.is-stopped {
  border-left-color: #c62828;
  background: color-mix(in srgb, #c62828 10%, transparent);
}

.live-bot-leg-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: inherit;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-smooth), transform var(--dur-fast) var(--ease-smooth);
}

.live-bot-leg-chip:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
}

.live-bot-leg-chip.buy {
  border-color: color-mix(in srgb, #2e7d32 45%, var(--border));
}

.live-bot-leg-chip.sell {
  border-color: color-mix(in srgb, #c62828 45%, var(--border));
}

.live-bot-leg-side {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.live-bot-side-chip {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.live-bot-side-buy { color: #2e7d32; }
.live-bot-side-sell { color: #c62828; }

.live-bot-open-badge {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.16);
  color: var(--gold);
  font-size: 0.65rem;
  font-weight: 700;
}

.live-bot-pnl .paper-pnl-card {
  transition: background var(--dur-slow) var(--ease-smooth), transform var(--dur-slow) var(--ease-smooth);
}

.live-bot-ltp-card {
  position: relative;
}

.live-bot-ltp-source {
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.live-bot-pnl .paper-pnl-card.is-flash-up {
  animation: live-bot-flash-up 0.7s ease;
}

.live-bot-pnl .paper-pnl-card.is-flash-down {
  animation: live-bot-flash-down 0.7s ease;
}

@keyframes live-bot-flash-up {
  0% { background: rgba(46, 125, 50, 0.28); transform: scale(1.02); }
  100% { background: transparent; transform: scale(1); }
}

@keyframes live-bot-flash-down {
  0% { background: rgba(198, 40, 40, 0.22); transform: scale(1.02); }
  100% { background: transparent; transform: scale(1); }
}

.live-bot-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--input-bg);
  overflow: hidden;
}

.live-bot-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.live-bot-section-toggle:hover {
  background: rgba(255, 255, 255, 0.03);
}

.live-bot-section-chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform var(--dur-base) var(--ease-smooth);
  flex: 0 0 auto;
}

.live-bot-section.is-open .live-bot-section-chevron {
  transform: rotate(45deg);
}

.live-bot-section-count {
  margin-left: auto;
  font-size: 0.75rem;
}

.live-bot-section-body {
  padding: 0 0.75rem 0.75rem;
  border-top: 1px solid var(--border);
}

.live-bot-deploy-bar.is-deploying,
.live-bot-stop-form.is-stopping {
  opacity: 0.75;
  pointer-events: none;
}

.live-bot-deploy-bar {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.live-bot-deploy-btn {
  background: #1b5e20;
  border-color: #145218;
  color: #fff;
  font-weight: 600;
}

.live-bot-deploy-btn:hover {
  background: #145218;
  filter: none;
}

.live-bot-history-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}

.live-bot-history-search {
  width: min(16rem, 100%);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
}

.live-bot-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: min(26rem, 58vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.live-bot-history-card:not(.is-expanded) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 0.15rem 0.55rem;
}

.live-bot-history-card:not(.is-expanded) .live-bot-history-card-top {
  align-items: center;
  padding: 0.2rem 0.05rem;
}

.live-bot-history-card:not(.is-expanded) .live-bot-history-stop {
  grid-column: 2;
  grid-row: 1;
  margin: 0 0 0 0.4rem;
}

.live-bot-history-pnl {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.live-bot-history-filters {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.live-bot-filter-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.live-bot-filter-btn.is-active {
  border-color: #2e7d32;
  color: #2e7d32;
}

.live-bot-history-card {
  border: 1px solid color-mix(in srgb, #2e7d32 28%, var(--border));
  border-radius: 14px;
  padding: 0.55rem 0.75rem 0.75rem;
  background: var(--input-bg);
  transition: border-color var(--dur-fast) var(--ease-smooth), box-shadow var(--dur-fast) var(--ease-smooth);
}

.live-bot-history-card.is-live {
  border-color: color-mix(in srgb, #2e7d32 55%, var(--border));
}

.live-bot-history-stop {
  display: flex;
  justify-content: flex-end;
  margin: 0.15rem 0 0.35rem;
}

.live-bot-history-card.is-expanded {
  box-shadow: 0 0 0 1px rgba(46, 125, 50, 0.18);
}

.live-bot-history-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.15rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.live-bot-history-card-top:hover .live-bot-history-title {
  color: var(--gold);
}

.live-bot-history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  margin: 0.15rem 0 0.45rem;
  padding: 0 0.15rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.live-bot-history-chevron {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform var(--dur-base) var(--ease-smooth);
  margin-top: 0.35rem;
}

.live-bot-history-card.is-expanded .live-bot-history-chevron {
  transform: rotate(45deg);
}

.live-bot-history-details {
  margin-top: 0.35rem;
}

.live-bot-history-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.live-bot-history-meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.live-bot-history-badges {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
}

.live-bot-history-trades {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.live-bot-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.live-bot-history-field {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: var(--surface-2);
}

.live-bot-history-field span {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.live-bot-history-field strong {
  font-size: 0.84rem;
  font-family: "JetBrains Mono", monospace;
}

.live-bot-history-note {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: var(--surface-2);
}

.live-bot-hist-error {
  color: var(--err);
}

.live-bot-history-orders {
  margin: 0.55rem 0 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.live-bot-history-orders h5 {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.live-bot-empty-hint {
  margin: 0.35rem 0;
}

.live-bot-stop-form {
  margin: 0;
}

.live-bot-stop-btn,
button.live-bot-stop-btn {
  background: #c62828;
  border-color: #b71c1c;
  color: #fff;
  font-weight: 600;
}

.live-bot-stop-btn:hover,
button.live-bot-stop-btn:hover {
  background: #b71c1c;
  border-color: #8e0000;
  filter: none;
}

body.live-confirm-open {
  overflow: hidden;
}

.live-confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.live-confirm-dialog[hidden] {
  display: none !important;
}

.live-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, 0.62);
  backdrop-filter: blur(2px);
}

.live-confirm-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  border-radius: 16px;
  border: 1px solid var(--border, #2a3344);
  background: var(--surface-2, #151b27);
  padding: 1.1rem 1.15rem 1.15rem;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  animation: live-confirm-in 0.18s ease-out;
}

@keyframes live-confirm-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.live-confirm-badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.55rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #9aa4b2);
}

.live-confirm-dialog.is-danger .live-confirm-badge {
  background: rgba(198, 40, 40, 0.18);
  color: #ef9a9a;
}

.live-confirm-dialog.is-warn .live-confirm-badge {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

.live-confirm-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  line-height: 1.35;
}

.live-confirm-body {
  margin: 0;
  color: var(--text-muted, #9aa4b2);
  font-size: 0.9rem;
  line-height: 1.45;
}

.live-confirm-points {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem 0.65rem 1.35rem;
  border-radius: 10px;
  border: 1px solid var(--border, #2a3344);
  background: rgba(0, 0, 0, 0.18);
  color: inherit;
  font-size: 0.84rem;
  line-height: 1.45;
}

.live-confirm-dialog.is-danger .live-confirm-points {
  border-color: rgba(198, 40, 40, 0.35);
  background: rgba(198, 40, 40, 0.08);
}

.live-confirm-step {
  margin: 0.7rem 0 0;
  font-size: 0.78rem;
}

.live-confirm-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.live-confirm-danger-btn,
button.live-confirm-danger-btn {
  background: #c62828;
  border-color: #b71c1c;
  color: #fff;
  font-weight: 650;
}

.live-confirm-danger-btn:hover,
button.live-confirm-danger-btn:hover {
  background: #b71c1c;
  border-color: #8e0000;
}

.live-confirm-primary-btn,
button.live-confirm-primary-btn {
  font-weight: 650;
}

.live-confirm-dialog.is-step2 .live-confirm-card {
  border-color: rgba(198, 40, 40, 0.45);
}

.live-bot-pnl {
  margin: 0;
}

.live-bot-config {
  margin-top: 0.15rem;
}

.live-bot-section-title {
  margin: 0.35rem 0 0.25rem;
  font-size: 0.92rem;
}

.live-bot-empty {
  margin: 0.2rem 0 0.45rem;
  font-size: 0.84rem;
}

.live-bot-table {
  margin-bottom: 0.35rem;
}

.live-bot-log {
  max-height: 220px;
  overflow: auto;
  margin: 0;
}

.live-bot-trade-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  align-items: center;
  margin: 0.2rem 0 0.55rem;
}

.live-bot-filter-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.live-bot-search {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.live-bot-search input {
  min-width: 180px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border, #2a3344);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
  color: inherit;
}

.live-bot-trade-count {
  font-size: 0.8rem;
}

.live-bot-sub,
.live-bot-comment {
  font-size: 0.75rem;
  line-height: 1.35;
  margin-top: 0.15rem;
  max-width: 28rem;
  white-space: normal;
}

.live-bot-reason {
  font-weight: 600;
}

.live-bot-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted, #9aa4b2);
}

.live-bot-filter-btn.is-active .live-bot-filter-count {
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
}

.live-bot-sort-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  padding: 0.15rem 0.2rem;
  margin: -0.15rem -0.2rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.live-bot-sort-btn:hover,
.live-bot-sort-btn.is-active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #e8edf5);
}

.live-bot-row-expand {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted, #9aa4b2);
  font: inherit;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.1rem 0.25rem;
  margin-right: 0.15rem;
  border-radius: 4px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-smooth), color var(--dur-fast) var(--ease-smooth);
}

.live-bot-trade-row.is-expanded .live-bot-row-expand {
  transform: rotate(90deg);
  color: inherit;
}

.live-bot-trade-row {
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-smooth);
}

.live-bot-trade-row:hover,
.live-bot-trade-row:focus-visible {
  background: rgba(255, 255, 255, 0.03);
  outline: none;
}

.live-bot-trade-row.is-expanded {
  background: rgba(255, 255, 255, 0.04);
}

.live-bot-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.live-bot-mini-btn {
  appearance: none;
  border: 1px solid var(--border, #2a3344);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
}

.live-bot-mini-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

.live-bot-mini-btn.is-copied {
  border-color: rgba(46, 125, 50, 0.55);
  background: rgba(46, 125, 50, 0.18);
  color: #9be7a0;
}

.live-bot-clear-filters {
  border-color: rgba(192, 57, 43, 0.45);
}

.live-bot-trade-detail td {
  background: rgba(0, 0, 0, 0.18);
  border-top: 0;
  padding-top: 0.55rem;
  padding-bottom: 0.75rem;
}

.live-bot-trade-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem 0.85rem;
}

.live-bot-trade-detail-grid > div {
  display: flex;
    flex-direction: column;
  gap: 0.15rem;
}

.live-bot-trade-detail-grid span {
  font-size: 0.72rem;
  color: var(--muted, #9aa4b2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.live-bot-trade-detail-grid strong {
  font-size: 0.86rem;
  font-weight: 650;
  word-break: break-word;
}

@media (max-width: 720px) {
  .live-bot-search {
    margin-left: 0;
    width: 100%;
  }

  .live-bot-search input {
    flex: 1;
    min-width: 0;
  }
}

.desk-bot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 0.65rem;
}

.desk-bot-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.desk-danger {
  color: var(--err, #c0392b) !important;
}

.desk-pos-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.desk-close-btn,
.desk-copy-btn {
  appearance: none;
  border: 1px solid var(--border, #2a3344);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  padding: 0.28rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.2;
}

.desk-close-btn:hover,
.desk-copy-btn:hover {
  background: rgba(255, 255, 255, 0.09);
}

.desk-close-btn {
  border-color: rgba(192, 57, 43, 0.5);
  color: #e57373;
}

.desk-close-btn:hover {
  background: rgba(192, 57, 43, 0.16);
}

.desk-close-btn.is-busy {
  opacity: 0.65;
  pointer-events: none;
}

.desk-position-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.desk-event,
.desk-command {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.desk-commands-wrap {
  margin-top: 0.85rem;
}

@media (max-width: 800px) {
  .desk-setup-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Live Trade desk (mt5-bots-with-ui format) ── */
body.desk-trade-body .admin-footer { display: none; }
body.desk-trade-body .desk-trade-content {
  max-width: none;
  width: 100%;
  padding: 0.35rem 0.55rem 0.55rem;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 4.5rem);
  overflow: hidden;
}
body.desk-chart-full .app-sidebar,
body.desk-chart-full .admin-topbar,
body.desk-chart-full .sidebar-backdrop { display: none !important; }
body.desk-chart-full .app-shell { margin: 0; }
body.desk-chart-full .desk-trade-content {
  padding: 0;
  min-height: 100vh;
  height: 100dvh;
}

.desk-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow: hidden;
}
.desk-page.chart-full {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 0;
  background: var(--bg, var(--surface));
}
.desk-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
}
.desk-acct-metrics {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.desk-acct-metrics span {
  display: grid;
  gap: 0.1rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.desk-acct-metrics b {
  color: var(--text);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  text-transform: none;
  letter-spacing: 0;
}
.desk-banner {
  margin: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-size: 0.86rem;
}
.desk-banner.warn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #b45309;
}
.desk-banner.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--err, #c0392b);
}

.desk-terminal {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 280px;
  grid-template-rows: minmax(0, 1fr) minmax(160px, 28vh);
  gap: 0.5rem;
}
.desk-terminal > .desk-watch { grid-column: 1; grid-row: 1; }
.desk-terminal > .desk-stage { grid-column: 2; grid-row: 1; }
.desk-terminal > .desk-ticket-card { grid-column: 3; grid-row: 1; }
.desk-terminal > .desk-dock { grid-column: 1 / -1; grid-row: 2; }
.desk-terminal.hide-ticket { grid-template-columns: 220px minmax(0, 1fr); }
.desk-terminal.hide-ticket > .desk-ticket-card { display: none; }
.desk-terminal.hide-dock { grid-template-rows: minmax(0, 1fr); }
.desk-terminal.hide-dock > .desk-dock { display: none; }
.desk-page.chart-full .desk-top,
.desk-page.chart-full .desk-banner,
.desk-page.chart-full .desk-watch,
.desk-page.chart-full .desk-dock { display: none; }
.desk-page.chart-full .desk-terminal {
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  gap: 0;
}
.desk-page.chart-full .desk-terminal.hide-ticket { grid-template-columns: minmax(0, 1fr); }
.desk-page.chart-full .desk-stage {
  grid-column: 1;
  grid-row: 1;
  border-radius: 0;
  border: 0;
}
.desk-page.chart-full .desk-ticket-card {
  grid-column: 2;
  grid-row: 1;
  border-radius: 0;
}

.desk-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.desk-watch { padding: 0.65rem 0 0; }
.desk-watch-head { padding: 0 0.65rem 0.5rem; }
.desk-watch-head h2 {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.desk-watch-head input { width: 100%; margin-top: 0.45rem; }
.desk-watch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
}
.desk-watch-list li {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--border);
}
.desk-watch-row {
  flex: 1;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.desk-watch-row strong { display: block; font-size: 0.86rem; letter-spacing: 0.04em; }
.desk-watch-row small { color: var(--muted); font-size: 0.72rem; }
.desk-watch-row.on { background: color-mix(in srgb, var(--gold, #c9a227) 12%, transparent); }
.desk-watch-px { font-variant-numeric: tabular-nums; font-size: 0.84rem; }
.desk-watch-remove,
.desk-watch-add {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.desk-watch-remove { width: 28px; font-size: 1rem; }
.desk-watch-add {
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  color: var(--gold, #c9a227);
  font-weight: 600;
}

.desk-stage { padding: 0; }
.desk-chart-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "legend side"
    "frames toggles";
  align-items: center;
  gap: 0.15rem 0.75rem;
  padding: 0.45rem 0.65rem 0.3rem;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.desk-chart-legend { grid-area: legend; min-width: 0; }
.desk-chart-legend h2 {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.desk-chart-legend p { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.75rem; }
.desk-chart-ohlc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.2rem !important;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.desk-chart-ohlc.buy { color: #1f7a3f; }
.desk-chart-ohlc.sell { color: #c0392b; }
.desk-chart-ohlc em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
  margin-right: 0.15rem;
}
.desk-chart-side {
  grid-area: side;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.85rem;
}
.desk-chart-price {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.desk-chart-price.live { color: #1f7a3f; }
.desk-chart-price.muted { color: var(--muted); }
.desk-chart-pnl {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}
.desk-chart-pnl span {
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.desk-chart-pnl.buy strong { color: #1f7a3f; }
.desk-chart-pnl.sell strong { color: #c0392b; }
.desk-frames {
  grid-area: frames;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  overflow-x: auto;
  min-width: 0;
}
.desk-frame {
  padding: 0.25rem 0.5rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.desk-frame.on {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--gold, #c9a227);
}
.desk-panel-toggles {
  grid-area: toggles;
  display: flex;
  gap: 0.25rem;
  justify-self: end;
}
.desk-panel-toggles button,
.desk-panel-hide {
  padding: 0.25rem 0.55rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.desk-panel-toggles button[aria-pressed="true"] {
  background: var(--surface-2, rgba(127,127,127,0.12));
  color: var(--text);
}
.desk-chart-host {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.desk-chart-pane {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
}
.desk-chart {
  width: 100%;
  height: 100%;
  min-height: 280px;
}

.desk-ticket-card { padding: 0.55rem 0.65rem 0.65rem; }
.desk-ticket-scroll { overflow: auto; flex: 1; min-height: 0; }
.desk-ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.desk-ticket-head h2 { margin: 0; font-size: 0.95rem; }
.desk-type-switch,
.desk-lot-chips,
.desk-unit-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}
.desk-type-switch { grid-template-columns: 1fr 1fr; }
.desk-chip {
  padding: 0.3rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.desk-chip.on {
  border-color: var(--gold, #c9a227);
  color: var(--text);
  background: color-mix(in srgb, var(--gold, #c9a227) 12%, transparent);
}
.desk-quote-strip {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: var(--surface-2, rgba(127,127,127,0.08));
}
.desk-quote-strip span {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.desk-quote-strip strong {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.desk-order-fields {
  display: grid;
  gap: 0.45rem;
}
.desk-order-fields label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.desk-order-fields input {
  width: 100%;
  padding: 0.4rem 0.5rem;
}
.desk-volume-line {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.desk-price-step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  gap: 0.25rem;
}
.desk-price-step button {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2, transparent);
  color: var(--text);
  cursor: pointer;
}
.desk-risk-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.desk-trade-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.55rem;
  flex: 0 0 auto;
}
.desk-buy-btn,
.desk-sell-btn {
  display: grid;
  gap: 0.1rem;
  padding: 0.55rem 0.4rem;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.desk-buy-btn { background: #00a86b; }
.desk-sell-btn { background: #e74c3c; }
.desk-buy-btn small,
.desk-sell-btn small {
  font-weight: 500;
  opacity: 0.9;
}

.desk-dock { padding: 0.55rem 0.7rem 0.65rem; }
.desk-dock-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.desk-dock-tabs { display: flex; gap: 0.25rem; }
.desk-dock-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  font-weight: 600;
  cursor: pointer;
}
.desk-dock-tabs button.on {
  background: var(--gold, #c9a227);
  color: #111;
}
.desk-dock-pnl {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.desk-dock-pnl span {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.desk-dock-pnl strong { font-variant-numeric: tabular-nums; }
.desk-dock-pnl.buy { color: #1f7a3f; }
.desk-dock-pnl.sell { color: #c0392b; }
.desk-exit-btn {
  border: 0;
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  background: rgba(192, 57, 43, 0.2);
  color: #c0392b;
  font-weight: 700;
  cursor: pointer;
}
.desk-dock-body { overflow: auto; flex: 1; min-height: 0; padding-top: 0.45rem; }

@media (max-width: 1100px) {
  .desk-terminal {
    grid-template-columns: 180px minmax(0, 1fr);
    grid-template-rows: minmax(240px, 1fr) auto auto;
  }
  .desk-terminal > .desk-watch { grid-column: 1; grid-row: 1; }
  .desk-terminal > .desk-stage { grid-column: 2; grid-row: 1; }
  .desk-terminal > .desk-ticket-card { grid-column: 1 / -1; grid-row: 2; max-height: 280px; }
  .desk-terminal > .desk-dock { grid-column: 1 / -1; grid-row: 3; }
  .desk-terminal.hide-ticket { grid-template-columns: 180px minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .desk-terminal {
    grid-template-columns: 1fr;
    grid-template-rows: 160px minmax(260px, 1fr) auto auto;
  }
  .desk-terminal > .desk-watch,
  .desk-terminal > .desk-stage,
  .desk-terminal > .desk-ticket-card,
  .desk-terminal > .desk-dock { grid-column: 1; }
  .desk-terminal > .desk-watch { grid-row: 1; }
  .desk-terminal > .desk-stage { grid-row: 2; }
  .desk-terminal > .desk-ticket-card { grid-row: 3; }
  .desk-terminal > .desk-dock { grid-row: 4; }
}

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

@media (prefers-reduced-motion: reduce) {
  .xa-orb, .xa-particles span, .xa-marquee-track, .xa-wave-line,
  .xa-btn-glow::after, .xa-forever, .home-hero-falcon-img, .xa-bg-grid {
    animation: none !important;
  }
  .xa-reveal { opacity: 1; transform: none; }
}

/* ── Algorooms-style strategy builder ── */
.algo-builder-panel {
  max-width: 100%;
  margin: 0 auto;
  padding-bottom: 5.5rem;
  overflow-x: clip;
}

.algo-section,
.algo-legs .custom-leg-card,
.panel {
  transition: box-shadow var(--dur-base) var(--ease-smooth), border-color var(--dur-base) var(--ease-smooth), transform var(--dur-base) var(--ease-smooth);
}

.algo-section:hover,
.algo-legs .custom-leg-card:hover {
  box-shadow: 0 10px 24px rgba(183, 121, 31, 0.08);
  border-color: #d7def2;
}

.strategy-form.algo-builder {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.algo-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.algo-top-grid {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
}

.algo-section {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.05rem 1.1rem;
  background: var(--surface-2);
}

.algo-section-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.algo-section-sub {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.algo-mt {
  margin-top: 0.85rem;
}

.algo-mt-xs {
  margin-top: 0.35rem;
}

.algo-inline-hint {
  margin: 0.35rem 0 0;
}

.algo-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.algo-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.algo-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.algo-section-head .algo-section-title {
  margin: 0;
}

.algo-type-list {
  display: grid;
  gap: 0.15rem;
}

.algo-type-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}

.algo-type-option:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.algo-type-option.is-active {
  background: var(--gold-glow);
  border-color: var(--border-strong);
}

.algo-check {
  width: 1.05rem;
  height: 1.05rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  flex: 0 0 auto;
  background: var(--surface);
  position: relative;
}

.algo-type-option.is-active .algo-check {
  border-color: var(--primary);
  background: var(--primary);
}

.algo-type-option.is-active .algo-check::after {
  content: "";
  position: absolute;
  left: 0.28rem;
  top: 0.08rem;
  width: 0.28rem;
  height: 0.55rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.algo-type-copy {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.algo-type-option.is-active .algo-type-copy {
  color: var(--text);
  font-weight: 600;
}

.algo-underlying-box {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcff;
}

.algo-more {
  margin-top: 0.85rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.55rem;
}

.algo-more > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-muted);
  user-select: none;
}

.algo-more > summary::-webkit-details-marker {
  display: none;
}

.algo-more > summary::before {
  content: "+ ";
  color: #b7791f;
}

.algo-more[open] > summary::before {
  content: "− ";
}

.algo-more-body {
  margin-top: 0.7rem;
}

.algo-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
}

.algo-radio-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.86rem;
  color: #334155;
  cursor: pointer;
}

.algo-radio-item input {
  accent-color: #b7791f;
}

.algo-trade-row {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.7rem 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
}

@media (min-width: 980px) {
  .algo-trade-row {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.55fr) minmax(0, 1.25fr) minmax(0, 1.25fr);
  }
}

.algo-trade-row > * {
  min-width: 0;
}

.algo-exit-line {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.4rem;
  align-items: center;
  width: 100%;
}

.algo-exit-line > select,
.algo-exit-line .wait-input-row {
  width: 100%;
  min-width: 0;
}

.algo-exit-line .wait-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem;
}

.algo-exit-line .wait-input-row input,
.algo-exit-line .wait-input-row select {
  width: 100%;
  min-width: 0;
}

.algo-chip-row {
  max-width: 100%;
}

.algo-symbol-chips {
  flex-wrap: wrap;
  gap: 0.4rem;
}

.algo-chip span,
.algo-chip-btn {
  white-space: nowrap;
}

.strategy-view-panel {
  margin-top: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.strategy-view-panel h3 { margin: 0.1rem 0 0; }
.strategy-view-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}
.strategy-view-groups section {
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  background: var(--bg);
}
.strategy-view-groups h4 {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
}
.strategy-view-groups dl { margin: 0; }
.strategy-view-groups dl div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  padding: 0.28rem 0;
  border-top: 1px solid var(--border);
}
.strategy-view-groups dt {
  color: var(--text-muted);
  font-size: 0.78rem;
}
.strategy-view-groups dd {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  text-align: right;
}
.strategy-view-banner {
  margin: 0 0 0.8rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: #e7f1ff;
  color: #b7791f;
  font-size: 0.88rem;
  font-weight: 650;
}
form.is-view-only .algo-type-option,
form.is-view-only .algo-chip-btn,
form.is-view-only .algo-primary-btn {
  pointer-events: none;
}

.algo-create-bar {
  position: fixed;
  left: calc(var(--sidebar-current-width) + 1rem);
  right: 1rem;
  bottom: 0.85rem;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  max-width: calc(100vw - var(--sidebar-current-width) - 2rem);
  margin: 0 auto;
  box-sizing: border-box;
  background: var(--nav-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.algo-create-btn {
  flex: 1 1 220px;
  max-width: 420px;
  min-width: 0;
  min-height: 2.9rem;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 10px 28px var(--gold-glow);
  transition: filter var(--dur-fast), box-shadow var(--dur-fast);
}

.algo-create-btn:hover {
  filter: brightness(1.06);
  transform: none;
  color: #fff;
  box-shadow: 0 12px 30px var(--gold-glow);
}

.algo-deploy-btn {
  flex: 0 1 auto;
  min-height: 2.9rem;
  padding: 0 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}

.algo-deploy-btn:hover {
  transform: none;
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface-hover);
}

.algo-cancel-link,
.algo-cancel-btn {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
  padding: 0.55rem 0.85rem;
  min-height: 2.9rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

a.algo-cancel-btn.btn.btn-secondary {
  box-shadow: none;
}

.algo-feed-mini {
  flex: 0 1 10rem;
  min-width: 0;
  margin: 0;
  display: grid;
  gap: 0.2rem;
}

.algo-feed-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.algo-feed-mini select {
  width: 100%;
  min-height: 2.5rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--text);
}

.algo-snapshot-inline {
  margin-top: 0.75rem;
}

.algo-name-field input {
  min-height: 2.75rem;
  font-size: 0.95rem;
}

.algo-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  font-weight: 500;
}

.algo-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.algo-hint {
  display: block;
  font-size: 0.72rem;
  line-height: 1.35;
  font-weight: 500;
}

.algo-grid {
  display: grid;
  gap: 0.75rem 0.85rem;
}

.algo-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.algo-field-row,
.algo-name-row {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.algo-field-row-tight {
  margin-top: 0.85rem;
}

.algo-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.algo-chip {
  margin: 0;
  display: inline-flex;
}

.algo-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.algo-chip span,
.algo-chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
}

.algo-chip-btn {
  font-family: inherit;
}

.algo-chip span:hover,
.algo-chip-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.algo-chip input:checked + span,
.algo-chip-btn.is-active {
  border-color: var(--primary);
  background: var(--gold-glow);
  color: var(--primary);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.algo-chip-btn:focus-visible,
.algo-type-option:focus-visible,
.algo-side-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.algo-primary-btn,
.btn.algo-primary-btn {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.algo-primary-btn:hover,
.btn.algo-primary-btn:hover {
  filter: brightness(1.08);
  color: #fff;
}

.algo-legs .custom-leg-card {
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
}

.algo-legs .custom-leg-card-head {
  margin: 0;
  padding: 0.85rem 1rem;
  border-bottom: 1px dashed var(--border);
  background: rgba(59, 130, 246, 0.05);
}

.algo-legs .algo-leg-grid {
  padding: 0.8rem 0.9rem 0.95rem;
  gap: 0.7rem 0.75rem;
}

.algo-legs .style-confirm-block {
  margin: 0;
}

.algo-legs .algo-entry-box {
  padding: 0.7rem 0.75rem 0.8rem;
}

.algo-legs .leg-more {
  grid-column: 1 / -1;
}

.algo-leg-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.buy-leg-card .algo-leg-pill {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
}

.sell-leg-card .algo-leg-pill {
  background: rgba(248, 113, 113, 0.16);
  color: #f87171;
}

.algo-side-toggle {
  display: flex;
  gap: 0.4rem;
}

.algo-side-btn {
  flex: 1;
  min-height: 2.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 750;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
}

.algo-side-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.algo-side-btn.buy.is-active {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}

.algo-side-btn.sell.is-active {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

.algo-name-section .builder-snapshot {
  margin: 0;
  height: 100%;
}

.algo-builder .type-cards,
.algo-builder .builder-type-wrap {
  display: contents;
}

.algo-builder .type-card:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
}

@media (max-width: 980px) {
  .algo-top-grid {
    grid-template-columns: 1fr;
  }

  .algo-create-bar {
    left: 0.75rem;
    right: 0.75rem;
    max-width: calc(100vw - 1.5rem);
  }
}

@media (max-width: 720px) {
  .algo-section-head {
    align-items: flex-start;
  }

  .algo-trade-row {
    grid-template-columns: 1fr;
  }

  .algo-create-bar {
    position: static;
    flex-wrap: wrap;
    max-width: 100%;
    margin-top: 0.75rem;
    box-shadow: 0 4px 14px rgba(183, 121, 31, 0.08);
  }

  .algo-create-btn,
  .algo-deploy-btn,
  .algo-feed-mini {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .algo-builder-panel {
    padding-bottom: 1rem;
  }

  .topbar-logo {
    display: none;
  }
}

/* ── Algorooms theme polish (strategy builder page only) ── */
body:has(.algo-builder-panel) {
  --algo-blue: var(--primary);
  --algo-blue-soft: var(--gold-glow);
  --algo-blue-border: var(--primary);
  --algo-bg: var(--bg);
  --algo-card: var(--surface);
  --algo-text: var(--text);
  --algo-muted: var(--text-muted);
  --algo-border: var(--border);
  --algo-input: var(--input-bg);
  font-family: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
}

html[data-theme="light"] body:has(.algo-builder-panel) {
  --algo-blue: #b7791f;
  --algo-blue-soft: rgba(183, 121, 31, 0.1);
  --algo-blue-border: #93aaff;
  --algo-bg: #f4f7fe;
  --algo-card: #ffffff;
  --algo-text: #1b2559;
  --algo-muted: #707eae;
  --algo-border: #e9edf7;
  --algo-input: #ffffff;
  --bg: var(--algo-bg);
  --bg-2: #eef2fb;
  --surface: var(--algo-card);
  --surface-2: var(--algo-card);
  --surface-hover: #f8faff;
  --text: var(--algo-text);
  --text-muted: var(--algo-muted);
  --primary: var(--algo-blue);
  --primary-dark: #8a5a12;
  --gold: var(--algo-blue);
  --gold-dim: #8a5a12;
  --gold-glow: rgba(183, 121, 31, 0.18);
  --border: var(--algo-border);
  --border-strong: #d5ddf0;
  --shadow: 0 8px 24px rgba(183, 121, 31, 0.06);
  --input-bg: var(--algo-input);
  --nav-bg: rgba(255, 255, 255, 0.92);
  --mesh-1: transparent;
  --mesh-2: transparent;
  --mesh-3: transparent;
  background: var(--algo-bg);
  color: var(--algo-text);
}

body:has(.algo-builder-panel) .bg-mesh,
body:has(.algo-builder-panel) .bg-orb {
  display: none !important;
}

body:has(.algo-builder-panel) .app-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--algo-border);
  box-shadow: 0 0 18px rgba(112, 126, 174, 0.06);
}

body:has(.algo-builder-panel) .sidebar-brand,
body:has(.algo-builder-panel) .sidebar-brand strong,
body:has(.algo-builder-panel) .sidebar-label {
  color: var(--algo-text);
}

body:has(.algo-builder-panel) .sidebar-brand span {
  color: var(--algo-muted);
}

body:has(.algo-builder-panel) .sidebar-link {
  color: var(--algo-muted);
  border-radius: 12px;
}

body:has(.algo-builder-panel) .sidebar-link:hover,
body:has(.algo-builder-panel) .sidebar-link.active,
body:has(.algo-builder-panel) .sidebar-link.is-active,
body:has(.algo-builder-panel) .sidebar-link[aria-current="page"] {
  background: var(--algo-blue);
  color: #fff;
}

body:has(.algo-builder-panel) .admin-topbar,
body:has(.algo-builder-panel) .topbar,
body:has(.algo-builder-panel) header.admin-topbar {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--algo-border);
  box-shadow: none;
}

body:has(.algo-builder-panel) .admin-content,
body:has(.algo-builder-panel) .admin-main,
body:has(.algo-builder-panel) .site-footer,
body:has(.algo-builder-panel) .admin-footer {
  background: transparent;
  color: var(--algo-text);
}

body:has(.algo-builder-panel) .algo-builder-panel.panel,
body:has(.algo-builder-panel) .panel.algo-builder-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

body:has(.algo-builder-panel) .algo-builder-panel .panel-head h2 {
  color: var(--algo-text);
  font-weight: 800;
}

body:has(.algo-builder-panel) .algo-builder-panel .muted,
body:has(.algo-builder-panel) .algo-section-sub,
body:has(.algo-builder-panel) .field-hint,
body:has(.algo-builder-panel) .algo-label {
  color: var(--algo-muted);
}

body:has(.algo-builder-panel) .algo-section {
  background: var(--algo-card);
  border: 1px solid var(--algo-border);
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(112, 126, 174, 0.05);
}

body:has(.algo-builder-panel) .algo-section-title {
  color: var(--algo-text);
}

body:has(.algo-builder-panel) .algo-type-option,
body:has(.algo-builder-panel) .algo-chip span,
body:has(.algo-builder-panel) .algo-chip-btn,
body:has(.algo-builder-panel) .algo-ind-pick,
body:has(.algo-builder-panel) .algo-ind-comp,
body:has(.algo-builder-panel) .algo-side-btn,
body:has(.algo-builder-panel) .segment-toggle span {
  background: var(--surface);
  border-color: var(--algo-border);
  color: var(--algo-muted);
}

body:has(.algo-builder-panel) .algo-type-option:hover,
body:has(.algo-builder-panel) .algo-type-option.is-active {
  background: var(--algo-blue-soft);
  border-color: var(--algo-blue-border);
}

body:has(.algo-builder-panel) .algo-chip span:hover,
body:has(.algo-builder-panel) .algo-chip-btn:hover,
body:has(.algo-builder-panel) .algo-ind-pick:hover:not(:disabled) {
  border-color: var(--algo-blue-border);
  color: var(--algo-blue);
  background: var(--algo-blue-soft);
}

body:has(.algo-builder-panel) .algo-chip input:checked + span,
body:has(.algo-builder-panel) .algo-chip-btn.is-active {
  border-color: var(--algo-blue-border);
  background: var(--algo-blue-soft);
  color: var(--algo-blue);
  box-shadow: 0 0 0 2px rgba(183, 121, 31, 0.12);
}

body:has(.algo-builder-panel) .algo-ind-pick-hint {
  color: var(--algo-blue);
}

body:has(.algo-builder-panel) .algo-entry-help,
body:has(.algo-builder-panel) .algo-join-label,
body:has(.algo-builder-panel) .algo-feed-label {
  color: var(--algo-muted);
}

body:has(.algo-builder-panel) .algo-create-btn {
  background: var(--algo-blue);
  box-shadow: 0 10px 24px rgba(183, 121, 31, 0.22);
}

body:has(.algo-builder-panel) .custom-leg-actions .btn-small {
  min-height: 2.1rem;
  border-radius: 9px;
  padding: 0.35rem 0.75rem;
}

body:has(.algo-builder-panel) .algo-underlying-box {
  background: var(--surface-hover);
  border-color: var(--algo-border);
}

body:has(.algo-builder-panel) .algo-builder input,
body:has(.algo-builder-panel) .algo-builder select,
body:has(.algo-builder-panel) .algo-builder textarea {
  background: var(--input-bg);
  border: 1px solid var(--algo-border);
  color: var(--algo-text);
  border-radius: 8px;
}

body:has(.algo-builder-panel) .algo-builder input:focus,
body:has(.algo-builder-panel) .algo-builder select:focus,
body:has(.algo-builder-panel) .algo-builder textarea:focus {
  outline: none;
  border-color: var(--algo-blue);
  box-shadow: 0 0 0 3px rgba(183, 121, 31, 0.12);
}

body:has(.algo-builder-panel) .algo-legs .custom-leg-card {
  background: var(--surface);
  border: 1px solid var(--algo-border);
  box-shadow: 0 2px 10px rgba(112, 126, 174, 0.05);
}

body:has(.algo-builder-panel) .algo-legs .custom-leg-card-head {
  background: var(--surface-hover);
  border-bottom: 1px dashed var(--algo-border);
}

body:has(.algo-builder-panel) .algo-entry-box {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

body:has(.algo-builder-panel) .algo-entry-title.is-long {
  color: #05cd99;
}

body:has(.algo-builder-panel) .algo-entry-title.is-short {
  color: #ee5d50;
}

body:has(.algo-builder-panel) .algo-andor input:checked + span,
body:has(.algo-builder-panel) .algo-primary-btn,
body:has(.algo-builder-panel) .btn.algo-primary-btn {
  background: var(--algo-blue);
  border-color: var(--algo-blue);
  color: #fff;
}

body:has(.algo-builder-panel) .btn.btn-secondary,
body:has(.algo-builder-panel) .algo-deploy-btn {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--algo-text);
}

body:has(.algo-builder-panel) .algo-create-btn,
body:has(.algo-builder-panel) .btn:not(.btn-secondary):not(.btn-danger) {
  color: #fff;
}

body:has(.algo-builder-panel) .builder-snapshot {
  background: var(--surface-hover);
  border: 1px solid var(--algo-border);
  color: var(--algo-text);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}

body:has(.algo-builder-panel) .admin-content.container {
  max-width: none;
  width: min(1180px, calc(100% - 1.5rem));
}

body:has(.algo-builder-panel) .admin-topbar-title .admin-kicker {
  display: none;
}

body:has(.algo-builder-panel) #themeToggle {
  opacity: 0.55;
}

body:has(.algo-builder-panel) .algo-ind-modal-card {
  background: var(--surface);
  border-color: var(--algo-border);
  color: var(--algo-text);
}

body:has(.algo-builder-panel) .algo-ind-item {
  background: var(--surface);
  border-color: var(--algo-border);
  color: var(--algo-text);
}

body:has(.algo-builder-panel) .algo-ind-item.is-active {
  border-color: var(--algo-blue-border);
  background: var(--algo-blue-soft);
}

body:has(.algo-builder-panel) .algo-more {
  border-top-color: var(--algo-border);
}

body:has(.algo-builder-panel) .algo-more > summary {
  color: var(--algo-blue);
}

body:has(.algo-builder-panel) .edit-link {
  color: var(--algo-blue);
}

body:has(.algo-builder-panel) .buy-leg-card .algo-leg-pill {
  background: rgba(5, 205, 153, 0.12);
  color: #05cd99;
}

body:has(.algo-builder-panel) .sell-leg-card .algo-leg-pill {
  background: rgba(238, 93, 80, 0.12);
  color: #ee5d50;
}

body:has(.algo-builder-panel) .algo-side-btn.buy.is-active {
  border-color: rgba(5, 205, 153, 0.45);
  background: rgba(5, 205, 153, 0.1);
  color: #05cd99;
}

body:has(.algo-builder-panel) .algo-side-btn.sell.is-active {
  border-color: rgba(238, 93, 80, 0.45);
  background: rgba(238, 93, 80, 0.1);
  color: #ee5d50;
}


/* ── FxTruebook home (4Dea-inspired) ── */
body.asn-home {
  --asn-orange: #b7791f;
  --asn-orange-dark: #8a5a12;
  --asn-ink: #212529;
  --asn-muted: #6c757d;
  --asn-line: #e9ecef;
  --asn-bg: #ffffff;
  --asn-bg-alt: #f7f8fa;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--asn-ink);
  background: #fafafb;
  overflow-x: clip;
}
body.asn-home .bg-mesh,
body.asn-home .bg-orb { display: none !important; }

.asn-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  transition: background var(--dur-slow) var(--ease-smooth), box-shadow var(--dur-slow) var(--ease-smooth), backdrop-filter var(--dur-slow) var(--ease-smooth);
}
.asn-topbar-inner {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.asn-brand {
  display: inline-flex;
  align-items: center;
    gap: 0.65rem;
  text-decoration: none;
  color: #fff;
}
.asn-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}
.asn-brand-text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.asn-brand-asn { color: #fff; }
.asn-brand-fx { color: var(--asn-orange); }
.asn-nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}
.asn-nav a {
  color: rgba(255,255,255,0.92);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 400;
}
.asn-nav a:hover { color: #fff; }
.asn-nav-cta {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--asn-orange);
  color: #fff !important;
  font-weight: 500;
}
.asn-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.asn-menu-btn span {
  display: block;
  height: 2px;
  background: #fff;
  margin: 7px 8px;
  border-radius: 2px;
  transition: transform var(--dur-base) var(--ease-smooth), width var(--dur-base) var(--ease-smooth);
}
.asn-menu-btn span:nth-child(1) { width: 14px; margin-left: auto; margin-right: 8px; }
.asn-menu-btn span:nth-child(2) { width: 22px; }
.asn-menu-btn span:nth-child(3) { width: 10px; margin-left: auto; margin-right: 8px; }
.asn-topbar.is-scrolled {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.asn-hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 7rem 1rem 5rem;
  color: #fff;
  overflow: hidden;
}
.asn-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.asn-hero-media img,
.asn-hero-img {
  width: 112%;
  height: 112%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: -6%;
  will-change: transform;
  animation: asn-kenburns 22s ease-in-out infinite alternate;
}
@keyframes asn-kenburns {
  0% { transform: scale(1) translate3d(0, 0, 0); }
  100% { transform: scale(1.12) translate3d(-3%, -2%, 0); }
}
.asn-hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 1;
  animation: asn-orb 10s ease-in-out infinite;
}
.asn-hero-glow-a {
  width: 280px;
  height: 280px;
  background: rgba(183, 121, 31, 0.28);
  top: 12%;
  left: 8%;
}
.asn-hero-glow-b {
  width: 320px;
  height: 320px;
  background: rgba(245, 184, 46, 0.2);
  right: 6%;
  bottom: 18%;
  animation-delay: -4s;
}
@keyframes asn-orb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.55; }
  50% { transform: translate3d(24px, -18px, 0) scale(1.12); opacity: 0.9; }
}
.asn-hero-particles {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.asn-hero-particles span {
  position: absolute;
  bottom: -12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 8px rgba(183, 121, 31, 0.45);
  animation: asn-rise linear infinite;
}
@keyframes asn-rise {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  12% { opacity: 0.85; }
  100% { transform: translateY(-110vh) scale(0.55); opacity: 0; }
}
.asn-hero-chart {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(38vh, 320px);
  width: 100%;
  z-index: 2;
  opacity: 0.7;
  pointer-events: none;
}
.asn-chart-line {
  stroke-dasharray: 1800;
  stroke-dashoffset: 1800;
  animation: asn-draw 3.4s ease forwards 0.35s, asn-line-glow 3.2s ease-in-out infinite 3.8s;
}
.asn-chart-area {
  opacity: 0;
  animation: asn-fade-in 1.4s ease forwards 1.35s;
}
@keyframes asn-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes asn-line-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(183, 121, 31, 0)); }
  50% { filter: drop-shadow(0 0 8px rgba(183, 121, 31, 0.7)); }
}
@keyframes asn-fade-in {
  to { opacity: 1; }
}
.asn-anim-top {
  animation: asn-slide-down 0.7s cubic-bezier(.2,.9,.2,1) both;
}
@keyframes asn-slide-down {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}
.asn-anim-hero {
  opacity: 0;
  animation: asn-rise-in 0.9s cubic-bezier(.2,.9,.2,1) forwards;
}
.asn-anim-d1 { animation-delay: 0.15s; }
.asn-anim-d2 { animation-delay: 0.32s; }
.asn-anim-d3 { animation-delay: 0.48s; }
@keyframes asn-rise-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
.asn-reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.75s var(--ease-smooth), transform 0.75s var(--ease-smooth);
  transition-delay: calc(var(--d, 0) * 110ms);
}
.asn-reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}
.asn-btn-primary {
  animation: asn-pulse 2.6s ease-in-out infinite;
}
@keyframes asn-pulse {
  0%, 100% { box-shadow: 0 12px 28px rgba(183, 121, 31, 0.35); }
  50% { box-shadow: 0 14px 36px rgba(183, 121, 31, 0.55); }
}
.asn-feature:hover,
.asn-unique-grid article:hover,
.asn-steps li:hover {
  transform: translateY(-6px);
  border-color: rgba(183, 121, 31, 0.35);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
  transition: transform 0.35s var(--ease-smooth), border-color 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
}
.asn-feature,
.asn-unique-grid article,
.asn-steps li {
  transition: transform 0.35s var(--ease-smooth), border-color 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
}
@media (prefers-reduced-motion: reduce) {
  .asn-hero-img,
  .asn-hero-glow,
  .asn-hero-particles span,
  .asn-chart-line,
  .asn-chart-area,
  .asn-anim-top,
  .asn-anim-hero,
  .asn-btn-primary,
  .asn-scroll span {
    animation: none !important;
  }
  .asn-reveal {
    opacity: 1;
    transform: none;
  }
}
.asn-hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(8,12,20,0.55) 0%, rgba(8,12,20,0.28) 42%, rgba(8,12,20,0.62) 100%);
}
.asn-hero-copy {
  position: relative;
  z-index: 1;
  width: min(820px, 100%);
  text-align: center;
}
.asn-hero-copy h1 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(1.7rem, 4.2vw, 2.85rem);
  line-height: 1.35;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.01em;
}
.asn-hero-copy h1 strong {
  font-weight: 700;
  color: #fff;
}
.asn-hero-copy p {
  margin: 1.1rem auto 0;
  max-width: 42rem;
  color: rgba(255,255,255,0.82);
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.6;
}
.asn-hero-actions {
  margin-top: 1.6rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.asn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease-smooth), filter var(--dur-fast) var(--ease-smooth), background var(--dur-fast) var(--ease-smooth);
}
.asn-btn:hover { transform: translateY(-1px); }
.asn-btn-primary {
  background: var(--asn-orange);
  color: #fff;
  box-shadow: 0 12px 28px rgba(183, 121, 31, 0.35);
}
.asn-btn-primary:hover { filter: brightness(1.05); color: #fff; }
.asn-btn-ghost {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.45);
  color: #fff;
  backdrop-filter: blur(8px);
}
.asn-btn-ghost:hover { background: rgba(255,255,255,0.16); color: #fff; }
.asn-scroll {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  width: 28px;
  height: 44px;
  border: 2px solid rgba(255,255,255,0.55);
  border-radius: 16px;
  z-index: 2;
}
.asn-scroll span {
  display: block;
  width: 4px;
  height: 8px;
  margin: 8px auto 0;
  border-radius: 4px;
  background: #fff;
  animation: asn-bounce 1.6s ease-in-out infinite;
}
@keyframes asn-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(12px); opacity: 1; }
}

.asn-section {
  padding: 4.5rem 0;
  background: var(--asn-bg);
}
.asn-section-alt { background: var(--asn-bg-alt); }
.asn-section-head {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 2.25rem;
}
.asn-section-head h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 400;
  color: var(--asn-ink);
}
.asn-section-head p {
  margin: 0.75rem 0 0;
  color: var(--asn-muted);
  font-weight: 300;
  line-height: 1.6;
}
.asn-feature-grid,
.asn-unique-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.asn-feature,
.asn-unique-grid article {
  background: #fff;
  border: 1px solid var(--asn-line);
  border-radius: 16px;
  padding: 1.5rem 1.35rem;
  box-shadow: 0 8px 24px rgba(183, 121, 31, 0.06);
}
.asn-feature h3,
.asn-unique-grid h3 {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--asn-ink);
}
.asn-feature h3::before,
.asn-unique-grid h3::before {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  background: var(--asn-orange);
  margin-bottom: 0.85rem;
}
.asn-feature p,
.asn-unique-grid p {
  margin: 0;
  color: var(--asn-muted);
  font-weight: 300;
  line-height: 1.65;
}

.asn-steps ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.asn-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.15rem 1.25rem;
  background: #fff;
  border: 1px solid var(--asn-line);
  border-radius: 4px;
}
.asn-steps li span {
  font-size: 1.35rem;
  font-weight: 300;
  color: var(--asn-orange);
  line-height: 1;
  padding-top: 0.15rem;
}
.asn-steps h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 500;
}
.asn-steps p {
  margin: 0;
  color: var(--asn-muted);
  font-weight: 300;
}

.asn-faq details {
  background: #fff;
  border: 1px solid var(--asn-line);
  border-radius: 4px;
  padding: 0.95rem 1.1rem;
  margin-bottom: 0.7rem;
}
.asn-faq summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--asn-ink);
}
.asn-faq p {
  margin: 0.65rem 0 0;
  color: var(--asn-muted);
  font-weight: 300;
  line-height: 1.6;
}

.asn-blu {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}
.asn-blu-kicker {
  margin: 0 0 0.5rem;
  color: var(--asn-orange);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.asn-blu-copy h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 400;
  color: var(--asn-ink);
}
.asn-blu-copy > p {
  margin: 0.75rem 0 0;
  color: var(--asn-muted);
  font-weight: 300;
  line-height: 1.6;
  max-width: 36rem;
}
.asn-blu-list {
  margin: 1.1rem 0 1.35rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}
.asn-blu-list li {
  color: var(--asn-muted);
  font-weight: 300;
  padding-left: 1.1rem;
  position: relative;
}
.asn-blu-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--asn-orange);
}
.asn-blu-card {
  background: #fff;
  border: 1px solid var(--asn-line);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(183, 121, 31, 0.06);
  display: grid;
  gap: 0.7rem;
}
.asn-blu-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.asn-blu-card-head img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}
.asn-blu-card-head strong {
  display: block;
  color: var(--asn-ink);
  font-weight: 600;
}
.asn-blu-card-head span {
  color: var(--asn-muted);
  font-size: 0.85rem;
  font-weight: 300;
}
.asn-blu-bubble {
  background: #f3f6fb;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  color: var(--asn-ink);
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.5;
  max-width: 92%;
}
.asn-blu-bubble.is-user {
  margin-left: auto;
  background: var(--asn-orange);
  color: #fff;
}

.asn-price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.asn-price-card {
  background: #fff;
  border: 1px solid var(--asn-line);
  border-radius: 16px;
  padding: 1.6rem 1.4rem;
  box-shadow: 0 8px 24px rgba(183, 121, 31, 0.06);
  display: grid;
  gap: 0.35rem;
  align-content: start;
}
.asn-price-card.is-accent {
  border-color: rgba(183, 121, 31, 0.35);
  box-shadow: 0 12px 28px rgba(183, 121, 31, 0.12);
}
.asn-price-label {
  color: var(--asn-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.asn-price-card strong {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 500;
  color: var(--asn-ink);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.asn-price-card em {
  font-style: normal;
  color: var(--asn-orange);
  font-size: 0.92rem;
  font-weight: 500;
}
.asn-price-card p {
  margin: 0.55rem 0 0;
  color: var(--asn-muted);
  font-weight: 300;
  line-height: 1.6;
}
.asn-price-card .asn-btn {
  margin-top: 1rem;
  justify-self: start;
}

.asn-cta {
  padding: 4.5rem 0;
  background: linear-gradient(120deg, #8a5a12 0%, #b7791f 58%, #e0961a 100%);
  color: #fff;
  text-align: center;
}
.asn-cta-inner {
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
}
.asn-cta h2 {
  margin: 0;
  font-weight: 300;
  font-size: clamp(1.45rem, 3vw, 2rem);
}
.asn-cta p {
  margin: 0.85rem 0 0;
  color: rgba(255,255,255,0.82);
  font-weight: 300;
}

.asn-footer {
  background: #111827;
  color: rgba(255,255,255,0.7);
  padding: 1.25rem 0;
  font-size: 0.9rem;
}
.asn-footer-inner {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  text-align: center;
}
body.asn-home .asn-footer a,
.admin-footer a {
  color: #f5b82e;
  text-decoration: none;
}
.admin-footer a {
  color: var(--primary);
}
body.asn-home .asn-faq a {
  color: #ffd166;
}
.asn-flash { padding-top: 1rem; }

@media (max-width: 900px) {
  .asn-feature-grid,
  .asn-unique-grid,
  .asn-price-grid,
  .asn-blu {
    grid-template-columns: 1fr;
  }
  .asn-menu-btn { display: inline-block; }
  .asn-nav {
    position: absolute;
    top: 72px;
    right: 1rem;
    left: 1rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 0.55rem;
    box-shadow: 0 18px 40px rgba(0,0,0,0.28);
  }
  .asn-nav.is-open { display: flex; }
  .asn-nav a {
    padding: 0.85rem 0.9rem;
    border-radius: 8px;
  }
  .asn-nav a:hover { background: rgba(255,255,255,0.06); }
  .asn-nav-cta { text-align: center; }
}

/* Exact FX Backtest tokens: #06090e, #f5b82e, Space Grotesk, Inter. */
body.asn-home {
  --asn-orange: #f5b82e;
  --asn-ink: #f4f9ff;
  --asn-muted: #55677d;
  --asn-line: #1c2531;
  --asn-bg: #06090e;
  --asn-bg-alt: #090d14;
  background: #06090e;
  color: #cbd7e4;
  font-family: Inter, -apple-system, "Segoe UI", sans-serif;
}
body.asn-home h1,
body.asn-home h2,
body.asn-home h3 {
  font-family: "Space Grotesk", Inter, sans-serif;
  color: #f4f9ff;
  letter-spacing: -0.022em;
  font-weight: 700;
}
body.asn-home .asn-hero-copy h1 {
  font-size: clamp(2rem, 4.6vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.028em;
  font-weight: 700;
  color: #f4f9ff;
}
body.asn-home .asn-section-head h2,
body.asn-home .asn-cta h2 {
  font-size: clamp(1.55rem, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.022em;
}
body.asn-home .asn-topbar,
body.asn-home .asn-topbar.is-scrolled {
  background: rgba(6, 9, 14, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
body.asn-home .asn-topbar-inner { min-height: 60px; }
body.asn-home .asn-brand-asn { color: #f4f9ff; }
body.asn-home .asn-brand-fx { color: #f5b82e; }
body.asn-home .asn-nav a {
  color: #cbd7e4;
  font-size: 14px;
  font-weight: 500;
}
body.asn-home .asn-nav a:hover { color: #f4f9ff; }
body.asn-home .asn-nav-cta,
body.asn-home .asn-btn-primary,
body.asn-home .asn-chat-launcher {
  background: linear-gradient(135deg, #ffd166, #e0961a 80%);
  color: #001018 !important;
  border: 0;
  border-radius: 14px;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.7px;
  box-shadow: 0 4px 18px rgba(245, 184, 46, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  animation: none;
}
body.asn-home .asn-chat-launcher {
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
  letter-spacing: 0;
}
body.asn-home .asn-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #eaf2fa;
  border-radius: 14px;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 700;
}
body.asn-home .asn-hero {
  background:
    radial-gradient(ellipse at 75% 8%, rgba(245, 184, 46, 0.18), transparent 42%),
    #06090e;
}
body.asn-home .asn-hero-img,
body.asn-home .asn-hero-shade,
body.asn-home .asn-hero-particles { display: none; }
body.asn-home .asn-hero-copy h1 strong { color: #f5b82e; }
body.asn-home .asn-hero-pill {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 197, 66, 0.45);
  color: #f5c542;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
body.asn-home .asn-stats {
  background: #090d14;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
body.asn-home .asn-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.35rem 0;
}
body.asn-home .asn-stats-row div {
  display: grid;
  gap: 0.25rem;
}
body.asn-home .asn-stats-row strong {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1.35rem;
  color: #f5b82e;
  letter-spacing: -0.03em;
}
body.asn-home .asn-stats-row span {
  color: #f0f7ff;
  font-size: 13px;
  font-weight: 300;
}
@media (max-width: 800px) {
  body.asn-home .asn-stats-row { grid-template-columns: 1fr 1fr; }
}
body.asn-home .asn-hero-copy p,
body.asn-home .asn-section-head p,
body.asn-home .asn-feature p,
body.asn-home .asn-unique-grid p,
body.asn-home .asn-steps p,
body.asn-home .asn-faq p,
body.asn-home .asn-cta p,
body.asn-home .asn-blu-copy > p,
body.asn-home .asn-blu-list li,
body.asn-home .asn-price-card p,
body.asn-home .asn-price-card em {
  color: #f0f7ff;
  font-size: 15px;
  font-weight: 300;
}
body.asn-home .asn-section { background: #06090e; }
body.asn-home .asn-section-alt { background: #090d14; }
body.asn-home .asn-feature,
body.asn-home .asn-unique-grid article,
body.asn-home .asn-steps li,
body.asn-home .asn-faq details,
body.asn-home .asn-blu-card,
body.asn-home .asn-price-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: none;
  padding: 20px 18px;
}
body.asn-home .asn-feature:hover,
body.asn-home .asn-unique-grid article:hover,
body.asn-home .asn-steps li:hover,
body.asn-home .asn-price-card:hover {
  border-color: rgba(245, 184, 46, 0.35);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}
body.asn-home .asn-feature h3,
body.asn-home .asn-unique-grid h3,
body.asn-home .asn-steps h3,
body.asn-home .asn-faq summary,
body.asn-home .asn-blu-copy h2,
body.asn-home .asn-blu-card-head strong,
body.asn-home .asn-price-card strong { color: #f4f9ff; }
body.asn-home .asn-feature h3::before,
body.asn-home .asn-unique-grid h3::before { background: #f5b82e; }
body.asn-home .asn-steps li span,
body.asn-home .asn-blu-kicker,
body.asn-home .asn-price-card em,
body.asn-home .asn-blu-list li::before { color: #f5b82e; font-weight: 700; }
body.asn-home .asn-blu-list li::before { background: #f5b82e; }
body.asn-home .asn-blu-bubble {
  background: #090d14;
  color: #f0f7ff;
  border: 1px solid #1c2531;
}
body.asn-home .asn-blu-bubble.is-user {
  background: linear-gradient(135deg, #ffd166, #e0961a 80%);
  color: #001018;
  border: 0;
}
body.asn-home .asn-price-card.is-accent {
  border-color: rgba(245, 184, 46, 0.35);
}
body.asn-home .asn-price-label { color: #55677d; }
body.asn-home .asn-cta {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(245, 184, 46, 0.18), transparent 55%),
    #090d14;
}
body.asn-home .asn-footer {
  background: #06090e;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #55677d;
}
body.asn-home .asn-footer a,
body.asn-home .asn-faq a { color: #f5b82e; }
body.asn-home .asn-chat-panel {
  background: #0e141d;
  border-color: #1c2531;
  color: #cbd7e4;
}
body.asn-home .asn-chat-row.is-user .asn-chat-bubble {
  background: linear-gradient(135deg, #ffd166, #e0961a 80%);
  color: #001018;
}
body.asn-home .asn-chat-row.is-bot .asn-chat-bubble {
  background: #090d14;
  color: #f0f7ff;
  border-color: #1c2531;
}

/* ── Strategy export downloads ── */
.strategy-export-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
}
.strategy-export-row .field-hint {
  flex: 1 1 100%;
  margin: 0;
}

/* ── FxTruebook home chatbot ── */
.asn-chat {
  position: fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}
.asn-chat-launcher {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: #b7791f;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(183, 121, 31, 0.4);
  transition: transform var(--dur-base) var(--ease-smooth), filter var(--dur-base) var(--ease-smooth);
  animation: asn-chat-bob 2.8s ease-in-out infinite;
}
.asn-chat-launcher svg {
  width: 26px;
  height: 26px;
}
.asn-chat-launcher:hover {
  filter: brightness(1.06);
  transform: translateY(-2px) scale(1.03);
}
.asn-chat-launcher.is-open {
  animation: none;
  background: #111827;
}
@keyframes asn-chat-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.asn-chat-panel {
  width: min(360px, calc(100vw - 1.5rem));
  height: min(520px, calc(100vh - 7rem));
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e9ecef;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
}
.asn-chat-panel.is-open {
  display: flex;
  animation: asn-chat-in 0.28s cubic-bezier(.2,.9,.2,1);
}
.asn-chat-panel[hidden] {
  display: none !important;
}
@keyframes asn-chat-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.asn-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #fff;
}
.asn-chat-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.asn-chat-brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
}
.asn-chat-brand strong {
  display: block;
  font-size: 0.92rem;
}
.asn-chat-brand span {
  display: block;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
  font-weight: 300;
}
.asn-chat-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.asn-chat-messages {
  flex: 1;
  overflow: auto;
  padding: 0.9rem;
  background: #f7f8fa;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.asn-chat-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 92%;
}
.asn-chat-row.is-user {
  align-self: flex-end;
  align-items: flex-end;
}
.asn-chat-row.is-bot {
  align-self: flex-start;
  align-items: flex-start;
}
.asn-chat-bubble {
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  font-weight: 400;
}
.asn-chat-row.is-bot .asn-chat-bubble {
  background: #fff;
  color: #212529;
  border: 1px solid #e9ecef;
  border-bottom-left-radius: 4px;
}
.asn-chat-row.is-user .asn-chat-bubble {
  background: #b7791f;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.asn-chat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.asn-chat-links a {
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  color: #b7791f;
  background: rgba(183, 121, 31, 0.08);
  border: 1px solid rgba(183, 121, 31, 0.2);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
}
.asn-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem 0.15rem;
  background: #fff;
  border-top: 1px solid #eef1f4;
}
.asn-chat-quick button {
  border: 1px solid #e9ecef;
  background: #f7f8fa;
  color: #343a40;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
}
.asn-chat-quick button:hover {
  border-color: rgba(183, 121, 31, 0.4);
  color: #b7791f;
}
.asn-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  padding: 0.7rem;
  background: #fff;
  border-top: 1px solid #eef1f4;
}
.asn-chat-form input {
  border: 1px solid #e9ecef;
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  font: inherit;
  font-size: 0.88rem;
  background: #f7f8fa;
  color: #212529;
}
.asn-chat-form input:focus {
  outline: none;
  border-color: #b7791f;
  box-shadow: 0 0 0 3px rgba(183, 121, 31, 0.12);
}
.asn-chat-form button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #b7791f;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
}
@media (max-width: 520px) {
  .asn-chat {
    right: 0.75rem;
    bottom: 0.75rem;
  }
  .asn-chat-panel {
    width: calc(100vw - 1.2rem);
    height: min(70vh, 560px);
  }
}

/* Trade History page */
.desk-history-panel .panel-head {
  align-items: flex-start;
}
.desk-history-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0 0 1rem;
}
.desk-history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.desk-history-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
}
.desk-history-custom label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.desk-history-custom input[type="date"] {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 0.45rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}
.desk-history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 0 0 0.75rem;
  font-size: 0.86rem;
}
.desk-history-action {
  text-transform: capitalize;
  font-weight: 600;
}
.desk-history-table td {
  vertical-align: top;
}

.desk-history-section {
  margin: 0 0 1.35rem;
}
.desk-history-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.55rem;
}
.desk-history-section-head h3 {
  margin: 0;
  font-size: 1rem;
}
.desk-history-positions {
  margin-bottom: 0.25rem;
}

.desk-strategy-pnl {
  margin: 0 0 0.85rem;
}
.desk-strategy-pnl-table td .muted {
  font-weight: 500;
  font-size: 0.78rem;
}
.live-bot-pnl-pct {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.78em;
  font-weight: 600;
  opacity: 0.9;
}

.risk-usd-hint {
  display: block;
  margin-top: 0.2rem;
  color: var(--gold, #c9a227);
  font-weight: 600;
}

.mt5-feed-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
}

.mt5-feed-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: var(--input-bg);
}

.mt5-feed-card span {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.mt5-feed-card strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.05rem;
}

.mt5-feed-scroll {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.mt5-feed-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0.55rem 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.mt5-feed-pages button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.mt5-feed-pages .is-disabled {
  opacity: 0.4;
  font-weight: 700;
}

.mt5-feed-status {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mt5-feed-status.is-pending { background: rgba(234, 179, 8, 0.18); color: #a16207; }
.mt5-feed-status.is-sent { background: rgba(59, 130, 246, 0.16); color: #1d4ed8; }
.mt5-feed-status.is-acked { background: rgba(34, 197, 94, 0.16); color: #166534; }
.mt5-feed-status.is-failed { background: rgba(239, 68, 68, 0.16); color: #b91c1c; }
.mt5-feed-status.is-cancelled { background: rgba(100, 116, 139, 0.16); color: #475569; }

.mt5-feed-section { margin-top: 1.25rem; }
.mt5-feed-section h3 { margin: 0 0 0.25rem; }

@media (max-width: 900px) {
  .mt5-feed-grid { grid-template-columns: 1fr 1fr; }
}

/* --- mobile.css (also linked for cache-bust) --- */
/* Phone and small-tablet layout for the whole FxTruebook app. */

@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden;
  }

  body.admin-layout {
    --topbar-height: 52px;
  }

  .admin-content {
    padding: 0.75rem 0 2rem;
  }

  .admin-content.container {
    width: calc(100% - 1rem);
  }

  .admin-topbar {
    gap: 0.4rem;
    padding-inline: 0.55rem;
    min-width: 0;
  }

  .admin-topbar-left,
  .admin-topbar-right,
  .admin-topbar-title {
    min-width: 0;
  }

  .admin-topbar-title strong {
    display: block;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.92rem;
  }

  .panel,
  .login-card,
  .dash-kpi,
  .strategy-card,
  .saved-result-card {
    padding: 0.9rem;
    border-radius: 12px;
  }

  .panel h2 {
    font-size: 1.12rem;
  }

  img,
  svg,
  video,
  canvas,
  iframe {
    max-width: 100%;
  }

  input,
  select,
  textarea,
  .grid-form > *,
  .live-bot-deploy-bar > *,
  .algo-grid > *,
  .algo-field-row > *,
  .paper-config-grid > *,
  label {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]),
  select,
  textarea {
    font-size: 16px;
    width: 100%;
  }

  .panel-head,
  .panel-head-row,
  .strategy-selected-head,
  .desk-history-section-head,
  .dash-section-head,
  .live-bot-header-actions,
  .panel-head-actions,
  .chart-terminal-actions,
  .table-toolbar,
  .trade-day-toolbar,
  .form-actions,
  .form-actions-bar {
    flex-wrap: wrap;
    min-width: 0;
  }

  .panel-head-actions,
  .live-bot-header-actions {
    flex-shrink: 1;
    width: 100%;
    justify-content: flex-start;
  }

  .section-nav {
    position: static;
    top: auto;
  }

  .section-nav-download {
    margin-left: 0;
  }

  .grid-form,
  .stats-grid,
  .params-grid,
  .params-grid.compact,
  .paper-config-grid,
  .paper-metrics,
  .paper-pnl-row,
  .chart-meta,
  .daily-grid,
  .dash-kpi-row,
  .dash-action-grid,
  .live-deploy-summary-grid,
  .live-bot-hud,
  .mt5-feed-grid,
  .result-hero,
  .result-hero-side,
  .profile-panel .profile-grid,
  .chart-terminal-toolbar,
  .chart-terminal-filters,
  .chart-replay-hud,
  .algo-field-row,
  .algo-name-row,
  .algo-grid-2,
  .algo-grid-3,
  .algo-grid-4,
  .algo-top-grid,
  .algo-trade-row,
  .leg-type-toggle,
  .strategy-detail-row,
  .strategy-icon-grid,
  .strategy-icon-meta,
  .saved-result-meta,
  .backtest-leg-grid,
  .live-bot-trade-detail-grid,
  .desk-broker-grid {
    grid-template-columns: 1fr 1fr;
  }

  .table-wrap,
  .mt5-feed-scroll,
  .trade-day .table-wrap,
  .desk-history-table,
  .live-bot-trades {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .trade-table,
  .day-trade-table,
  .trade-day-table,
  .desk-history-table table,
  .live-bot-trades table {
    min-width: 720px;
  }

  .mono,
  .paper-log,
  .paper-log li,
  .live-bot-log,
  .live-bot-signals-levels,
  pre,
  code {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .js-plotly-plot,
  .plot-container,
  .svg-container {
    width: 100% !important;
    max-width: 100%;
  }

  .login-shell {
    padding: 1rem 0.75rem;
  }

  .login-card {
    width: min(100%, 420px);
    margin-inline: auto;
  }

  .asn-hero,
  .landing-hero,
  .asn-section {
    padding-inline: 1rem;
  }
}

@media (max-width: 560px) {
  .admin-content.container {
    width: calc(100% - 0.75rem);
  }

  .grid-form,
  .stats-grid,
  .params-grid,
  .params-grid.compact,
  .paper-config-grid,
  .paper-metrics,
  .paper-pnl-row,
  .chart-meta,
  .daily-grid,
  .dash-kpi-row,
  .dash-action-grid,
  .live-deploy-summary-grid,
  .live-bot-hud,
  .mt5-feed-grid,
  .result-hero,
  .result-hero-side,
  .profile-panel .profile-grid,
  .chart-terminal-filters,
  .chart-replay-hud,
  .algo-field-row,
  .algo-name-row,
  .algo-grid-2,
  .algo-grid-3,
  .algo-grid-4,
  .leg-type-toggle,
  .saved-result-meta,
  .backtest-leg-grid,
  .live-bot-trade-detail-grid,
  .desk-broker-grid {
    grid-template-columns: 1fr;
  }

  .dash-kpi-value,
  .live-deploy-summary-card strong {
    font-size: 1.25rem;
  }

  .btn,
  button.btn,
  a.btn,
  .sidebar-link,
  .sidebar-mobile-toggle {
    min-height: 40px;
  }

  .live-bot-board-count,
  .trade-day-pnl {
    margin-left: 0;
  }

  .trade-day summary,
  .live-bot-card header,
  .strategy-card-pro-top {
    align-items: flex-start;
  }

  .asn-chat-panel {
    width: calc(100vw - 1rem);
    height: min(68vh, 520px);
  }

  .strategy-detail-grid,
  .admin-content [class*="-grid"] {
    grid-template-columns: 1fr !important;
  }

  .asn-guide-layout,
  .asn-mock-fields,
  .asn-mock-stats {
    grid-template-columns: 1fr;
  }
}

.asn-guide[data-lang="hi"],
.asn-guide[data-lang="mr"] {
  font-family: "Noto Sans Devanagari", Inter, sans-serif;
}
.asn-guide[data-lang="ja"] {
  font-family: "Noto Sans JP", Inter, sans-serif;
}
.asn-guide[data-lang="zh"] {
  font-family: "Noto Sans SC", Inter, sans-serif;
}
.asn-guide .asn-section-head {
  max-width: 46rem;
}
.asn-guide-langs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin: -0.5rem 0 1.5rem;
}
.asn-lang {
  border: 1px solid var(--asn-line);
  background: #0c121b;
  color: #d5e4f2;
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.asn-lang.is-on {
  background: #f5b82e;
  color: #041018;
  border-color: #f5b82e;
  font-weight: 600;
}
.asn-guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  gap: 1.25rem;
  align-items: start;
}
.asn-guide-layout > * {
  min-width: 0;
}
.asn-guide-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.asn-guide-chapter {
  border: 1px solid var(--asn-line);
  background: transparent;
  color: #9fb0c3;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.asn-guide-chapter.is-on {
  color: #041018;
  background: #f5b82e;
  border-color: #f5b82e;
  font-weight: 600;
}
.asn-guide-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.asn-guide-steps button {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  text-align: left;
  background: #0c121b;
  border: 1px solid var(--asn-line);
  color: inherit;
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  font: inherit;
  cursor: pointer;
}
.asn-guide-steps li.is-on button {
  border-color: #f5b82e;
  box-shadow: inset 3px 0 0 #f5b82e;
}
.asn-guide-steps button span {
  color: #f5b82e;
  font-variant-numeric: tabular-nums;
  padding-top: 0.1rem;
}
.asn-guide-steps button > span:last-child {
  min-width: 0;
}
.asn-guide-steps strong {
  display: block;
  font-weight: 600;
  color: #f4f9ff;
  margin-bottom: 0.25rem;
  overflow-wrap: anywhere;
}
.asn-guide-steps em {
  display: block;
  font-style: normal;
  color: #8ea0b5;
  font-weight: 400;
  line-height: 1.55;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}
.asn-guide-player {
  position: sticky;
  top: 84px;
  background: #0c121b;
  border: 1px solid var(--asn-line);
  border-radius: 16px;
  padding: 0.85rem;
}
.asn-guide-screen {
  background: #070b12;
  border-radius: 12px;
  min-height: 250px;
  overflow: hidden;
  border: 1px solid #1c2531;
}
.asn-mock-chrome {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  background: #101722;
  color: #8ea0b5;
  font-size: 0.75rem;
}
.asn-mock-chrome span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #243041;
}
.asn-mock-chrome span:first-child { background: #f43f5e; }
.asn-mock-chrome span:nth-child(2) { background: #f59e0b; }
.asn-mock-chrome span:nth-child(3) { background: #22c55e; }
.asn-mock-chrome em {
  margin-left: 0.35rem;
  font-style: normal;
}
.asn-mock {
  display: grid;
  grid-template-columns: 92px 1fr;
  min-height: 200px;
}
.asn-mock-stack,
.asn-mock-center {
  grid-template-columns: 1fr;
  padding: 0.9rem 1rem 1rem;
}
.asn-mock-center {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 200px;
  color: #9fb0c3;
}
.asn-mock-side {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  padding: 0.75rem 0.55rem;
  background: #0a1018;
  border-right: 1px solid #1c2531;
  font-size: 0.68rem;
  color: #8ea0b5;
}
.asn-mock-side b { color: #f4f9ff; font-size: 0.8rem; }
.asn-mock-side span.is-on {
  color: #041018;
  background: #f5b82e;
  border-radius: 6px;
  padding: 0.2rem 0.3rem;
}
.asn-mock-main { padding: 0.85rem 0.9rem 1rem; }
.asn-mock-kicker {
  margin: 0 0 0.35rem;
  color: #f5b82e;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.asn-mock h4 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  font-weight: 600;
}
.asn-mock-cards,
.asn-mock-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.asn-mock-cards em,
.asn-mock-chips em,
.asn-mock-leg,
.asn-mock-key,
.asn-mock-fields label {
  border: 1px solid #243041;
  background: #101722;
  border-radius: 8px;
  color: #d5e4f2;
  font-style: normal;
  font-size: 0.78rem;
  padding: 0.4rem 0.55rem;
}
.asn-mock-chips em.is-hot,
.asn-mock-cards em.is-hot {
  background: rgba(0, 212, 255, 0.16);
  border-color: #f5b82e;
  animation: asn-guide-pulse 1.6s ease-in-out infinite;
}
.asn-mock-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}
.asn-mock-fields label,
.asn-mock-name {
  display: grid;
  gap: 0.15rem;
  color: #8ea0b5;
}
.asn-mock-fields b,
.asn-mock-name b { color: #f4f9ff; font-weight: 600; }
.asn-mock-leg {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.asn-mock-leg.is-wait {
  border-color: #f59e0b;
  color: #fbbf24;
}
.asn-mock-save {
  border: 0;
  background: #f5b82e;
  color: #041018;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  font: inherit;
}
.asn-mock-ok {
  margin: 0.55rem 0 0;
  color: #34d399;
  font-weight: 600;
}
.asn-mock-chart {
  width: 100%;
  height: 90px;
}
.asn-mock-chart path {
  fill: none;
  stroke: #f5b82e;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 360;
  stroke-dashoffset: 360;
  animation: asn-guide-draw 2.4s ease forwards;
}
.asn-mock-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.asn-mock-stats span {
  display: grid;
  gap: 0.1rem;
  color: #8ea0b5;
  font-size: 0.72rem;
}
.asn-mock-stats b { color: #f4f9ff; font-size: 0.95rem; }
.asn-mock-ol {
  margin: 0 0 0.7rem;
  padding-left: 1.1rem;
  color: #d5e4f2;
  display: grid;
  gap: 0.3rem;
}
.asn-mock-key {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.asn-mock-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(52, 211, 153, 0.16);
  color: #34d399;
  border: 1px solid #34d399;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
  animation: asn-guide-pulse 1.6s ease-in-out infinite;
}
.asn-mock-wait {
  margin: 0 0 0.6rem;
  color: #fbbf24;
  font-weight: 600;
}
.asn-mock-candle {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  height: 72px;
  margin-top: 0.8rem;
}
.asn-mock-candle i {
  display: block;
  width: 14px;
  border-radius: 3px;
  background: #243041;
  height: 46px;
}
.asn-mock-candle i.is-live {
  height: 18px;
  background: #f43f5e;
  animation: asn-guide-candle 1.8s ease-in-out infinite;
}
.asn-guide-caption {
  margin: 0.75rem 0.15rem 0.45rem;
  color: #d5e4f2;
  min-height: 1.4em;
}
.asn-guide-bar {
  height: 3px;
  background: #1c2531;
  border-radius: 99px;
  overflow: hidden;
  margin: 0 0.15rem 0.7rem;
}
.asn-guide-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: #f5b82e;
  transform: scaleX(0);
  transform-origin: left center;
}
.asn-guide-bar.is-run i {
  animation: asn-guide-fill 5.6s linear forwards;
}
.asn-guide-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.asn-guide-btn {
  border: 1px solid var(--asn-line);
  background: #101722;
  color: #f4f9ff;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.asn-guide-btn-play {
  background: #f5b82e;
  color: #041018;
  border-color: #f5b82e;
  font-weight: 700;
}
.asn-guide-count {
  margin-left: auto;
  color: #8ea0b5;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.asn-guide-note {
  margin: 1.1rem auto 0;
  max-width: 52rem;
  text-align: center;
  color: #8ea0b5;
  font-size: 0.9rem;
  line-height: 1.6;
}
@keyframes asn-guide-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes asn-guide-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes asn-guide-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.0); }
  50% { box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.15); }
}
@keyframes asn-guide-candle {
  0%, 100% { height: 18px; }
  50% { height: 64px; }
}
@media (max-width: 900px) {
  .asn-guide-layout { grid-template-columns: 1fr; }
  .asn-guide-player { position: static; }
  .asn-guide-count { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .asn-mock-chart path,
  .asn-mock-chips em.is-hot,
  .asn-mock-cards em.is-hot,
  .asn-mock-pill,
  .asn-mock-candle i.is-live,
  .asn-guide-bar.is-run i {
    animation: none;
  }
}
