:root {
  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --ink: #eaf6ff;
  --ink-muted: #8aa4bd;
  --accent: #00a8ff;
  --accent-bright: #5cd1ff;
  --accent-deep: #0066c8;
  --line: rgba(0, 168, 255, 0.28);
  --danger: #c45c4a;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Sora", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.auth-card[data-mode="login"] .signup-only,
.auth-card[data-mode="signup"] .login-only {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

body.auth-open,
body.info-open,
body.trade-open {
  overflow: hidden;
}

/* Freeze + hide the marketing page while trading so animations/filters stop repainting */
body.trade-open .page,
body.trade-open .atmosphere {
  visibility: hidden;
}

/* Only pause known loops — avoid .page * (huge style recalc when opening modals) */
body.trade-open .page .bolt-spark,
body.trade-open .page .bolt-glow,
body.trade-open .page .card-edge-spark,
body.trade-open .page .card-edge-glow,
body.trade-open .page .instant-title-spark,
body.trade-open .page .instant-title-glow,
body.checkout-open .page .bolt-spark,
body.checkout-open .page .bolt-glow,
body.checkout-open .page .card-edge-spark,
body.checkout-open .page .card-edge-glow,
body.checkout-open .page .instant-title-spark,
body.checkout-open .page .instant-title-glow,
body.journal-open .page .bolt-spark,
body.journal-open .page .bolt-glow,
body.journal-open .page .card-edge-spark,
body.journal-open .page .card-edge-glow,
body.journal-open .page .instant-title-spark,
body.journal-open .page .instant-title-glow,
body.affiliate-open .page .bolt-spark,
body.affiliate-open .page .bolt-glow,
body.affiliate-open .page .card-edge-spark,
body.affiliate-open .page .card-edge-glow,
body.affiliate-open .page .instant-title-spark,
body.affiliate-open .page .instant-title-glow,
body.admin-open .page .bolt-spark,
body.admin-open .page .bolt-glow,
body.admin-open .page .card-edge-spark,
body.admin-open .page .card-edge-glow,
body.admin-open .page .instant-title-spark,
body.admin-open .page .instant-title-glow {
  animation-play-state: paused !important;
}

/* Pause decorative SVG loops while scrolling / when modals are open (avoids paint thrash) */
body.is-scrolling .bolt-spark,
body.is-scrolling .bolt-glow,
body.is-scrolling .card-edge-spark,
body.is-scrolling .card-edge-glow,
body.is-scrolling .instant-title-spark,
body.is-scrolling .instant-title-glow,
body.info-open .bolt-spark,
body.info-open .bolt-glow,
body.info-open .card-edge-spark,
body.info-open .card-edge-glow,
body.info-open .instant-title-spark,
body.info-open .instant-title-glow,
body.auth-open .bolt-spark,
body.auth-open .bolt-glow,
body.auth-open .card-edge-spark,
body.auth-open .card-edge-glow,
body.auth-open .instant-title-spark,
body.auth-open .instant-title-glow {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  .bolt-spark,
  .bolt-glow,
  .card-edge-spark,
  .card-edge-glow,
  .instant-title-spark,
  .instant-title-glow {
    animation: none !important;
  }
}

/* Opaque overlays — never blur the whole landing page (filter:blur on .page is a major jank source) */
body.auth-open .page,
body.info-open .page {
  pointer-events: none;
  user-select: none;
}

a {
  color: var(--accent-bright);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: #000000;
}

.glow,
.grain {
  display: none;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1.25rem, 4vw, 2.5rem);
  background: #000000;
  border-bottom: 1px solid rgba(0, 168, 255, 0.12);
}

.topbar-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  padding-top: 0.28em;
  font-family: var(--font-body);
  font-size: calc(1.05rem + 4pt);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
  overflow: visible;
  flex-shrink: 0;
  line-height: 1;
}

.topbar-brand .brand-futures {
  color: var(--accent-bright);
}

.topbar-brand:hover {
  text-decoration: none;
}

.topbar-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  margin-right: 1.35rem;
}

.topbar-nav a {
  color: #ffffff;
  font-family: var(--font-body);
  font-size: calc((1.05rem + 4pt) * 0.75);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  transition: color 0.2s ease;
}

.topbar-nav a:hover {
  color: var(--accent-bright);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.nav-btn {
  appearance: none;
  border: 1px solid rgba(0, 168, 255, 0.35);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav-btn:hover {
  background: rgba(0, 168, 255, 0.1);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.nav-btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 45%, var(--accent-deep) 100%);
  color: #031018;
}

.nav-btn-primary:hover {
  filter: brightness(1.05);
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 45%, var(--accent-deep) 100%);
}

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100vh - 72px);
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 0.85rem clamp(0.65rem, 1.5vw, 1rem) clamp(1.5rem, 4vw, 3.5rem);
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto auto;
  gap: 0.75rem;
  margin-top: 0;
  width: 100%;
  align-items: stretch;
}


.site-section {
  position: relative;
  z-index: 1;
  padding: clamp(3rem, 7vw, 5rem) clamp(1.25rem, 4vw, 2.5rem);
  border-top: 1px solid rgba(0, 168, 255, 0.12);
  content-visibility: auto;
  contain-intrinsic-size: 1px 720px;
}

.site-section-inner {
  max-width: 920px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  color: var(--accent-bright);
}

.section-header p {
  margin: 0;
  max-width: 34rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-muted);
}

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

.legal-block h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
}

.legal-block p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--ink-muted);
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.35rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0, 168, 255, 0.12);
}

.legal-links a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 1.5rem clamp(1.25rem, 4vw, 2.5rem) 2rem;
  border-top: 1px solid rgba(0, 168, 255, 0.12);
}

.site-footer-inner {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.brand-panel {
  width: 100%;
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
  container-type: inline-size;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0;
  padding-top: 0.35em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: visible;
}

.brand .brand-futures {
  color: var(--accent-bright);
}

.brand-name {
  display: inline-flex;
  align-items: baseline;
}

.brand-r {
  position: relative;
  display: inline-block;
  padding-right: 0.42em;
}

.brand-plus {
  position: absolute;
  left: 0.22em;
  bottom: 0.52em;
  display: block;
  width: 0.78em;
  height: 0.78em;
  color: var(--accent);
  line-height: 0;
  pointer-events: none;
}

.brand-plus svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.topbar-brand .brand-r {
  padding-right: 0.55em;
}

.topbar-brand .brand-plus {
  left: 0.3em;
  bottom: 0.52em;
  width: 0.68em;
  height: 0.68em;
}

.tagline {
  margin: 0 0 0.85rem;
  max-width: none;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--ink-muted);
}

.tagline-markets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  white-space: normal;
}

.tagline-lead {
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink-muted);
}

.tagline-symbols .trade-symbol-btn {
  cursor: default;
  pointer-events: none;
}

.tagline-symbols .trade-symbol-btn:hover {
  border-color: #2a2e39;
}

.tagline-symbols .trade-symbol-btn.is-active:hover {
  border-color: rgba(0, 168, 255, 0.4);
}

.tagline-no-rules {
  max-width: 100%;
  margin: -0.25rem 0 1rem;
  white-space: nowrap;
  line-height: 1.3;
  color: var(--ink-muted);
  font-size: min(1rem, 1.22cqi);
}

.account-block {
  position: relative;
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  grid-template-columns: minmax(0, 1fr);
  padding: 1.35rem 1.35rem 1.2rem;
  background:
    linear-gradient(165deg, rgba(0, 168, 255, 0.1), transparent 42%),
    #080e16;
  border: 1px solid rgba(0, 168, 255, 0.22);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  contain: layout paint style;
  animation: rise 1s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: visible;
  isolation: isolate;
}

.card-edge {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}

.card-edge rect {
  vector-effect: non-scaling-stroke;
}

.card-edge-glow {
  stroke: rgba(0, 168, 255, 0.42);
  stroke-width: 3.2;
  opacity: 0.7;
}

.card-edge-core {
  stroke: rgba(92, 209, 255, 0.55);
  stroke-width: 1.35;
}

.card-edge-spark {
  stroke: #9ae4ff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 8 92;
  stroke-dashoffset: 0;
  opacity: 0.85;
  animation: card-edge-electric 4.8s linear infinite;
  will-change: stroke-dashoffset;
}

#plus-futures-eval .card-edge-spark {
  animation-duration: 5.2s;
  animation-delay: -1.1s;
}

@keyframes card-edge-electric {
  to {
    stroke-dashoffset: -100;
  }
}

.account-header {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 5.85rem;
  margin: 0 0 1.15rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid rgba(0, 168, 255, 0.14);
}

.account-header-split {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  min-height: 5.85rem;
}

.account-header-instant,
.account-header-eval {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  min-height: 5.85rem;
}

.account-header-eval {
  padding-top: 2.15rem;
}

.account-header-instant .account-label,
.account-header-eval .account-label {
  margin: 0 0 0.35rem;
  min-height: 1rem;
  line-height: 1;
  padding-right: 4.5rem;
}

.account-header-eval .account-label {
  padding-right: 22rem;
}

.instant-title-row,
.eval-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.75rem;
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  margin-top: auto;
}

.instant-title-row .get-started-btn,
.eval-title-row .get-started-btn {
  margin-left: auto;
  align-self: flex-end;
}

.account-header-instant .instant-title {
  align-self: flex-end;
}

.instant-title-row .account-capital-holder {
  align-self: flex-end;
  transform: translateY(0.4rem);
}

.account-header-instant .account-price,
.account-header-eval .account-price {
  position: absolute;
  top: -0.45rem;
  right: 0;
  margin: 0;
  flex-shrink: 0;
  font-size: 2rem;
  line-height: 1;
  z-index: 1;
}

.account-header-eval .account-price-deal {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.4rem;
  top: -0.45rem;
  max-width: none;
  font-size: inherit;
  white-space: nowrap;
  text-align: right;
}

.account-price-was {
  color: rgba(255, 255, 255, 0.42);
  font-size: 1.05rem;
  font-weight: 500;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.12em;
}

.account-price-now {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
}

.account-price-alt {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
}

.account-price-promo {
  color: var(--accent-bright);
  font-size: 0.81rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
}

.account-price-promo strong {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.account-header-instant .account-price[hidden] {
  display: none !important;
}

.eval-title-row h2 {
  margin: 0;
}

.account-header-eval .eval-size-line {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.eval-size {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
}

.account-header-eval .eval-title-row {
  align-items: center;
}

.account-header-eval .eval-title-row h2,
.account-header-eval .eval-title-row .get-started-btn,
.account-header-eval .eval-title-row .rules-phase-toggle {
  align-self: center;
}

.account-header-eval .eval-title-row h2 {
  position: static;
  margin: 0;
  line-height: 1;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.16rem 0.48rem 0.16rem 0.22rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.tier-badge::before {
  content: "";
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.tier-badge > span {
  position: relative;
  top: 0.06em;
}

.tier-badge.is-silver {
  color: #f7f8fa;
  background: linear-gradient(180deg, #8b929e 0%, #4c5360 38%, #2c313a 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 1px 2px rgba(0, 0, 0, 0.4);
}

.tier-badge.is-silver::before {
  background:
    radial-gradient(circle at 32% 28%, #ffffff 0%, #f2f4f7 18%, transparent 19%),
    radial-gradient(circle at 36% 34%, #ffffff 0%, #d7dbe2 22%, #8e959f 58%, #3e4450 100%);
  box-shadow:
    inset 0 -1px 1px rgba(0, 0, 0, 0.45),
    0 0 0 0.5px rgba(255, 255, 255, 0.35);
}

.tier-badge.is-gold {
  color: #3b2a08;
  background: linear-gradient(180deg, #ffe7a8 0%, #e6b44a 36%, #b88620 100%);
  border: 1px solid rgba(255, 236, 186, 0.85);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(120, 72, 8, 0.45),
    0 1px 2px rgba(0, 0, 0, 0.35);
}

.tier-badge.is-gold::before {
  background:
    radial-gradient(circle at 32% 28%, #fff8df 0%, #ffe7a0 16%, transparent 17%),
    radial-gradient(circle at 36% 34%, #fff1c2 0%, #f0c14b 24%, #c48a16 62%, #7a5410 100%);
  box-shadow:
    inset 0 -1px 1px rgba(90, 50, 0, 0.45),
    0 0 0 0.5px rgba(255, 236, 180, 0.55);
}

.get-started-btn {
  appearance: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.55rem 1.05rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.get-started-btn:hover {
  background: #f3f9ff;
  color: var(--accent-deep);
  transform: translateY(-1px);
}

.account-rules {
  display: flex;
  flex-direction: column;
}

.account-header-spacer {
  visibility: hidden;
  pointer-events: none;
}

.account-capital-holder {
  flex-shrink: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.28rem;
  min-width: 9.5rem;
  min-height: 2.55rem;
  padding: 0.45rem 0.75rem 0.5rem;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(0, 168, 255, 0.14);
  border-radius: var(--radius-sm);
  color: var(--ink);
  white-space: nowrap;
  box-sizing: border-box;
  cursor: text;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.account-capital-holder:focus-within {
  border-color: rgba(0, 168, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(0, 168, 255, 0.18);
}

.account-capital-label {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.account-capital-field {
  position: relative;
  display: block;
  width: 6.25rem;
  min-height: 1.15rem;
  box-sizing: border-box;
}

.account-capital-prefix {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-bright);
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}

.account-capital-input {
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 0 0 0.85rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.15;
  outline: none;
  box-sizing: border-box;
}

.account-capital-input::placeholder {
  color: rgba(138, 164, 189, 0.55);
}

.account-heading {
  min-width: 0;
}

.account-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.account-header h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
}

.account-header-eval .eval-title-row h2 {
  font-size: 1.45rem;
}

.account-header h2.instant-title,
.instant-title {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
}

.instant-title-svg {
  display: block;
  width: auto;
  height: 1.05em;
  overflow: visible;
  color: var(--accent);
  flex: 0 0 auto;
}

.instant-title-svg text {
  font-family: var(--font-body);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.instant-title-glow {
  stroke: rgba(0, 168, 255, 0.45);
  opacity: 0.85;
}

.instant-title-fill {
  fill: var(--accent);
}

.instant-title-edge {
  stroke: var(--accent-bright);
  opacity: 0.9;
}

.instant-title-spark {
  stroke: #9ae4ff;
  stroke-dasharray: 10 90;
  stroke-dashoffset: 0;
  opacity: 0.85;
  animation: bolt-electric 3.6s linear infinite;
  will-change: stroke-dashoffset;
}

.account-price {
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 600;
  white-space: nowrap;
}

.bolt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.85em;
  height: 0.85em;
  color: var(--accent-bright);
}

.bolt svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.bolt-core {
  color: var(--accent-bright);
  stroke: var(--accent-bright);
}

.bolt-glow {
  stroke: rgba(0, 168, 255, 0.45);
  opacity: 0.85;
}

.bolt-spark {
  stroke: #9ae4ff;
  stroke-dasharray: 12 88;
  stroke-dashoffset: 0;
  opacity: 0.85;
  animation: bolt-electric 3.2s linear infinite;
  will-change: stroke-dashoffset;
}

@keyframes bolt-electric {
  to {
    stroke-dashoffset: -100;
  }
}

@keyframes bolt-edge-glow {
  0%,
  100% {
    stroke: rgba(0, 168, 255, 0.3);
    opacity: 0.65;
  }
  50% {
    stroke: rgba(92, 209, 255, 0.7);
    opacity: 1;
  }
}

.rules-phase-toggle {
  display: inline-flex;
  flex-shrink: 0;
  gap: 0.3rem;
  padding: 0.25rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 168, 255, 0.16);
  border-radius: var(--radius-sm);
}

.phase-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.phase-btn.is-active {
  background: linear-gradient(180deg, rgba(0, 168, 255, 0.32), rgba(0, 102, 200, 0.38));
  color: var(--ink);
}

.phase-btn:hover:not(.is-active) {
  color: var(--ink);
}

.account-block[data-rules-view="eval"] [data-phase-panel="funded"],
.account-block[data-rules-view="funded"] [data-phase-panel="eval"] {
  display: none !important;
}

.rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 4.6rem;
  gap: 0.7rem;
  margin: 0;
  flex: 1;
}

.rule {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  min-height: 4.6rem;
  height: 100%;
  padding: 0.75rem 0.85rem;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(0, 168, 255, 0.14);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
}

.rule-spacer {
  visibility: hidden;
  pointer-events: none;
  border: 0;
  background: transparent;
}

.rule dt {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.rule-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.info-icon-btn {
  appearance: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--accent-bright);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.info-icon-btn svg {
  width: 100%;
  height: 100%;
  display: block;
}

.info-icon-btn:hover {
  color: var(--accent);
  background: rgba(0, 168, 255, 0.12);
  transform: scale(1.06);
}

.rule dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

.rule dd.value-cash {
  color: #3dd68c;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

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

.info-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.info-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 1.6rem 1.5rem 1.35rem;
  background:
    linear-gradient(180deg, rgba(0, 168, 255, 0.1), transparent 40%),
    #080e16;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  animation: rise 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.info-dialog h2 {
  margin: 0 2rem 0.85rem 0;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--accent-bright);
}

.info-dialog p {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-muted);
}

.info-dismiss {
  appearance: none;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 45%, var(--accent-deep) 100%);
  color: #031018;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.info-dismiss:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.breach-modal {
  z-index: 70;
}

.breach-dialog {
  background:
    linear-gradient(180deg, rgba(239, 83, 80, 0.14), transparent 42%),
    rgba(8, 14, 22, 0.98);
  border-color: rgba(239, 83, 80, 0.45);
  text-align: center;
}

.breach-dialog h2 {
  margin-right: 2rem;
  color: #ff8a80;
}

.breach-dialog p {
  margin-bottom: 0;
}

.funded-dialog {
  background:
    linear-gradient(180deg, rgba(61, 214, 140, 0.18), transparent 42%),
    rgba(8, 14, 22, 0.98);
  border-color: rgba(61, 214, 140, 0.5);
}

.funded-dialog h2 {
  color: #3dd68c;
}

.rule.highlight {
  background: rgba(0, 168, 255, 0.12);
  border-color: rgba(0, 168, 255, 0.35);
}

.rule.highlight dd {
  color: var(--accent-bright);
}

.overnight {
  margin-top: 0.85rem;
  padding: 0.95rem 1rem;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(0, 168, 255, 0.14);
  border-radius: var(--radius-sm);
  align-self: stretch;
}

@supports not (grid-template-rows: subgrid) {
  .account-block {
    display: flex;
    flex-direction: column;
    grid-row: auto;
  }

  .account-header,
  .account-header-split {
    min-height: 5.85rem;
  }
}

.overnight strong {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.overnight p {
  margin: 0;
  max-width: 34rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.auth-overlay[hidden] {
  display: none !important;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: min(88vh, 760px);
  overflow-y: auto;
  padding: 1.75rem 1.75rem 1.5rem;
  background:
    linear-gradient(180deg, rgba(0, 168, 255, 0.08), transparent 40%),
    rgba(8, 14, 22, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  animation: rise 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-close {
  position: absolute;
  top: 0.85rem;
  right: 0.95rem;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.auth-close:hover {
  color: var(--ink);
  background: rgba(0, 168, 255, 0.12);
}

.auth-card-title {
  margin: 0 2rem 1.35rem 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent-bright);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-panel,
.signup-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

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

.field span {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.field input {
  width: 100%;
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(0, 168, 255, 0.2);
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.45);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
  color: rgba(138, 164, 189, 0.45);
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.12);
}

.google-terms-gate .auth-note {
  margin: 0 0 1rem;
}

.terms-row {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.read-btn {
  appearance: none;
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(0, 168, 255, 0.4);
  border-radius: var(--radius-xs);
  background: rgba(0, 168, 255, 0.08);
  color: var(--accent-bright);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.read-btn:hover {
  background: rgba(0, 168, 255, 0.16);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--ink-muted);
  cursor: pointer;
}

.check input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.check input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.check:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.85;
}

.terms-hint {
  display: block;
  margin-top: 0.35rem;
  font-style: normal;
  font-size: 0.72rem;
  color: rgba(138, 164, 189, 0.9);
}

.terms-hint.is-done {
  color: var(--accent-bright);
}

.terms-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.terms-modal[hidden] {
  display: none;
}

.terms-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 12, 0.86);
}

.terms-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(82vh, 720px);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 168, 255, 0.1), transparent 28%),
    rgba(8, 14, 22, 0.98);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.terms-header {
  padding: 1.25rem 1.35rem 1rem;
  border-bottom: 1px solid rgba(0, 168, 255, 0.16);
}

.terms-header h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--accent-bright);
}

.terms-header p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.terms-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.15rem 1.35rem;
  overscroll-behavior: contain;
}

.terms-body h3 {
  margin: 1.25rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.terms-body h3:first-child {
  margin-top: 0;
}

.terms-body p,
.terms-body li {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--ink-muted);
}

.terms-body ul {
  margin: 0.4rem 0 0;
  padding-left: 1.15rem;
}

.terms-body li {
  margin-bottom: 0.35rem;
}

.terms-body strong {
  color: var(--ink);
  font-weight: 500;
}

.terms-end {
  margin: 2rem 0 0.5rem;
  text-align: center;
  font-size: 0.78rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bright) !important;
}

.terms-footer {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.35rem 1.25rem;
  border-top: 1px solid rgba(0, 168, 255, 0.16);
}

.terms-scroll-hint {
  margin: 0;
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.terms-scroll-hint.is-ready {
  color: var(--accent-bright);
}

.terms-dismiss {
  appearance: none;
  width: 100%;
  padding: 0.95rem 1.1rem;
  border: 0;
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 45%, var(--accent-deep) 100%);
  color: #031018;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.terms-dismiss:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.4);
  transform: none;
}

.terms-dismiss:not(:disabled):hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

body.terms-open {
  overflow: hidden;
}

.submit-btn {
  margin-top: 0.35rem;
  appearance: none;
  border: 0;
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 45%, var(--accent-deep) 100%);
  color: #031018;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 30px rgba(0, 168, 255, 0.18);
}

.submit-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 14px 36px rgba(0, 168, 255, 0.28);
}

.submit-btn:active {
  transform: translateY(0);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0.15rem 0;
  color: var(--ink-muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 168, 255, 0.18);
}

.google-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-xs);
  background: #111111;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.google-btn:hover {
  background: #181818;
  border-color: rgba(0, 168, 255, 0.35);
  transform: translateY(-1px);
}

.google-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.form-foot {
  margin: 0.15rem 0 0;
  text-align: center;
  font-size: 0.82rem;
}

.field-optional {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-muted);
  text-transform: none;
  letter-spacing: 0;
}

.auth-promo-note {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.72rem;
  line-height: 1.4;
}

.trade-plan-promo {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.35rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trade-plan-promo input {
  appearance: none;
  width: 100%;
  max-width: 16rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(0, 168, 255, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(8, 14, 22, 0.92);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trade-plan-promo-hint {
  margin: 0 0 1rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.auth-note {
  margin: 1.35rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 168, 255, 0.12);
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

.form-error {
  margin: 0;
  font-size: 0.8rem;
  color: var(--danger);
}

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

@media (max-width: 900px) {
  .tagline:not(.tagline-no-rules) {
    white-space: normal;
  }

  .shell {
    align-items: flex-start;
    padding-top: 0.85rem;
    padding-bottom: 3rem;
  }

  .brand {
    font-size: clamp(2.8rem, 12vw, 4rem);
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .account-header-split {
    flex-direction: column;
    align-items: stretch;
  }

  .rules-phase-toggle,
  .account-capital-holder {
    align-self: flex-start;
  }

  .legal-grid {
    grid-template-columns: 1fr;
  }
}

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

  .field-row {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    gap: 0.4rem;
  }

  .nav-btn {
    padding: 0.55rem 0.75rem;
    font-size: 0.68rem;
  }

  .auth-card {
    padding: 1.35rem 1.15rem 1.25rem;
  }
}

.trade-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  contain: layout paint;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #d1d4dc;
}

.trade-screen[hidden] {
  display: none !important;
}

.trade-screen-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  min-height: 3rem;
  padding: 0.45rem 0.85rem;
  background: #000;
  border-bottom: 1px solid #2a2e39;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.trade-screen-bar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: min(100%, 42rem);
  flex: 1 1 42rem;
  flex-wrap: nowrap;
}

.trade-screen-bar-left.trade-account-metrics {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  column-gap: clamp(0.35rem, 1vw, 1.25rem);
  row-gap: 0;
  flex: 1 1 auto;
  width: auto;
  max-width: 100%;
  min-width: min(100%, 40rem);
}

.trade-metric {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  max-width: none;
}

.trade-metric-label {
  font-size: clamp(0.46rem, 1.15vw, 0.58rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #787b86;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-metric-value {
  font-size: clamp(0.64rem, 1.6vw, 0.82rem);
  font-weight: 600;
  color: #d1d4dc;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-metric-value.is-up {
  color: #26a69a;
}

.trade-metric-value.is-down {
  color: #ef5350;
}

.trade-chart-chrome {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 3;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  pointer-events: auto;
}

.trade-symbol-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.trade-symbol-btn {
  appearance: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: rgba(30, 34, 45, 0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.trade-symbol-btn:hover {
  border-color: rgba(0, 168, 255, 0.4);
}

.trade-symbol-btn.is-active {
  background: rgba(0, 168, 255, 0.12);
  border-color: rgba(0, 168, 255, 0.4);
}

.trade-symbol-btn {
  align-items: center;
}

.trade-symbol-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  color: #fff;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.trade-symbol-badge.is-es {
  background: #e0334c;
}

.trade-symbol-badge.is-nq {
  background: #2962ff;
}

.trade-symbol-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.trade-symbol-meta {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

.trade-interval-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  padding: 0.12rem;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: rgba(30, 34, 45, 0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.trade-interval-favorites {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
}

.trade-interval,
.trade-interval-add {
  appearance: none;
  border: 0;
  background: transparent;
  color: #787b86;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.42rem;
  border-radius: 4px;
  cursor: pointer;
}

.trade-interval-add {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.22rem 0.4rem;
  color: #b2b5be;
}

.trade-interval:hover,
.trade-interval-add:hover {
  color: #d1d4dc;
  background: rgba(255, 255, 255, 0.04);
}

.trade-interval.is-active,
.trade-interval-add.is-open {
  color: #00a8ff;
  background: rgba(0, 168, 255, 0.12);
}

.trade-interval-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 20;
  width: 15.5rem;
  max-height: min(22rem, 70vh);
  overflow: auto;
  padding: 0.45rem 0 0.55rem;
  border: 1px solid #2a2e39;
  border-radius: 8px;
  background: #1e222d;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.trade-interval-menu-head {
  padding: 0.15rem 0.75rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #787b86;
}

.trade-interval-menu-list {
  display: flex;
  flex-direction: column;
}

.trade-interval-menu-row {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  align-items: center;
  gap: 0.15rem;
  width: 100%;
  padding: 0.05rem 0.35rem;
}

.trade-interval-star {
  appearance: none;
  border: 0;
  background: transparent;
  color: #4c525e;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.35rem;
  border-radius: 4px;
  cursor: pointer;
}

.trade-interval-star.is-on {
  color: #f0b90b;
}

.trade-interval-star:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f0b90b;
}

.trade-interval-menu-pick {
  appearance: none;
  border: 0;
  background: transparent;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: left;
  padding: 0.4rem 0.35rem;
  border-radius: 4px;
  cursor: pointer;
}

.trade-interval-menu-pick:hover {
  background: rgba(0, 168, 255, 0.1);
  color: #fff;
}

.trade-interval-menu-pick.is-active {
  color: #00a8ff;
}

.trade-interval-menu-meta {
  display: none;
}

.trade-interval-menu-divider {
  height: 1px;
  margin: 0.45rem 0.75rem;
  background: #2a2e39;
}

.trade-interval-custom {
  padding: 0 0.75rem;
}

.trade-interval-custom-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #787b86;
}

.trade-interval-custom-row {
  display: grid;
  grid-template-columns: 3.25rem 1fr auto;
  gap: 0.3rem;
}

.trade-interval-custom-row input,
.trade-interval-custom-row select {
  appearance: none;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  background: #131722;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.75rem;
  padding: 0.35rem 0.4rem;
}

.trade-interval-custom-add {
  appearance: none;
  border: 1px solid rgba(0, 168, 255, 0.35);
  border-radius: 4px;
  background: rgba(0, 168, 255, 0.14);
  color: #00a8ff;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.trade-interval-custom-add:hover {
  background: rgba(0, 168, 255, 0.22);
}

.trade-style-group {
  position: relative;
}

.trade-ind-group {
  position: relative;
}

.trade-ind-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.5rem;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: rgba(30, 34, 45, 0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.trade-ind-trigger:hover,
.trade-ind-trigger.is-open {
  border-color: rgba(0, 168, 255, 0.4);
  color: #00a8ff;
}

.trade-ind-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 22;
  width: 19rem;
  max-height: min(34rem, 80vh);
  overflow: auto;
  padding: 0.45rem 0 0.55rem;
  border: 1px solid #2a2e39;
  border-radius: 8px;
  background: #1e222d;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.trade-ind-panel {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.55rem 0.35rem;
}

.trade-ind-section-label {
  padding: 0.35rem 0.75rem 0.15rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #787b86;
}

.trade-ind-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.35rem 0.25rem 0.45rem;
  border-radius: 6px;
}

.trade-ind-block:hover {
  background: rgba(255, 255, 255, 0.03);
}

.trade-ind-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.trade-ind-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.trade-ind-toggle input {
  accent-color: #00a8ff;
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
}

.trade-ind-swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.trade-ind-remove {
  appearance: none;
  border: 0;
  background: transparent;
  color: #787b86;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.trade-ind-remove:hover {
  background: rgba(239, 83, 80, 0.12);
  color: #ef5350;
}

.trade-ind-params {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  padding-left: 1.35rem;
}

.trade-ind-param {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #787b86;
  font-size: 0.68rem;
  font-weight: 600;
}

.trade-ind-param input[type="number"],
.trade-ind-param select {
  appearance: none;
  width: 3.6rem;
  padding: 0.22rem 0.3rem;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  background: #131722;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.72rem;
}

.trade-ind-param select {
  width: 4.4rem;
}

.trade-ind-param input[type="number"]:focus,
.trade-ind-param select:focus {
  outline: none;
  border-color: rgba(0, 168, 255, 0.55);
}

.trade-ind-empty {
  padding: 0.35rem 0.3rem 0.55rem;
  font-size: 0.72rem;
  color: #787b86;
}

.trade-ind-catalog {
  display: flex;
  flex-direction: column;
  padding: 0.1rem 0.55rem 0.25rem;
  gap: 0.1rem;
}

.trade-ind-catalog-group {
  padding: 0.4rem 0.2rem 0.15rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #787b86;
}

.trade-ind-add {
  appearance: none;
  border: 0;
  background: transparent;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: left;
  padding: 0.42rem 0.45rem;
  border-radius: 5px;
  cursor: pointer;
}

.trade-ind-add:hover {
  background: rgba(0, 168, 255, 0.1);
  color: #00a8ff;
}

.trade-style-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.5rem;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: rgba(30, 34, 45, 0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.trade-style-trigger:hover,
.trade-style-trigger.is-open {
  border-color: rgba(0, 168, 255, 0.4);
  color: #00a8ff;
}

.trade-style-trigger-icon,
.trade-style-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  color: #d1d4dc;
  line-height: 0;
}

.trade-style-trigger-icon .tv-ico,
.trade-style-option-icon .tv-ico {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
}

.trade-style-option:hover .trade-style-option-icon,
.trade-style-option.is-active .trade-style-option-icon,
.trade-style-trigger:hover .trade-style-trigger-icon,
.trade-style-trigger.is-open .trade-style-trigger-icon {
  color: inherit;
}

.trade-style-caret {
  font-size: 0.6rem;
  opacity: 0.7;
}

.trade-style-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 20;
  min-width: 11.5rem;
  padding: 0.35rem;
  border: 1px solid #2a2e39;
  border-radius: 8px;
  background: #1e222d;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.trade-style-option {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  text-align: left;
  padding: 0.45rem 0.5rem;
  cursor: pointer;
}

.trade-style-option:hover {
  background: rgba(0, 168, 255, 0.1);
  color: #fff;
}

.trade-style-option.is-active {
  color: #00a8ff;
  background: rgba(0, 168, 255, 0.12);
}

.trade-settings {
  position: absolute;
  top: 0.55rem;
  right: 4.95rem; /* inside the plot, left of the price scale */
  z-index: 4;
  pointer-events: auto;
}

.trade-settings-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: rgba(30, 34, 45, 0.92);
  color: #b2b5be;
  cursor: pointer;
}

.trade-settings-btn:hover,
.trade-settings-btn.is-open {
  color: #fff;
  border-color: rgba(0, 168, 255, 0.4);
}

.trade-chart-trade-wrap {
  position: absolute;
  top: 0.55rem;
  right: 7.1rem; /* left of the gear, clear of price scale */
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  pointer-events: auto;
}

.trade-chart-trade-btns {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.trade-chart-tpsl {
  /* Overlay the Buy / Size / Sell row */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: #1e222d;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

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

.trade-chart-tpsl-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.trade-chart-tpsl-field .trade-chart-tpsl-caption {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #787b86;
}

.trade-chart-tpsl-input {
  position: relative;
  display: block;
}

.trade-chart-tpsl-input input {
  padding-right: 1.95rem !important;
}

.trade-chart-tpsl-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(0.45rem + 1px);
  right: 1.95rem;
  display: flex;
  align-items: center;
  overflow: hidden;
  pointer-events: none;
  white-space: pre;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
}

.trade-chart-tpsl-mirror {
  visibility: hidden;
  font-variant-numeric: tabular-nums;
}

.trade-chart-tpsl-mirror:not(:empty) + .trade-chart-tpsl-unit {
  margin-left: 0.3rem;
}

.trade-chart-tpsl-unit {
  color: #787b86;
}

.trade-chart-tpsl-dollar {
  margin-left: auto; /* pinned right, just before the info icon */
  padding-left: 0.4rem;
  font-variant-numeric: tabular-nums;
}

/* Typed points + parentheses stay white; only the dollar amount is colored */
.trade-chart-tpsl-dollar {
  color: #fff;
}

#trade-order-tp ~ .trade-chart-tpsl-overlay .trade-chart-tpsl-amt {
  color: #26a69a;
}

#trade-order-sl ~ .trade-chart-tpsl-overlay .trade-chart-tpsl-amt {
  color: #ef5350;
}

.trade-chart-tpsl-info {
  appearance: none;
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--accent-bright);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.trade-chart-tpsl-info svg {
  width: 100%;
  height: 100%;
  display: block;
}

.trade-chart-tpsl-info:hover,
.trade-chart-tpsl-info[aria-expanded="true"] {
  color: var(--accent);
  background: rgba(0, 168, 255, 0.12);
}

.trade-points-info {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: #1e222d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  color: #d1d4dc;
  font-size: 0.74rem;
  line-height: 1.4;
}

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

.trade-points-info strong {
  display: block;
  margin-bottom: 0.3rem;
  color: #fff;
  font-size: 0.78rem;
}

.trade-points-info p {
  margin: 0.15rem 0 0;
}

.trade-points-info b {
  color: #00a8ff;
}

.trade-chart-tpsl-field input {
  appearance: none;
  width: 100%;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  background: #131722;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.45rem;
  font-variant-numeric: tabular-nums;
}

.trade-chart-tpsl-save {
  appearance: none;
  margin-top: 0.1rem;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 4px;
  background: #00a8ff;
  color: #04121c;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.trade-chart-tpsl-save:hover {
  background: #33bbff;
}

.trade-chart-tpsl-field input:focus {
  outline: none;
  border-color: rgba(0, 168, 255, 0.45);
}

.trade-chart-trade-wrap .trade-ticket-error {
  margin: 0;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  background: rgba(239, 83, 80, 0.14);
  border: 1px solid rgba(239, 83, 80, 0.35);
  color: #ef5350;
  font-size: 0.72rem;
  font-weight: 600;
}

.trade-chart-trade-btn {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.1rem;
  min-width: 5.75rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-body);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.trade-chart-trade-btn.is-sell {
  background: rgba(239, 83, 80, 0.88);
  border-color: rgba(239, 83, 80, 0.95);
  color: #fff;
}

.trade-chart-trade-btn.is-buy {
  background: rgba(38, 166, 154, 0.88);
  border-color: rgba(38, 166, 154, 0.95);
  color: #fff;
}

.trade-chart-trade-btn.is-sell:hover {
  background: #ef5350;
}

.trade-chart-trade-btn.is-buy:hover {
  background: #26a69a;
}

.trade-chart-trade-side {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.9;
}

.trade-chart-trade-price {
  min-width: 4.6ch;
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.trade-chart-size-holder {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  min-width: 4.75rem;
  min-height: 2.35rem;
  padding: 0.28rem 0.5rem 0.32rem;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: rgba(30, 34, 45, 0.95);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  cursor: text;
}

.trade-chart-size-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #787b86;
  line-height: 1;
  pointer-events: none;
}

.trade-chart-size-unit {
  font-size: 0.88rem;
  font-weight: 700;
  color: #d1d4dc;
  line-height: 1.15;
  pointer-events: none;
}

.trade-chart-size-amount {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 6.5rem;
  height: 1.15rem;
  line-height: 1.15rem;
}

.trade-chart-size-dollar {
  display: block;
  flex: 0 0 auto;
  height: 1.15rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15rem;
  pointer-events: none;
}

.trade-chart-size-input {
  appearance: none;
  display: block;
  flex: 0 1 auto;
  min-width: 1.5rem;
  width: 3.25rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  caret-color: #00a8ff;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.trade-chart-size-holder.is-filled .trade-chart-size-unit,
.trade-chart-size-holder.is-editing .trade-chart-size-unit {
  display: none;
}

.trade-chart-size-holder.is-filled .trade-chart-size-amount,
.trade-chart-size-holder.is-editing .trade-chart-size-amount {
  display: inline-flex;
}

.trade-screen-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.trade-save-layout {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.15rem;
  padding: 0 0.8rem;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: #1e222d;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
}

.trade-save-layout:hover {
  border-color: rgba(0, 168, 255, 0.45);
  color: #fff;
}

.trade-save-layout.is-saved {
  border-color: rgba(38, 166, 154, 0.6);
  color: #26a69a;
}

.trade-profile {
  position: relative;
  flex-shrink: 0;
}

.trade-profile-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1px solid #2a2e39;
  border-radius: 50%;
  background: #1e222d;
  color: #d1d4dc;
  cursor: pointer;
}

.trade-profile-btn:hover,
.trade-profile-btn.is-open {
  border-color: rgba(0, 168, 255, 0.45);
  color: #fff;
}

.trade-profile-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 30;
  min-width: 12rem;
  padding: 0.35rem;
  border: 1px solid #2a2e39;
  border-radius: 8px;
  background: #1e222d;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

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

.trade-profile-email {
  padding: 0.4rem 0.5rem 0.5rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid #2a2e39;
  color: #787b86;
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-profile-item {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 0.15rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.trade-profile-item:hover {
  background: rgba(0, 168, 255, 0.12);
  color: #fff;
}

.trade-profile-switch {
  display: flex;
  flex-direction: column;
  margin: 0.2rem 0 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.trade-profile-item.is-current {
  color: var(--accent);
  cursor: default;
}

.trade-profile-item.is-current:hover {
  background: transparent;
  color: var(--accent);
}

.trade-profile-logout {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0.5rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #ef5350;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.trade-profile-logout:hover {
  background: rgba(239, 83, 80, 0.12);
}

.trade-screen-close {
  appearance: none;
  border: 1px solid #2a2e39;
  background: #1e222d;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
}

.trade-screen-close:hover {
  border-color: rgba(0, 168, 255, 0.45);
  color: #fff;
}

.trade-screen-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

.trade-chart-wrap {
  position: relative;
  contain: layout paint;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: #000;
}

#local_chart,
#local_chart_crosshair {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#local_chart {
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

#local_chart:active {
  cursor: grabbing;
}

#local_chart_crosshair {
  pointer-events: none;
  z-index: 1;
}

.trade-chart-error {
  margin: 0;
  padding: 1.5rem;
  color: #8aa4bd;
  font-size: 0.9rem;
}

.trade-side-panel {
  display: flex;
  flex-direction: column;
  background: #131722;
  border-left: 1px solid #2a2e39;
  min-height: 0;
  overflow: hidden;
}

.trade-side-tabs {
  display: flex;
  border-bottom: 1px solid #2a2e39;
}

.trade-side-tab {
  flex: 1;
  appearance: none;
  border: 0;
  background: transparent;
  color: #787b86;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.75rem 0.5rem;
  cursor: pointer;
}

.trade-side-tab.is-active {
  color: #d1d4dc;
  box-shadow: inset 0 -2px 0 #00a8ff;
}

.trade-order-ticket {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.9rem;
  overflow: auto;
}

.trade-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #787b86;
}

.trade-field input,
.trade-field select {
  appearance: none;
  width: 100%;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: #1e222d;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.65rem 0.7rem;
  outline: none;
}

.trade-field input:focus,
.trade-field select:focus {
  border-color: rgba(0, 168, 255, 0.55);
}

.trade-side-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.trade-side-btn {
  appearance: none;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: #1e222d;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.6rem 0.4rem;
  cursor: pointer;
}

.trade-side-btn.is-buy.is-active {
  background: rgba(38, 166, 154, 0.22);
  border-color: #26a69a;
  color: #26a69a;
}

.trade-side-btn.is-sell.is-active {
  background: rgba(239, 83, 80, 0.22);
  border-color: #ef5350;
  color: #ef5350;
}

.trade-submit-btn {
  appearance: none;
  margin-top: 0.25rem;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 45%, var(--accent-deep) 100%);
  color: #031018;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.8rem 0.75rem;
  cursor: pointer;
}

.trade-ticket-note {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  color: #787b86;
}

.trade-ticket-error {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  color: #ef5350;
}

.trade-positions-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.9rem;
  overflow: auto;
  min-height: 0;
  flex: 1;
}

.trade-account-summary {
  display: grid;
  gap: 0.4rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: #1e222d;
}

.trade-account-summary div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.72rem;
  color: #787b86;
}

.trade-account-summary strong {
  color: #d1d4dc;
  font-weight: 600;
}

.trade-positions-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.trade-positions-empty {
  margin: 0;
  font-size: 0.75rem;
  color: #787b86;
}

.trade-position-card {
  padding: 0.7rem 0.75rem;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: #1e222d;
}

.trade-position-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.trade-position-card p {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  color: #b2b5be;
}

.trade-position-side {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.trade-position-side.buy {
  color: #26a69a;
}

.trade-position-side.sell {
  color: #ef5350;
}

.trade-close-position {
  appearance: none;
  margin-top: 0.35rem;
  border: 1px solid #2a2e39;
  border-radius: 5px;
  background: transparent;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}

.trade-close-position:hover {
  border-color: rgba(0, 168, 255, 0.45);
  color: #fff;
}

@media (max-width: 900px) {
  .trade-screen-body {
    grid-template-columns: minmax(0, 1fr);
  }
}

#trade-metric-drawdown {
  color: #fff;
}

#trade-metric-drawdown .trade-dd-used {
  color: #ef5350;
}

#trade-metric-payout {
  color: #fff;
}

#trade-metric-payout .trade-po-used {
  color: #26a69a;
}

#trade-metric-daily-profit {
  color: #fff;
}

#trade-metric-daily-profit .trade-dp-used {
  color: #26a69a;
}

.trade-account-btn {
  align-self: center;
}

.trade-metric {
  position: relative;
}

/* Same width as other metrics; values stay compact under the shared title slot */
.trade-metric-progress {
  align-items: flex-start;
}

.trade-metric-progress .trade-metric-label {
  width: 100%;
  text-align: left;
}

.trade-metric-progress .trade-metric-value-row {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: auto;
  max-width: 100%;
}

/* Compact $used / $limit so the group shares the same left edge as the label */
.trade-metric-split {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  width: auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.trade-metric-used {
  text-align: left;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
}

.trade-metric-sep {
  flex-shrink: 0;
  color: #787b86;
}

.trade-metric-limit {
  text-align: left;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.trade-metric > .trade-metric-label,
.trade-metric-head {
  display: flex;
  align-items: center;
  height: 0.95rem;
  line-height: 1;
}

.trade-metric-head {
  gap: 0.3rem;
  max-width: 100%;
}

.trade-metric-head .trade-metric-label {
  flex: 0 1 auto;
  width: auto;
}

.trade-metric-value-row {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.trade-metric-info {
  appearance: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--accent-bright);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
}

.trade-metric-info svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* No sticky highlight after click/tap; hover only on real pointer devices */
.trade-metric-info:focus,
.trade-metric-info:focus-visible,
.trade-metric-info:active,
.trade-metric-info[aria-expanded="true"] {
  outline: none;
  color: var(--accent-bright);
  background: transparent;
}

.trade-metric-info:hover {
  color: var(--accent-bright);
  background: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .trade-metric-info:hover {
    color: var(--accent);
    background: rgba(0, 168, 255, 0.12);
  }
}

.trade-metric-pop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 15.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: #1e222d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  color: #d1d4dc;
  font-size: 0.74rem;
  line-height: 1.45;
  white-space: normal;
}

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

.trade-metric-pop strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #fff;
  font-size: 0.78rem;
}

.trade-metric-pop p {
  margin: 0;
}

.trade-metric-pop p + p {
  margin-top: 0.45rem;
}

/* Account button: shows the account type in the same style as the account cards */
.trade-account-btn {
  padding: 0 0.85rem;
  font-size: 0.9rem;
}

.trade-account-type {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1;
}

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

.trade-account-type.is-eval {
  font-size: 0.95rem;
  letter-spacing: 0;
  white-space: nowrap;
  gap: 0.4rem;
}

.trade-account-type.is-eval .tier-badge {
  flex-shrink: 0;
}

.trade-chart-chrome .trade-save-layout {
  height: auto;
  padding: 0.28rem 0.6rem;
  background: rgba(30, 34, 45, 0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.trade-account-btn {
  gap: 0.5rem;
}

.trade-account-label {
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.trade-account-btn.is-add-account .trade-account-label {
  display: none;
}

.trade-account-type.is-add {
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Plan picker when there is no active account */
.trade-plan-modal {
  position: absolute;
  inset: 0;
  z-index: 92;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0.85rem clamp(0.65rem, 1.5vw, 1rem) 1.25rem;
  overflow: auto;
}

.trade-plan-modal[hidden] {
  display: none !important;
}

.trade-plan-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.trade-plan-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.trade-plan-panel .trade-account-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
}

.trade-plan-title {
  margin: 0 2.5rem 0.85rem 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--accent-bright);
}

.trade-plan-grid.account-grid {
  margin: 0;
  width: 100%;
}

/* Static clones — no entry rise / electric loops (those make Add account feel laggy) */
.trade-plan-grid .account-block {
  animation: none;
  backdrop-filter: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.trade-plan-grid .card-edge-spark,
.trade-plan-grid .bolt-spark,
.trade-plan-grid .instant-title-spark {
  animation: none !important;
  will-change: auto;
  opacity: 0;
}

/* Account card (opened from the Account button) */
.trade-account-modal {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.trade-account-modal[hidden] {
  display: none !important;
}

.trade-account-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.trade-account-card {
  display: flex;
  flex-direction: column;
  grid-row: auto;
  grid-template-rows: none;
  gap: 1rem;
  width: min(400px, 100%);
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  z-index: 1;
  animation: none;
  backdrop-filter: none;
  background:
    linear-gradient(165deg, rgba(0, 168, 255, 0.1), transparent 42%),
    #080e16;
}

.trade-account-card .card-edge-spark,
.trade-account-card .bolt-spark,
.trade-account-card .instant-title-spark {
  animation: none !important;
  will-change: auto;
  opacity: 0;
}

.trade-account-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
}

.trade-account-header .account-label {
  margin: 0;
}

.trade-account-header h2[hidden] {
  display: none;
}

.trade-account-header h2 .tier-badge {
  flex-shrink: 0;
}

.trade-account-rules {
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
  gap: 0.6rem;
  flex: none;
}

.trade-account-rules .rule {
  min-height: 3.6rem;
}

.trade-account-rules .rule dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.trade-account-rules .rule dd.is-up {
  color: #26a69a;
}

.trade-account-rules .rule dd.is-down {
  color: #ef5350;
}

.trade-request-payout {
  width: 100%;
  min-height: 2.75rem;
}

.trade-account-close {
  appearance: none;
  position: absolute;
  top: 0.85rem;
  right: 0.9rem;
  z-index: 4;
  width: 1.9rem;
  height: 1.9rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.trade-account-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Account card layout: header + rows (scrollable if short screen) + payout pinned at the very bottom */
.trade-account-card {
  overflow: visible;
  gap: 0.85rem;
}

.trade-account-header {
  margin: 0;
  min-height: 0;
  padding-bottom: 0.75rem;
  flex: 0 0 auto;
}

.trade-account-rules {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.trade-request-payout {
  flex: 0 0 auto;
  margin-top: auto;
}

/* Request payout: dark button */
.trade-request-payout {
  background: #0b1219;
  color: var(--accent-bright);
  border: 1px solid rgba(0, 168, 255, 0.28);
}

.trade-request-payout:hover {
  background: #101b26;
  color: #fff;
  border-color: rgba(0, 168, 255, 0.5);
}

/* Request payout: charcoal, almost black */
.trade-request-payout {
  background: #17181b;
  color: var(--accent-bright);
  border: 1px solid #25272c;
}

.trade-request-payout:hover {
  background: #1e2024;
  color: #fff;
  border-color: #33363c;
}

/* Request payout: Instant Funded title style; grey until payout requirements are met */
.trade-request-payout {
  background: #17181b;
  border: 1px solid #25272c;
  color: var(--accent);
  min-height: 2.9rem;
}

.trade-payout-svg {
  height: 1.2rem;
  width: auto;
  color: var(--accent);
}

.trade-request-payout.is-locked {
  cursor: not-allowed;
}

.trade-request-payout.is-locked .trade-payout-svg {
  color: #787b86;
}

.trade-request-payout.is-locked .instant-title-glow,
.trade-request-payout.is-locked .instant-title-edge,
.trade-request-payout.is-locked .instant-title-spark {
  display: none;
}

.trade-request-payout.is-locked .instant-title-fill {
  fill: #787b86;
}

.trade-request-payout.is-locked:hover {
  background: #17181b;
  border-color: #25272c;
  transform: none;
}

.trade-request-payout,
.trade-payout-svg text {
  text-transform: none;
  letter-spacing: 0.01em;
}

.trade-bank-btn {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #25272c;
  background: transparent;
  color: #c9cdd3;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.trade-bank-btn:hover {
  border-color: #33363c;
  color: #fff;
}

.payout-card-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.payout-card-frame {
  height: 2.75rem;
}

#payout-card-save {
  width: 100%;
}

.trade-bank-note {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #9aa0a8;
  text-align: center;
}

/* Profit target (eval accounts): same format as drawdown, progress in green */
.trade-metric[hidden],
.trade-account-rules .rule[hidden] {
  display: none;
}

#trade-metric-target,
#acct-target {
  color: #fff;
}

.trade-pt-used {
  color: #26a69a;
}

/* Get Started (Instant + Eval cards): charcoal, almost black — matches Request payout */
.get-started-btn {
  background: #17181b;
  color: var(--accent);
  border: 1px solid #25272c;
}

.get-started-btn:hover {
  background: #1e2024;
  color: var(--accent-bright);
  border-color: #33363c;
}

.trade-request-payout.is-locked:hover {
  background: #17181b;
  color: #787b86;
  border-color: #25272c;
}

/* Top-bar buttons (Save layout / Close all): no sticky highlight after click or tap */
.trade-save-layout {
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
}

.trade-save-layout:focus,
.trade-save-layout:focus-visible,
.trade-save-layout:active {
  outline: none;
  border-color: #2a2e39;
  color: #d1d4dc;
}

.trade-save-layout.is-saved:focus,
.trade-save-layout.is-saved:focus-visible,
.trade-save-layout.is-saved:active {
  border-color: rgba(38, 166, 154, 0.6);
  color: #26a69a;
}

/* Hover highlight only on devices that truly hover (avoids sticky hover after touch) */
.trade-save-layout:hover {
  border-color: #2a2e39;
  color: #d1d4dc;
}

.trade-save-layout.is-saved:hover {
  border-color: rgba(38, 166, 154, 0.6);
  color: #26a69a;
}

@media (hover: hover) and (pointer: fine) {
  .trade-save-layout:hover {
    border-color: rgba(0, 168, 255, 0.45);
    color: #fff;
  }

  .trade-save-layout.is-saved:hover {
    border-color: rgba(38, 166, 154, 0.6);
    color: #26a69a;
  }
}

/* TP/SL info popover: separate "Partial close" explanation */
.trade-points-info-section {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid #2a2e39;
}

/* Limit-order popover opened from the chart "+" button */
.trade-limit-pop {
  position: absolute;
  z-index: 6;
  box-sizing: border-box;
  padding: 0.7rem 0.75rem 0.75rem;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: #1e222d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  color: #d1d4dc;
  font-size: 0.74rem;
}

.trade-limit-pop-title {
  display: block;
  color: #fff;
  font-size: 0.8rem;
}

.trade-limit-pop-price {
  margin: 0.2rem 0 0.55rem;
  color: #9aa0ad;
}

.trade-limit-pop-price b {
  color: #fff;
}

.trade-limit-pop-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.trade-limit-pop-field span {
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #787b86;
}

.trade-limit-pop-field input {
  appearance: none;
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.55rem;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  background: #131722;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  outline: none;
}

.trade-limit-pop-field input:focus {
  border-color: #00a8ff;
}

.trade-limit-pop-submit {
  appearance: none;
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 4px;
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.trade-limit-pop-submit.is-buy {
  background: #26a69a;
}

.trade-limit-pop-submit.is-sell {
  background: #ef5350;
}

.trade-limit-pop-error {
  margin: 0.5rem 0 0;
  color: #ef5350;
  line-height: 1.3;
}

.trade-limit-pop-error[hidden] {
  display: none;
}

/* "+" popover: set TP / SL on the open position */
.trade-limit-pop-levels {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.65rem;
  padding-top: 0.6rem;
  border-top: 1px solid #2a2e39;
}

.trade-limit-pop-levels[hidden] {
  display: none;
}

.trade-limit-pop-levels-title {
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #787b86;
}

.trade-limit-pop-level {
  appearance: none;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  background: #131722;
  color: #d1d4dc;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.trade-limit-pop-level b {
  color: #fff;
}

.trade-limit-pop-level.is-tp {
  border-color: rgba(38, 166, 154, 0.55);
  color: #26a69a;
}

.trade-limit-pop-level.is-sl {
  border-color: rgba(239, 83, 80, 0.55);
  color: #ef5350;
}

.trade-limit-pop-level:hover {
  background: #1e222d;
}

.trade-limit-pop-levels {
  margin-top: 0.55rem;
  padding-top: 0;
  border-top: 0;
}

.trade-limit-pop-hint {
  margin: 0.4rem 0 0;
  font-size: 0.66rem;
  line-height: 1.3;
  color: #787b86;
}

.trade-limit-pop-hint[hidden] {
  display: none;
}

/* Close "X" buttons: the cross is drawn with CSS so it is exactly centred in its holder */
.auth-close,
.trade-account-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 0;
  line-height: 0;
  border-radius: 8px;
}

.trade-account-close {
  border-radius: 999px;
}

.auth-close {
  top: 0.75rem;
  right: 0.8rem;
}

.auth-close::before,
.auth-close::after,
.trade-account-close::before,
.trade-account-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  margin: -1px 0 0 -7px;
  border-radius: 1px;
  background: currentColor;
}

.auth-close::before,
.trade-account-close::before {
  transform: rotate(45deg);
}

.auth-close::after,
.trade-account-close::after {
  transform: rotate(-45deg);
}

.trade-limit-pop-note {
  margin: 0.45rem 0 0.7rem;
  font-size: 0.74rem;
  line-height: 1.45;
  color: #b2b5be;
}

.trade-limit-pop-note b {
  color: #00a8ff;
}

.trade-limit-pop-ok {
  appearance: none;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  background: #1e222d;
  color: #fff;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.trade-limit-pop-ok:hover {
  background: #2a2e39;
}

/* Account-rule notices on the chart */
.trade-rule-notice {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 7;
  box-sizing: border-box;
  width: min(360px, calc(100% - 24px));
  transform: translateX(-50%);
  padding: 0.8rem 0.9rem 0.85rem;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: #1e222d;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
  color: #d1d4dc;
}

.trade-rule-notice.is-breached {
  border-color: rgba(239, 83, 80, 0.7);
}

.trade-rule-notice.is-funded {
  border-color: rgba(38, 166, 154, 0.7);
}

.trade-rule-notice.is-daily-max,
.trade-rule-notice.is-friday {
  border-color: rgba(0, 168, 255, 0.55);
}

.trade-rule-notice-title {
  display: block;
  font-size: 0.82rem;
  color: #fff;
}

.trade-rule-notice-text {
  margin: 0.35rem 0 0.7rem;
  font-size: 0.74rem;
  line-height: 1.45;
  color: #b2b5be;
}

.trade-rule-notice-btn {
  appearance: none;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  background: #131722;
  color: #fff;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.trade-rule-notice-btn:hover {
  background: #2a2e39;
}

/* Guest demo mode: close button instead of the profile, demo tag */
.trade-exit-btn {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1px solid #2a2e39;
  border-radius: 50%;
  background: #1e222d;
  color: #d1d4dc;
  cursor: pointer;
}

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

.trade-exit-btn::before,
.trade-exit-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  margin: -1px 0 0 -7px;
  border-radius: 1px;
  background: currentColor;
}

.trade-exit-btn::before {
  transform: rotate(45deg);
}

.trade-exit-btn::after {
  transform: rotate(-45deg);
}

.trade-exit-btn:hover {
  border-color: rgba(0, 168, 255, 0.45);
  color: #fff;
}

.trade-demo-tag {
  align-self: center;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(0, 168, 255, 0.45);
  border-radius: 999px;
  background: rgba(0, 168, 255, 0.1);
  color: var(--accent-bright);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.trade-screen.is-demo .trade-profile {
  display: none;
}

.trade-screen.is-demo #trade-save-layout {
  display: none;
}

/* ===== Trading journal (monthly P&L calendar) ===== */
body.journal-open {
  overflow: hidden;
}

body.journal-open .page,
body.journal-open .atmosphere {
  visibility: hidden;
}

.journal-screen {
  position: fixed;
  inset: 0;
  z-index: 70; /* above the trade screen (60) so it can open from the profile menu */
  display: flex;
  flex-direction: column;
  background: #000;
  color: #d1d4dc;
}

.journal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid #2a2e39;
  flex-shrink: 0;
}

.journal-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  min-width: 0;
}

.journal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent-bright);
}

.journal-sub {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #787b86;
}

.journal-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.journal-month {
  min-width: 9.5rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.journal-nav-btn,
.journal-today-btn,
.journal-guest-btn {
  appearance: none;
  border: 1px solid #2a2e39;
  background: #1e222d;
  color: #d1d4dc;
  font-family: var(--font-body);
  cursor: pointer;
  border-radius: 6px;
}

.journal-nav-btn {
  width: 2.1rem;
  height: 2.1rem;
  font-size: 1.2rem;
  line-height: 1;
}

.journal-today-btn,
.journal-guest-btn {
  padding: 0.45rem 0.8rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.journal-nav-btn:hover,
.journal-today-btn:hover,
.journal-guest-btn:hover {
  border-color: rgba(0, 168, 255, 0.45);
  color: #fff;
}

.journal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.journal-guest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(0, 168, 255, 0.35);
  border-radius: 8px;
  background: rgba(0, 168, 255, 0.08);
  font-size: 0.85rem;
  color: var(--accent-bright);
}

.journal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.6rem;
}

.journal-stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #2a2e39;
  border-radius: 8px;
  background: #0b0d12;
}

.journal-stat-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #787b86;
}

.journal-stat-value {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
}

.journal-stat-value.is-win,
.journal-day-net.is-win,
.journal-trade-pnl.is-win {
  color: #26a69a;
}

.journal-stat-value.is-loss,
.journal-day-net.is-loss,
.journal-trade-pnl.is-loss {
  color: #ef5350;
}

.journal-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 1rem;
  align-items: start;
}

.journal-calendar-wrap {
  min-width: 0;
  overflow-x: auto;
}

.journal-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(5.8rem, 1fr)) minmax(5.6rem, 0.9fr);
  gap: 0.35rem;
  min-width: 46rem;
}

.journal-dow {
  padding: 0.35rem 0.2rem;
  text-align: center;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #787b86;
}

.journal-cell {
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 5.6rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid #1c2029;
  border-radius: 8px;
  background: #0b0d12;
  color: #d1d4dc;
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
}

.journal-cell.is-empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.journal-cell:not(.is-empty):hover {
  border-color: rgba(0, 168, 255, 0.45);
}

.journal-cell-day {
  font-size: 0.72rem;
  font-weight: 600;
  color: #787b86;
}

.journal-cell-pnl {
  font-size: 0.9rem;
  font-weight: 700;
}

.journal-cell-count {
  font-size: 0.64rem;
  color: #787b86;
  white-space: nowrap;
}

.journal-cell.is-win {
  background: rgba(38, 166, 154, 0.16);
  border-color: rgba(38, 166, 154, 0.45);
}

.journal-cell.is-win .journal-cell-pnl {
  color: #26a69a;
}

.journal-cell.is-loss {
  background: rgba(239, 83, 80, 0.14);
  border-color: rgba(239, 83, 80, 0.45);
}

.journal-cell.is-loss .journal-cell-pnl {
  color: #ef5350;
}

.journal-cell.is-today .journal-cell-day {
  color: var(--accent-bright);
}

.journal-cell.is-today {
  box-shadow: inset 0 0 0 1px rgba(0, 168, 255, 0.55);
}

.journal-cell.is-selected {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.journal-week {
  cursor: default;
  background: #07090d;
}

.journal-day {
  position: sticky;
  top: 0;
  padding: 0.9rem;
  border: 1px solid #2a2e39;
  border-radius: 8px;
  background: #0b0d12;
}

.journal-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.journal-day-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.journal-day-net {
  font-size: 1rem;
}

.journal-day-meta,
.journal-day-empty {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #787b86;
}

.journal-trades {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.7rem;
  max-height: 24rem;
  overflow-y: auto;
}

.journal-trade {
  padding: 0.55rem 0.65rem;
  border: 1px solid #1c2029;
  border-radius: 6px;
  background: #07090d;
}

.journal-trade-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.journal-trade-sym {
  font-weight: 700;
  color: #fff;
}

.journal-trade-side {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}

.journal-trade-side.is-long {
  color: #26a69a;
  background: rgba(38, 166, 154, 0.14);
}

.journal-trade-side.is-short {
  color: #ef5350;
  background: rgba(239, 83, 80, 0.14);
}

.journal-trade-pnl {
  margin-left: auto;
  font-weight: 700;
}

.journal-trade-sub {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: #787b86;
}

@media (max-width: 900px) {
  .journal-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .journal-day {
    position: static;
  }
}

/* Journal calendar cells: day number top-left, P&L centred, win rate centred near the bottom edge */
.journal-cell {
  position: relative;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.journal-cell .journal-cell-day {
  position: absolute;
  top: 0.45rem;
  left: 0.55rem;
}

.journal-cell .journal-cell-count {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.4rem;
  text-align: center;
}

.journal-cell .journal-cell-pnl {
  text-align: center;
}

/* Candle settings (gear in the chart-type dropdown) */
.trade-style-menu {
  min-width: 12.5rem;
}

.trade-style-gear {
  appearance: none;
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #9598a1;
  cursor: pointer;
}

.trade-style-gear:hover,
.trade-style-gear.is-active {
  color: #00a8ff;
  background: rgba(0, 168, 255, 0.14);
}

/* leave room so the first option text never sits under the gear */
.trade-style-menu .trade-style-option:first-of-type {
  padding-right: 2.2rem;
}

.trade-style-menu.is-settings .trade-style-option {
  display: none;
}

.trade-candle-settings {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.35rem 0.4rem 0.4rem;
  font-family: var(--font-body);
  color: #d1d4dc;
}

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

.trade-candle-settings-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9598a1;
  padding-right: 1.8rem;
  min-height: 1.3rem;
  display: flex;
  align-items: center;
}

.trade-candle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
}

.trade-candle-row input[type="color"] {
  appearance: none;
  width: 2rem;
  height: 1.4rem;
  padding: 0;
  border: 1px solid #2a2e39;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.trade-candle-row input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.trade-candle-row input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 2px;
}

.trade-candle-opacity output {
  font-variant-numeric: tabular-nums;
  color: #00a8ff;
  font-weight: 600;
}

.trade-candle-settings input[type="range"] {
  width: 100%;
  accent-color: #00a8ff;
  cursor: pointer;
}

.trade-candle-reset {
  appearance: none;
  align-self: flex-start;
  border: 1px solid #2a2e39;
  border-radius: 5px;
  background: transparent;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.72rem;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
}

.trade-candle-reset:hover {
  border-color: rgba(0, 168, 255, 0.5);
  color: #00a8ff;
}

/* TradingView-style settings cog */
.tv-gear-ico {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
}

/* Settings cog under the price scale (bottom-right corner, like TradingView) */
.trade-chart-wrap {
  --scale-w: 70px;
}

.trade-scale-gear {
  appearance: none;
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--scale-w);
  height: 28px;
  padding: 0;
  border: 0;
  border-top: 1px solid #2a2e39;
  border-left: 1px solid #2a2e39;
  background: #000;
  color: #787b86;
  cursor: pointer;
}

.trade-scale-gear:hover,
.trade-scale-gear.is-active {
  color: #d1d4dc;
  background: #1e222d;
}

.trade-candle-pop {
  position: absolute;
  z-index: 25;
  right: calc(var(--scale-w) + 0.5rem);
  bottom: 2.2rem;
  width: 13.5rem;
  padding: 0.6rem 0.7rem 0.7rem;
  border: 1px solid #2a2e39;
  border-radius: 8px;
  background: #1e222d;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.trade-candle-pop.is-top {
  right: auto;
  bottom: auto;
  left: 0.9rem;
  top: 6.4rem;
}

.trade-candle-pop .trade-candle-settings-title {
  padding-right: 0;
}

/* Chart settings popover: follows the chosen chart background */
.trade-chart-wrap {
  background: var(--chart-bg, #000);
}

.trade-scale-gear {
  background: var(--chart-bg, #000);
}

#trade-chart-settings {
  width: 14.5rem;
}

.trade-toggle-row {
  cursor: pointer;
}

.trade-switch {
  appearance: none;
  position: relative;
  flex: none;
  width: 2.2rem;
  height: 1.2rem;
  margin: 0;
  border-radius: 999px;
  background: #434651;
  cursor: pointer;
  transition: background 0.15s ease;
}

.trade-switch::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.trade-switch:checked {
  background: #00a8ff;
}

.trade-switch:checked::after {
  transform: translateX(1rem);
}

.trade-candle-row input[type="color"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#trade-chart-settings input[type="range"] {
  margin: -0.25rem 0 0.1rem;
}

#trade-chart-settings input[type="range"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.trade-sub-row {
  font-size: 0.72rem;
  color: #9598a1;
}

/* ===== Affiliate program ===== */
body.affiliate-open {
  overflow: hidden;
}

body.affiliate-open .page,
body.affiliate-open .atmosphere {
  visibility: hidden;
}

.checkout-screen {
  position: fixed;
  inset: 0;
  z-index: 74;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 168, 255, 0.16), transparent 55%),
    #05080d;
  color: #d1d4dc;
}

.checkout-screen[hidden] {
  display: none;
}

body.checkout-open {
  overflow: hidden;
}

.checkout-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid rgba(0, 168, 255, 0.18);
  flex-shrink: 0;
}

.checkout-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  min-width: 0;
  flex-wrap: wrap;
}

.checkout-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--accent-bright);
}

.checkout-sub {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #787b86;
}

.checkout-body {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1.5rem 1.15rem 2rem;
  overflow: auto;
}

.checkout-card {
  width: min(440px, 100%);
  padding: 1.45rem 1.35rem 1.3rem;
  border: 1px solid rgba(0, 168, 255, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(165deg, rgba(0, 168, 255, 0.12), transparent 42%),
    rgba(8, 14, 22, 0.96);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: rise 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.checkout-card-head {
  margin-bottom: 1.15rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid rgba(0, 168, 255, 0.14);
}

.checkout-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.checkout-plan-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.checkout-plan-name {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.checkout-plan-title .tier-badge {
  flex-shrink: 0;
}

#checkout-tier-badge[hidden] {
  display: none;
}

.checkout-field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.checkout-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.checkout-capital-field {
  width: 100%;
}

.checkout-capital-field .account-capital-input {
  width: 100%;
}

.checkout-hint {
  font-size: 0.7rem;
  line-height: 1.4;
  color: #787b86;
}

.checkout-hint.is-error {
  color: #ff8a80;
}

.checkout-hint.is-ok {
  color: #26a69a;
}

.checkout-promo-row {
  display: flex;
  gap: 0.45rem;
}

.checkout-input,
.checkout-promo-row input {
  appearance: none;
  width: 100%;
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(0, 168, 255, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(5, 10, 16, 0.9);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
}

.checkout-promo-row input {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.checkout-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.checkout-card-cell {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.checkout-pay-btn:disabled {
  cursor: wait;
  filter: saturate(0.75);
  transform: none;
}

.checkout-promo-apply {
  appearance: none;
  flex-shrink: 0;
  padding: 0 0.95rem;
  border: 1px solid rgba(0, 168, 255, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(0, 168, 255, 0.12);
  color: var(--accent-bright);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.checkout-promo-apply:hover {
  background: rgba(0, 168, 255, 0.2);
}

.checkout-totals {
  margin: 1.15rem 0 1rem;
  padding: 0.85rem 0 0;
  border-top: 1px solid rgba(0, 168, 255, 0.14);
}

.checkout-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
}

.checkout-line dt {
  margin: 0;
  color: var(--ink-muted);
}

.checkout-line dd {
  margin: 0;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.checkout-line-list dd {
  text-decoration: line-through;
  color: rgba(255, 255, 255, 0.45);
}

.checkout-line-discount dd {
  color: #26a69a;
}

.checkout-line-total {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 168, 255, 0.14);
  font-size: 1.05rem;
  font-weight: 600;
}

.checkout-line-total dt,
.checkout-line-total dd {
  color: #fff;
}

.checkout-error {
  margin: 0 0 0.85rem;
  color: #ff8a80;
  font-size: 0.82rem;
  line-height: 1.4;
}

.checkout-pay-btn {
  appearance: none;
  width: 100%;
  min-height: 2.85rem;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 45%, var(--accent-deep) 100%);
  color: #031018;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.checkout-pay-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.affiliate-screen {
  position: fixed;
  inset: 0;
  z-index: 72;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #d1d4dc;
}

.affiliate-screen[hidden] {
  display: none;
}

.aff-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid #2a2e39;
  flex-shrink: 0;
}

.aff-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  min-width: 0;
  flex-wrap: wrap;
}

.aff-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent-bright);
}

.aff-sub {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #787b86;
}

.aff-body {
  flex: 1;
  overflow: auto;
  padding: 1.5rem 1.25rem 3rem;
  max-width: 58rem;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.aff-hero {
  padding: 1.5rem 0 2rem;
  border-bottom: 1px solid #1e222d;
}

.aff-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #00a8ff;
  font-weight: 600;
}

.aff-hero-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  font-weight: 600;
  line-height: 1.15;
  color: #fff;
  max-width: 22ch;
}

.aff-hero-copy {
  margin: 0 0 1.25rem;
  max-width: 42rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #9598a1;
}

.aff-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.aff-hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  color: #b2b5be;
}

.aff-hero-points li::before {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: #00a8ff;
  vertical-align: 0.1rem;
}

.aff-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.aff-btn-primary {
  background: #00a8ff;
  color: #000;
}

.aff-btn-primary:hover {
  background: #33baff;
}

.aff-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.aff-btn-ghost {
  background: transparent;
  border-color: #2a2e39;
  color: #d1d4dc;
}

.aff-btn-ghost:hover,
.aff-btn-ghost.is-done {
  border-color: rgba(0, 168, 255, 0.45);
  color: #00a8ff;
}

.aff-section {
  padding: 2rem 0 0.5rem;
}

.aff-section-title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: #fff;
}

.aff-section-copy {
  margin: 0 0 1.15rem;
  max-width: 42rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #9598a1;
}

.aff-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.aff-step-num {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: #00a8ff;
  font-weight: 700;
}

.aff-step h4,
.aff-earn h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: #fff;
}

.aff-step p,
.aff-earn p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #9598a1;
}

.aff-tiers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.aff-card.aff-tier {
  position: relative;
  padding: 1rem 0.9rem 1.1rem;
  border: 1px solid #2a2e39;
  border-radius: 8px;
  background: #0c0e12;
}

.aff-card.aff-tier.is-current {
  border-color: rgba(0, 168, 255, 0.55);
  background: rgba(0, 168, 255, 0.06);
}

.aff-tier-name {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9598a1;
  font-weight: 600;
}

.aff-tier-rate {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  line-height: 1;
}

.aff-muted {
  color: #787b86;
  font-size: 0.75rem;
}

.aff-tier-min {
  margin: 0.55rem 0 0.35rem;
  font-size: 0.78rem;
  color: #b2b5be;
}

.aff-tier-perk {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.4;
  color: #9598a1;
}

.aff-tier-flag {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #00a8ff;
  font-weight: 700;
}

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

.aff-tools {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.aff-tools li {
  padding: 0.85rem 0;
  border-top: 1px solid #1e222d;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #b2b5be;
}

.aff-tools li:last-child {
  border-bottom: 1px solid #1e222d;
}

.aff-tools strong {
  color: #fff;
  font-weight: 600;
}

.aff-dashboard {
  margin-top: 0.5rem;
  padding: 1.25rem 1.15rem 1.35rem;
  border: 1px solid #2a2e39;
  border-radius: 10px;
  background: #0c0e12;
}

.aff-dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.aff-dash-head .aff-section-title {
  margin: 0;
}

.aff-badge {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #2a2e39;
  color: #9598a1;
}

.aff-badge.is-live {
  border-color: rgba(0, 168, 255, 0.45);
  color: #00a8ff;
}

.aff-apply-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
  margin-top: 0.85rem;
}

.aff-apply-form .aff-apply-span,
.aff-apply-form .aff-btn-primary {
  grid-column: 1 / -1;
}

.aff-apply-form .aff-btn-primary {
  justify-self: start;
}

.aff-apply-socials-wrap > span {
  display: block;
  margin-bottom: 0.35rem;
}

.aff-apply-socials {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.aff-social-row input {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: #000;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 0.55rem 0.65rem;
  text-transform: none;
  letter-spacing: 0;
}

.aff-add-social {
  margin-top: 0.45rem;
  justify-self: start;
}

.aff-apply-status {
  margin-top: 0.65rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #2a2e39;
  border-radius: 7px;
  background: #000;
  font-size: 0.85rem;
  color: #d1d4dc;
}

.aff-apply-status[data-kind="error"] {
  border-color: rgba(196, 92, 74, 0.55);
  color: #f0b4aa;
}

.aff-apply-status[data-kind="info"] {
  border-color: rgba(0, 168, 255, 0.4);
  color: #9ad8ff;
}

.aff-share {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.aff-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #787b86;
}

.aff-field-row {
  display: flex;
  gap: 0.45rem;
}

.aff-field input {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 1px solid #2a2e39;
  border-radius: 6px;
  background: #000;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 0.55rem 0.65rem;
  text-transform: none;
  letter-spacing: 0;
}

.aff-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.aff-stat {
  padding: 0.7rem 0.65rem;
  border: 1px solid #2a2e39;
  border-radius: 7px;
  background: #000;
}

.aff-stat span {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #787b86;
  margin-bottom: 0.3rem;
}

.aff-stat strong {
  font-size: 1rem;
  color: #fff;
  font-weight: 600;
}

.aff-tier-box {
  margin-bottom: 1rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid #2a2e39;
  border-radius: 8px;
  background: #000;
}

.aff-tier-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: #d1d4dc;
  margin-bottom: 0.55rem;
}

.aff-progress {
  height: 0.35rem;
  border-radius: 999px;
  background: #1e222d;
  overflow: hidden;
}

.aff-progress span {
  display: block;
  height: 100%;
  background: #00a8ff;
}

.aff-tier-month {
  margin-top: 0.45rem;
}

.aff-payout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.35rem;
}

.aff-payout p {
  margin: 0.25rem 0 0;
}

.aff-payout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.aff-message {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  background: rgba(0, 168, 255, 0.1);
  color: #00a8ff;
}

.aff-message[data-kind="error"] {
  background: rgba(239, 83, 80, 0.12);
  color: #ef5350;
}

.aff-message[data-kind="success"] {
  background: rgba(38, 166, 154, 0.14);
  color: #26a69a;
}

.aff-faq-item {
  border-top: 1px solid #1e222d;
  padding: 0.85rem 0;
}

.aff-faq-item:last-child {
  border-bottom: 1px solid #1e222d;
}

.aff-faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: #fff;
  font-size: 0.92rem;
  list-style: none;
}

.aff-faq-item summary::-webkit-details-marker {
  display: none;
}

.aff-faq-item summary::after {
  content: "+";
  float: right;
  color: #00a8ff;
  font-weight: 500;
}

.aff-faq-item[open] summary::after {
  content: "–";
}

.aff-faq-item p {
  margin: 0.55rem 0 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #9598a1;
  max-width: 44rem;
}

@media (max-width: 900px) {
  .aff-steps,
  .aff-tiers,
  .aff-stats,
  .aff-share,
  .aff-earn-grid,
  .aff-apply-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .aff-steps,
  .aff-tiers,
  .aff-stats,
  .aff-share,
  .aff-earn-grid,
  .aff-apply-form {
    grid-template-columns: 1fr;
  }

  .aff-hero-title {
    max-width: none;
  }
}


.aff-code-hint {
  display: block;
  margin-top: 0.25rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.72rem;
}

#aff-code:not([readonly]) {
  text-transform: uppercase;
}


/* ===== Admin panel ===== */
body.admin-open {
  overflow: hidden;
}

body.admin-open .page,
body.admin-open .atmosphere {
  visibility: hidden;
}

.admin-screen {
  position: fixed;
  inset: 0;
  z-index: 74;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #d1d4dc;
}

.admin-screen[hidden] {
  display: none;
}

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid #2a2e39;
  flex-shrink: 0;
}

.admin-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent-bright);
}

.admin-sub {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #787b86;
}

.admin-body {
  flex: 1;
  overflow: auto;
  padding: 1.25rem 1.15rem 3rem;
  max-width: 64rem;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.admin-section {
  margin-bottom: 1.75rem;
}

.admin-section-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #fff;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.admin-stat {
  padding: 0.85rem 0.8rem;
  border: 1px solid #2a2e39;
  border-radius: 8px;
  background: #0c0e12;
}

.admin-stat span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #787b86;
  margin-bottom: 0.35rem;
}

.admin-stat strong {
  font-size: 1.05rem;
  color: #fff;
  font-weight: 600;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid #2a2e39;
  border-radius: 8px;
}

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

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid #1e222d;
  white-space: nowrap;
}

.admin-table th {
  background: #0c0e12;
  color: #9598a1;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #00a8ff;
}

.admin-empty,
.admin-muted {
  color: #787b86;
  font-size: 0.84rem;
}

.admin-actions {
  display: flex;
  gap: 0.4rem;
}

.admin-btn {
  appearance: none;
  border: 1px solid #2a2e39;
  border-radius: 5px;
  background: transparent;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
}

.admin-btn-ok {
  border-color: rgba(38, 166, 154, 0.5);
  color: #26a69a;
}

.admin-btn-ok:hover {
  background: rgba(38, 166, 154, 0.12);
}

.admin-btn-no {
  border-color: rgba(239, 83, 80, 0.5);
  color: #ef5350;
}

.admin-btn-no:hover {
  background: rgba(239, 83, 80, 0.12);
}

@media (max-width: 800px) {
  .admin-stats {
    grid-template-columns: 1fr 1fr;
  }
}

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

.admin-section-note {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #787b86;
  max-width: 40rem;
}

.admin-stat-btn {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.admin-stat-btn:hover,
.admin-stat-btn.is-open {
  border-color: rgba(0, 168, 255, 0.55);
  background: rgba(0, 168, 255, 0.08);
}

.admin-stat-hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.65rem;
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #00a8ff;
}

.admin-detail {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid #1e222d;
}

.admin-detail[hidden] {
  display: none;
}

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

.admin-detail-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #fff;
}

.admin-detail-close {
  appearance: none;
  border: 1px solid #2a2e39;
  border-radius: 5px;
  background: transparent;
  color: #d1d4dc;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}

.admin-detail-close:hover {
  border-color: rgba(0, 168, 255, 0.45);
  color: #00a8ff;
}


.admin-subhead {
  margin: 1.15rem 0 0.55rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9598a1;
}

.admin-subhead:first-of-type {
  margin-top: 0.25rem;
}


.admin-earnings-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.admin-earn-card {
  border: 1px solid #2a2e39;
  border-radius: 8px;
  background: #0c0e12;
  padding: 0.75rem 0.85rem;
}

.admin-earn-card span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9598a1;
}

.admin-earn-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.15rem;
  color: #fff;
}

.admin-earn-card em {
  display: block;
  margin-top: 0.25rem;
  font-style: normal;
  font-size: 0.72rem;
  color: #787b86;
}

.admin-earn-total {
  border-color: rgba(0, 168, 255, 0.4);
  background: rgba(0, 168, 255, 0.06);
}

.admin-earn-total strong {
  color: #00a8ff;
}

@media (max-width: 700px) {
  .admin-earnings-split {
    grid-template-columns: 1fr;
  }
}


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

@media (max-width: 900px) {
  .admin-earnings-split-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .admin-earnings-split-4 {
    grid-template-columns: 1fr;
  }
}
