    /* ══════════════════════════════════════════
       PAGE BASE — gradient base + animated background
    ══════════════════════════════════════════ */
    body.terminal-page {
      background:
        radial-gradient(ellipse 80% 50% at 20% 0%, rgba(74,222,128,.12) 0%, transparent 60%),
        radial-gradient(ellipse 70% 60% at 80% 30%, rgba(96,165,250,.10) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 50% 100%, rgba(196,181,253,.08) 0%, transparent 60%),
        linear-gradient(180deg, #0d1f15 0%, #0a1610 50%, #07110b 100%);
      background-attachment: fixed;
      color: rgba(240,253,244,.88);
      position: relative;
    }
    /* Subtle animated grid background */
    body.terminal-page::before {
      content: '';
      position: fixed; inset: 0; z-index: 0; pointer-events: none;
      background-image:
        linear-gradient(rgba(34,197,94,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34,197,94,.04) 1px, transparent 1px);
      background-size: 60px 60px;
      animation: gridDrift 30s linear infinite;
      mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 75%);
      -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 75%);
    }
    @keyframes gridDrift {
      0%   { background-position:   0   0,   0   0; }
      100% { background-position:  60px 60px, 60px 60px; }
    }
    /* Animated background canvas (floating particles) */
    #termBgCanvas {
      position: fixed; inset: 0; z-index: 0; pointer-events: none;
      width: 100%; height: 100%;
    }
    /* Bring real content above the background — DON'T touch nav (it's already fixed positioning from style.css) */
    .demo-banner, .terminal-page-wrap, footer { position: relative; z-index: 5; }
    .toast-container, .modal-backdrop { z-index: 9990; }
    /* Nav stays fixed (from style.css) — just bump its z-index above bg */
    body.terminal-page #mainNav { z-index: 200; }
    body.terminal-page #mobileMenu { z-index: 199; }

    body.terminal-page nav { background: rgba(6,12,8,.94); border-bottom-color: rgba(34,197,94,.18); backdrop-filter: blur(8px); }
    body.terminal-page .nav-logo-text .nlw { color: rgba(240,253,244,.9); }
    body.terminal-page .nav-links a { color: rgba(240,253,244,.55); }
    body.terminal-page .nav-links a:hover { color: rgba(240,253,244,.9); }

    /* SVG icon helper — used everywhere */
    .ic { display: inline-block; width: 16px; height: 16px; vertical-align: middle; }
    .ic-lg { width: 22px; height: 22px; }
    .ic-xl { width: 28px; height: 28px; }
    .ic-sm { width: 13px; height: 13px; }

    /* ══════════════════════════════════════════
       DEMO BANNER
    ══════════════════════════════════════════ */
    .demo-banner {
      position: fixed; top: 69px; left: 0; right: 0; z-index: 190;
      background: linear-gradient(90deg, #78350f, #92400e, #78350f);
      border-bottom: 1px solid rgba(251,191,36,.35);
      display: flex; align-items: center; justify-content: center;
      gap: 10px; padding: 9px 56px 9px 20px;
      font-size: .8rem; font-weight: 600;
      color: #fde68a; letter-spacing: .3px;
      transition: transform .3s, opacity .3s;
    }
    .demo-banner.hidden { transform: translateY(-100%); opacity: 0; pointer-events: none; }
    .demo-banner-icon { display: flex; align-items: center; flex-shrink: 0; color: #fbbf24; }
    .demo-banner-close {
      position: absolute; right: 16px;
      background: none; border: none; color: #fde68a;
      font-size: 1.2rem; cursor: pointer; padding: 2px 6px; border-radius: 4px;
      transition: background .2s; line-height: 1;
    }
    .demo-banner-close:hover { background: rgba(251,191,36,.15); }

    /* ══════════════════════════════════════════
       PAGE WRAPPER
    ══════════════════════════════════════════ */
    .terminal-page-wrap {
      padding-top: 108px;
      min-height: 100vh;
      display: flex; flex-direction: column;
      transition: padding-top .3s;
    }
    .terminal-page-wrap.banner-closed { padding-top: 69px; }

    /* ══════════════════════════════════════════
       ACCOUNT DASHBOARD — TOP SECTION (compact redesign)
    ══════════════════════════════════════════ */
    .acc-dashboard {
      background: transparent;
      border-bottom: 1px solid rgba(34,197,94,.18);
      padding: 20px 32px 24px;
    }
    .acc-dash-grid {
      max-width: 1800px; margin: 0 auto;
      display: flex; flex-direction: column; gap: 14px;
    }

    /* ══════════════════════════════════════════
       ROW 1 — PREMIUM PLAYER-CARD HERO
       Big mascot centerpiece + elegant info column
    ══════════════════════════════════════════ */
    .acc-hero {
      position: relative; overflow: hidden;
      display: grid;
      grid-template-columns: 466px 1fr;
      gap: 26px;
      min-height: 414px;
      padding: 24px 30px;
      border-radius: 22px;
      background: linear-gradient(150deg, #ffffff 0%, #f1fbf5 55%, #e8f7ee 100%);
      border: 1px solid rgba(34,197,94,.26);
      box-shadow:
        0 14px 38px -16px rgba(22,101,52,.20),
        0 2px 8px rgba(22,101,52,.06),
        inset 0 1px 0 rgba(255,255,255,.9);
    }
    .acc-hero .alc-glow { display: none; }

    /* ── MASCOT — the unmissable hero ── */
    .alc-mascot-side {
      position: relative; z-index: 1;
      align-self: center;
      display: flex; align-items: center; justify-content: center;
      width: 466px; height: 414px;
    }
    /* soft green radial halo behind the mascot */
    .alc-mascot-side::before {
      content: ''; position: absolute;
      width: 400px; height: 400px;
      left: 50%; top: 52%; transform: translate(-50%,-50%);
      background: radial-gradient(circle, rgba(34,197,94,.30) 0%, rgba(74,222,128,.14) 44%, transparent 70%);
      filter: blur(16px); border-radius: 50%;
      animation: alcHaloPulse 5s ease-in-out infinite;
    }
    /* dashed accent ring for a "profile" feel */
    .alc-mascot-side::after {
      content: ''; position: absolute;
      width: 400px; height: 400px;
      left: 50%; top: 50%; transform: translate(-50%,-50%);
      border-radius: 50%;
      border: 1.5px dashed rgba(34,197,94,.3);
    }
    .alc-mascot {
      position: relative; z-index: 1;
      width: 416px; height: 416px;
      object-fit: contain;
      filter: drop-shadow(0 16px 22px rgba(22,101,52,.4));
      animation: alcFloat 4.6s ease-in-out infinite;
    }
    @keyframes alcFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
    @keyframes alcHaloPulse {
      0%,100% { opacity: .85; transform: translate(-50%,-52%) scale(1); }
      50%     { opacity: 1;   transform: translate(-50%,-52%) scale(1.06); }
    }
    .acc-hero:hover .alc-mascot { animation-play-state: paused; }

    /* ── INFO COLUMN (right of mascot) ── */
    .hero-info {
      position: relative; z-index: 1;
      display: flex; flex-direction: column;
      min-width: 0; gap: 14px;
      padding: 2px 0;
    }

    /* — top: identity row — */
    .hero-identity {
      display: flex; align-items: center; gap: 15px;
    }
    .hero-id-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

    .apc-avatar {
      width: 60px; height: 60px; flex-shrink: 0;
      border-radius: 16px;
      display: flex; align-items: center; justify-content: center;
      font-family: var(--fh); font-weight: 700; font-size: 1.5rem;
      color: #fff; letter-spacing: -.5px;
      box-shadow: 0 8px 22px rgba(22,101,52,.34), inset 0 0 0 2px rgba(255,255,255,.32);
      position: relative; cursor: pointer;
    }
    .apc-avatar::after {
      content: ''; position: absolute; bottom: 2px; right: 2px;
      width: 14px; height: 14px; border-radius: 50%;
      background: #22c55e; border: 2.5px solid #fff;
      box-shadow: 0 0 0 0 rgba(74,222,128,.6);
      animation: livePulse 1.6s ease infinite;
    }
    .apc-name {
      font-family: var(--fh); font-weight: 700; font-size: 1.72rem;
      color: #08110a; letter-spacing: .2px; line-height: 1;
      display: flex; align-items: center; gap: 9px;
    }
    .apc-name .apc-edit-btn {
      background: rgba(34,197,94,.10); border: 1px solid rgba(34,197,94,.28);
      width: 26px; height: 26px; border-radius: 8px;
      display: inline-flex; align-items: center; justify-content: center;
      color: rgba(20,40,28,.55); cursor: pointer;
      transition: all .2s;
    }
    .apc-name .apc-edit-btn:hover { color: #16a34a; border-color: rgba(34,197,94,.6); background: rgba(34,197,94,.18); transform: translateY(-1px); }
    .apc-id-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .apc-handle { font-size: .76rem; font-weight: 600; color: rgba(20,40,28,.5); letter-spacing: .4px; }
    .apc-chip {
      display: inline-flex; align-items: center; gap: 4px;
      padding: 3px 9px; border-radius: 20px;
      font-size: .62rem; font-weight: 700; letter-spacing: .5px;
    }
    .apc-chip.demo  { background: rgba(251,191,36,.20); color: #b45309; border: 1px solid rgba(251,191,36,.5); }
    .apc-chip.live  { background: rgba(34,197,94,.18);  color: #15803d; border: 1px solid rgba(34,197,94,.46); }
    .apc-chip.tier  { background: rgba(168,85,247,.18); color: #7c3aed; border: 1px solid rgba(168,85,247,.46); }

    /* — middle: level block — */
    .alc-level-row {
      display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    }
    .alc-badge {
      font-family: var(--fh); font-weight: 700; font-size: .74rem;
      letter-spacing: 1.6px; padding: 6px 13px; border-radius: 9px;
      background: linear-gradient(135deg, #15803d, #22c55e);
      color: #fff; box-shadow: 0 5px 14px rgba(22,101,52,.4), inset 0 1px 0 rgba(255,255,255,.3);
      white-space: nowrap;
    }
    .alc-name {
      font-family: var(--fh); font-weight: 700; font-size: 1.36rem;
      color: #0a130b; letter-spacing: .3px; line-height: 1;
    }
    .alc-rank {
      margin-left: auto;
      font-family: var(--fh); font-weight: 700; font-size: .76rem;
      color: rgba(20,40,28,.5); letter-spacing: .6px;
      display: flex; align-items: center; gap: 6px;
      background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.2);
      padding: 5px 10px; border-radius: 8px;
    }
    .alc-rank svg { width: 14px; height: 14px; color: #16a34a; }
    /* 7-segment pip track */
    .alc-pips { display: flex; gap: 6px; }
    .alc-pips i {
      flex: 1; height: 8px; border-radius: 5px;
      background: rgba(20,40,28,.12);
      box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
      transition: background .4s, box-shadow .4s, transform .4s;
    }
    .alc-pips i.done {
      background: linear-gradient(90deg, #15803d, #4ade80);
      box-shadow: 0 2px 6px rgba(34,197,94,.4);
    }
    .alc-pips i.current { box-shadow: 0 0 12px rgba(34,197,94,.95); transform: scaleY(1.4); }

    /* — XP bar — */
    .alc-xp-block { display: flex; flex-direction: column; gap: 7px; }
    .alc-bar-track {
      height: 16px; border-radius: 999px;
      background: linear-gradient(180deg, rgba(20,40,28,.13), rgba(20,40,28,.07));
      overflow: hidden;
      box-shadow: inset 0 2px 5px rgba(0,0,0,.18), 0 1px 0 rgba(255,255,255,.7);
      padding: 3px;
    }
    .alc-bar-fill {
      height: 100%; border-radius: 999px;
      background: linear-gradient(90deg, #15803d, #22c55e 48%, #4ade80);
      box-shadow: 0 0 14px rgba(74,222,128,.85), inset 0 1px 0 rgba(255,255,255,.45);
      transition: width .8s cubic-bezier(.22,1,.36,1);
      position: relative; overflow: hidden;
      min-width: 8px;
    }
    .alc-bar-fill::after {
      content: ''; position: absolute; inset: 0;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
      transform: translateX(-100%);
      animation: alcShine 2.6s ease-in-out infinite;
    }
    .alc-bar-fill.is-max {
      background: linear-gradient(90deg, #f59e0b, #fbbf24 50%, #fcd34d);
      box-shadow: 0 0 16px rgba(251,191,36,.9), inset 0 1px 0 rgba(255,255,255,.5);
    }
    .alc-bar-meta { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
    .alc-xp {
      font-family: var(--fh); font-weight: 700; font-size: .92rem;
      color: #15803d; letter-spacing: .3px;
    }
    .alc-next {
      font-size: .74rem; color: rgba(20,40,28,.55); font-weight: 600;
      display: inline-flex; align-items: center; gap: 5px;
    }
    .alc-next::before {
      content: ''; width: 6px; height: 6px; border-radius: 50%;
      background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.7);
    }

    /* — footer: currency / reset / since — */
    .hero-footer {
      margin-top: auto;
      display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
      padding-top: 13px;
      border-top: 1px solid rgba(34,197,94,.2);
    }
    .apc-curr-pick {
      display: flex; border-radius: 10px; overflow: hidden;
      border: 1px solid rgba(34,197,94,.32);
      background: rgba(255,255,255,.7);
      box-shadow: 0 2px 8px rgba(34,197,94,.1);
    }
    .apc-curr-pick button {
      padding: 7px 14px;
      background: transparent;
      border: none; border-right: 1px solid rgba(34,197,94,.2);
      color: rgba(20,40,28,.55);
      font-family: var(--fh);
      font-size: .76rem; font-weight: 700; letter-spacing: .8px;
      cursor: pointer; transition: all .2s;
    }
    .apc-curr-pick button:last-child { border-right: none; }
    .apc-curr-pick button:hover { color: #15803d; background: rgba(34,197,94,.07); }
    .apc-curr-pick button.active {
      background: linear-gradient(135deg, #16a34a, #22c55e);
      color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
    }
    .apc-set-btn {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 8px 13px; border-radius: 10px;
      background: rgba(255,255,255,.7);
      border: 1px solid rgba(239,68,68,.32);
      color: #b91c1c;
      font-family: var(--fh);
      font-size: .74rem; font-weight: 700; letter-spacing: .5px;
      cursor: pointer; transition: all .2s;
    }
    .apc-set-btn.danger:hover { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.65); transform: translateY(-1px); }
    .apc-since {
      margin-left: auto;
      font-size: .72rem; color: rgba(20,40,28,.55);
      letter-spacing: .3px; font-weight: 600;
      display: flex; align-items: center; gap: 6px;
    }
    .apc-since .ic { color: rgba(20,40,28,.42); width: 13px; height: 13px; }
    .apc-since span { color: #15803d; font-weight: 700; }

    /* level-up celebration */
    .acc-hero.level-up { animation: alcLevelUp 1.5s cubic-bezier(.22,1,.36,1); }
    .acc-hero.level-up .alc-mascot { animation: alcMascotPop 1.5s cubic-bezier(.34,1.56,.64,1); }
    @keyframes alcShine {
      0% { transform: translateX(-100%); }
      55%, 100% { transform: translateX(100%); }
    }
    @keyframes alcLevelUp {
      0%   { box-shadow: 0 18px 48px -12px rgba(22,101,52,.3), inset 0 1px 0 rgba(255,255,255,.9); transform: scale(1); }
      18%  { box-shadow: 0 0 0 5px rgba(74,222,128,.55), 0 18px 54px rgba(34,197,94,.55); transform: scale(1.012); }
      45%  { box-shadow: 0 0 0 10px rgba(74,222,128,0), 0 18px 54px rgba(34,197,94,.4); transform: scale(1.008); }
      100% { box-shadow: 0 18px 48px -12px rgba(22,101,52,.3), inset 0 1px 0 rgba(255,255,255,.9); transform: scale(1); }
    }
    @keyframes alcMascotPop {
      0%   { transform: scale(1) rotate(0); }
      30%  { transform: scale(1.18) rotate(-7deg); }
      55%  { transform: scale(1.08) rotate(5deg); }
      75%  { transform: scale(1.12) rotate(-2deg); }
      100% { transform: scale(1) rotate(0); }
    }

    /* ══════════════════════════════════════════
       ROW 2 — PREMIUM STAT TILES
    ══════════════════════════════════════════ */
    .acc-stats-grid {
      display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
    }
    .acc-stat-card {
      position: relative; overflow: hidden;
      display: flex; align-items: center; gap: 14px;
      background: linear-gradient(155deg, #ffffff 0%, #f0faf3 60%, #e7f6ec 100%);
      border: 1px solid rgba(34,197,94,.22);
      border-radius: 16px;
      padding: 16px 17px;
      box-shadow: 0 8px 22px -8px rgba(22,101,52,.2), inset 0 1px 0 rgba(255,255,255,.9);
      transition: transform .22s, box-shadow .22s;
    }
    /* coloured top accent strip */
    .acc-stat-card::before {
      content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px;
      background: var(--accent, #22c55e);
    }
    .acc-stat-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -10px rgba(22,101,52,.3); }
    .acc-stat-card .asc-icon-box {
      flex-shrink: 0;
      width: 48px; height: 48px; border-radius: 13px;
      display: flex; align-items: center; justify-content: center;
      background: var(--accent-soft, rgba(34,197,94,.14));
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
    }
    .acc-stat-card .asc-icon-box .ic { width: 23px; height: 23px; }
    .asc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
    .acc-stat-card .asc-label {
      font-size: .58rem; font-weight: 800; letter-spacing: 1.5px;
      text-transform: uppercase; color: rgba(20,40,28,.5);
    }
    .acc-stat-card .asc-value {
      font-family: var(--fh); font-weight: 700;
      font-size: 1.5rem; letter-spacing: .3px;
      color: #08110a; line-height: 1.05;
      font-variant-numeric: tabular-nums;
    }
    .acc-stat-card .asc-sub { font-size: .67rem; color: rgba(20,40,28,.55); font-weight: 500; }
    .acc-stat-card .asc-sub strong { color: #0a130b; font-weight: 700; }
    /* Coloured variants via custom props */
    .asc-balance { --accent: #16a34a; --accent-soft: rgba(34,197,94,.16); border-color: rgba(34,197,94,.34); }
    .asc-balance .asc-icon-box { color: #16a34a; }
    .asc-balance .asc-value { color: #15803d; }
    .asc-pnl { --accent: #2563eb; --accent-soft: rgba(59,130,246,.14); border-color: rgba(59,130,246,.3); }
    .asc-pnl .asc-icon-box { color: #2563eb; }
    .asc-winrate { --accent: #7c3aed; --accent-soft: rgba(168,85,247,.14); border-color: rgba(168,85,247,.3); }
    .asc-winrate .asc-icon-box { color: #7c3aed; }
    .asc-trades { --accent: #d97706; --accent-soft: rgba(251,191,36,.2); border-color: rgba(251,191,36,.36); }
    .asc-trades .asc-icon-box { color: #b45309; }
    .asc-value.up { color: #15803d; }
    .asc-value.dn { color: #b91c1c; }

    /* ══════════════════════════════════════════
       ROW 3 — TWO COLUMNS (achievements + transactions)
    ══════════════════════════════════════════ */
    .acc-cols {
      display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px;
      align-items: start;
    }

    /* Recent transactions */
    .acc-transactions {
      background: linear-gradient(155deg, #ffffff 0%, #f0faf3 60%, #e7f6ec 100%);
      border: 1px solid rgba(34,197,94,.24);
      border-radius: 16px;
      padding: 16px 18px;
      box-shadow: 0 8px 22px -8px rgba(22,101,52,.18), inset 0 1px 0 rgba(255,255,255,.9);
    }
    .at-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 12px;
    }
    .at-head-right { display: flex; align-items: center; gap: 10px; }
    .at-title {
      font-family: var(--fh); font-weight: 700;
      font-size: .8rem; letter-spacing: 1.6px; text-transform: uppercase;
      color: rgba(20,40,28,.8);
      display: flex; align-items: center; gap: 8px;
    }
    .at-title .ic { color: #2563eb; width: 18px; height: 18px; }
    .at-meta { font-size: .7rem; color: rgba(20,40,28,.5); font-weight: 600; }
    .at-list { display: flex; flex-direction: column; gap: 5px; max-height: 252px; overflow-y: auto; padding-right: 3px; }
    .at-list::-webkit-scrollbar { width: 4px; }
    .at-list::-webkit-scrollbar-thumb { background: rgba(34,197,94,.3); border-radius: 2px; }
    .at-row {
      display: grid; grid-template-columns: 92px 1fr 70px 1fr 90px 70px;
      align-items: center; gap: 10px;
      padding: 9px 11px;
      border-radius: 9px;
      background: linear-gradient(150deg, #ffffff, #f4faf6);
      border: 1px solid rgba(34,197,94,.14);
      font-size: .76rem;
      transition: background .15s, border-color .15s, transform .15s;
    }
    .at-row:hover { border-color: rgba(34,197,94,.34); transform: translateX(2px); }
    .at-row .at-time { font-family: var(--fh); font-size: .68rem; color: rgba(20,40,28,.45); letter-spacing: .5px; }
    .at-row .at-asset { font-weight: 700; color: #0a130b; display: flex; align-items: center; gap: 6px; }
    .at-row .at-side {
      display: inline-flex; align-items: center; gap: 4px;
      font-family: var(--fh); font-size: .65rem; font-weight: 700; letter-spacing: 1px;
      padding: 3px 9px; border-radius: 5px;
    }
    .at-row .at-side.buy  { background: rgba(34,197,94,.16);  color: #15803d; }
    .at-row .at-side.sell { background: rgba(239,68,68,.14);  color: #b91c1c; }
    .at-row .at-margin { font-size: .68rem; color: rgba(20,40,28,.5); font-variant-numeric: tabular-nums; }
    .at-row .at-pnl { font-family: var(--fh); font-weight: 700; font-size: .84rem; text-align: right; font-variant-numeric: tabular-nums; }
    .at-row .at-pnl.up { color: #15803d; }
    .at-row .at-pnl.dn { color: #b91c1c; }
    .at-row .at-lev { font-size: .62rem; color: rgba(20,40,28,.42); text-align: right; font-family: var(--fh); }
    .at-empty { padding: 26px 12px; text-align: center; color: rgba(20,40,28,.42); font-size: .78rem; }

    /* ══════════════════════════════════════════
       LIVE CLOCK + PRICES BADGE STRIP
    ══════════════════════════════════════════ */
    .term-status-strip {
      max-width: 1800px; margin: 0 auto;
      padding: 10px 32px 0;
      display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
      font-size: .72rem; color: rgba(240,253,244,.45); letter-spacing: .5px;
    }
    .tss-clock {
      font-family: var(--fh); font-weight: 700; font-size: .8rem;
      letter-spacing: 2px;
      color: rgba(240,253,244,.75);
    }
    .tss-badge {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 4px 11px; border-radius: 6px;
      font-size: .66rem; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
    }
    .tss-badge.live { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.4); color: #4ade80; }
    .tss-badge.demo { background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.32); color: #fbbf24; }
    .tss-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: livePulse 1.4s ease infinite; }
    @keyframes livePulse {
      0%,100% { box-shadow: 0 0 0 0 rgba(74,222,128,.6); }
      50%      { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
    }

    /* ══════════════════════════════════════════
       TERMINAL — COMPACT
    ══════════════════════════════════════════ */
    .terminal-main-area { padding: 14px 32px 44px; max-width: 1800px; margin: 0 auto; width: 100%; box-sizing: border-box; }
    .term-wrap-full {
      border: 1px solid rgba(34,197,94,.22);
      border-radius: 14px;
      overflow: hidden;
      background: #0a130b;
      box-shadow: 0 0 60px rgba(34,197,94,.06), 0 16px 48px rgba(0,0,0,.4);
    }

    /* Chrome bar (compact) */
    .term-chrome {
      display: flex; align-items: center; gap: 12px;
      padding: 8px 14px;
      background: #060d07;
      border-bottom: 1px solid rgba(34,197,94,.15);
    }
    .term-dots { display: flex; gap: 6px; }
    .td-red    { width:11px;height:11px;border-radius:50%;background:#ff5f57; }
    .td-yellow { width:11px;height:11px;border-radius:50%;background:#febc2e; }
    .td-green  { width:11px;height:11px;border-radius:50%;background:#28c840; }
    .term-title-bar {
      flex: 1; text-align: center;
      font-family: var(--fh); font-weight: 700;
      font-size: .72rem; letter-spacing: 2.5px;
      color: rgba(240,253,244,.3);
    }
    .term-live-badge {
      display: flex; align-items: center; gap: 5px;
      font-size: .66rem; font-weight: 700; letter-spacing: 1.5px;
      color: var(--gl);
    }

    /* Body 3-col — compact */
    .term-body-full {
      display: grid;
      grid-template-columns: 260px 1fr 290px;
      /* Strict fixed height — markets list scrolls inside, doesn't extend the terminal.
         Scales with viewport height but stays sane. */
      height: min(82vh, 860px);
      min-height: 780px;
    }

    /* ── LEFT: Markets sidebar — fixed height, internal scroll ── */
    .term-markets-sidebar {
      border-right: 1px solid rgba(34,197,94,.12);
      display: flex; flex-direction: column;
      overflow: hidden;
      min-height: 0; /* required so flex children can shrink and overflow */
      height: 100%;  /* fill the grid cell */
    }
    .tm-search {
      padding: 9px 10px;
      border-bottom: 1px solid rgba(34,197,94,.08);
      position: relative;
    }
    .tm-search input {
      width: 100%; box-sizing: border-box;
      background: rgba(255,255,255,.04);
      border: 1px solid rgba(34,197,94,.18);
      border-radius: 8px;
      padding: 7px 12px 7px 32px;
      color: rgba(240,253,244,.85);
      font-size: .76rem;
      font-family: var(--fb);
      outline: none;
      transition: border-color .2s;
    }
    .tm-search input::placeholder { color: rgba(240,253,244,.28); }
    .tm-search input:focus { border-color: rgba(34,197,94,.5); }
    .tm-search-icon {
      position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
      color: rgba(240,253,244,.35); pointer-events: none;
    }

    /* Inline filter row — search + sort + category dropdown all in 1 row */
    .tm-search { display: flex; gap: 6px; align-items: center; }
    .tm-search-input-wrap { position: relative; flex: 1; min-width: 0; }
    .tm-search-input-wrap input { width: 100%; }
    .tm-action-btn {
      flex-shrink: 0;
      width: 30px; height: 30px;
      border-radius: 7px;
      background: rgba(255,255,255,.04);
      border: 1px solid rgba(34,197,94,.18);
      color: rgba(240,253,244,.5);
      cursor: pointer;
      display: inline-flex; align-items: center; justify-content: center;
      position: relative;
      transition: all .18s;
    }
    .tm-action-btn:hover { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.4); color: #4ade80; }
    .tm-action-btn .ic { width: 13px; height: 13px; }
    .tm-action-btn.active { background: rgba(34,197,94,.18); border-color: rgba(34,197,94,.5); color: #4ade80; }
    .tm-action-btn .tm-cat-dot {
      position: absolute; top: 4px; right: 4px;
      width: 6px; height: 6px; border-radius: 50%;
      display: none;
    }
    .tm-action-btn.active .tm-cat-dot { display: block; }

    /* Category dropdown popover */
    .tm-cat-pop {
      position: absolute; top: calc(100% + 4px); right: 0;
      background: #0a130b;
      border: 1px solid rgba(34,197,94,.3);
      border-radius: 9px;
      padding: 5px;
      min-width: 150px;
      box-shadow: 0 8px 24px rgba(0,0,0,.55);
      z-index: 50;
      display: none;
    }
    .tm-cat-pop.open { display: block; }
    .tm-cat-pop button {
      display: flex; width: 100%; align-items: center; gap: 8px;
      padding: 8px 10px;
      background: none; border: none;
      color: rgba(240,253,244,.7);
      font-size: .76rem; font-weight: 600;
      letter-spacing: .3px;
      border-radius: 6px;
      cursor: pointer;
      text-align: left;
      transition: background .15s;
    }
    .tm-cat-pop button:hover { background: rgba(34,197,94,.1); color: #4ade80; }
    .tm-cat-pop button.active { background: rgba(34,197,94,.16); color: #4ade80; }
    .tm-cat-pop button .ic { width: 14px; height: 14px; flex-shrink: 0; }
    .tm-cat-pop button[data-cat="Crypto"]        { color: #f7931a; }
    .tm-cat-pop button[data-cat="Forex"]         { color: #60a5fa; }
    .tm-cat-pop button[data-cat="Indici"]        { color: #4ade80; }
    .tm-cat-pop button[data-cat="Materie Prime"] { color: #fbbf24; }
    .tm-cat-pop button[data-cat=""]              { color: rgba(240,253,244,.7); }

    /* Quick amount preset chips below amount input */
    .quick-amounts {
      display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px;
      margin-top: 3px;
    }
    .qa-chip {
      padding: 8px 0;
      font-family: var(--fh); font-weight: 700; font-size: .8rem; letter-spacing: .2px;
      background: rgba(255,255,255,.04);
      border: 1px solid rgba(34,197,94,.18);
      color: rgba(240,253,244,.62);
      border-radius: 5px;
      cursor: pointer;
      min-width: 0;
      transition: all .15s;
    }
    .qa-chip:hover { background: rgba(34,197,94,.1); color: #4ade80; border-color: rgba(34,197,94,.4); }
    .qa-chip.max { color: #fbbf24; border-color: rgba(251,191,36,.25); }
    .qa-chip.max:hover { background: rgba(251,191,36,.1); color: #fbbf24; border-color: rgba(251,191,36,.5); }

    .tm-list {
      flex: 1 1 auto;
      min-height: 0;       /* allow shrink */
      overflow-y: auto;    /* scrollbar inside the list */
      overflow-x: hidden;
      padding: 4px 0;
      scrollbar-gutter: stable;
    }
    .tm-list::-webkit-scrollbar { width: 6px; }
    .tm-list::-webkit-scrollbar-track { background: rgba(255,255,255,.02); }
    .tm-list::-webkit-scrollbar-thumb {
      background: linear-gradient(180deg, rgba(74,222,128,.45), rgba(34,197,94,.3));
      border-radius: 3px;
    }
    .tm-list::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(74,222,128,.7), rgba(34,197,94,.5)); }
    /* Firefox scrollbar */
    .tm-list { scrollbar-width: thin; scrollbar-color: rgba(74,222,128,.4) rgba(255,255,255,.02); }

    .tm-section-hdr {
      padding: 7px 12px 5px;
      font-size: .54rem; font-weight: 800; letter-spacing: 2px;
      text-transform: uppercase;
      color: rgba(240,253,244,.32);
      background: rgba(0,0,0,.2);
      border-bottom: 1px solid rgba(34,197,94,.07);
      display: flex; align-items: center; justify-content: space-between;
      position: sticky; top: 0; z-index: 1;
    }
    .tm-asset {
      padding: 8px 12px;
      border-bottom: 1px solid rgba(34,197,94,.05);
      cursor: pointer;
      display: grid; grid-template-columns: 28px 1fr auto;
      gap: 8px; align-items: center;
      transition: background .15s;
    }
    .tm-asset:hover { background: rgba(34,197,94,.05); }
    .tm-asset.active { background: rgba(34,197,94,.1); border-left: 2px solid var(--gd); padding-left: 10px; }

    .tma-icon {
      width: 28px; height: 28px;
      border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
    }
    .tma-icon svg { width: 18px; height: 18px; }
    /* Asset icon variants by category */
    .tma-icon.crypto       { background: rgba(247,147,26,.14); color: #f7931a; }
    .tma-icon.crypto.eth   { background: rgba(98,126,234,.16); color: #627eea; }
    .tma-icon.crypto.bnb   { background: rgba(243,186,47,.16); color: #f3ba2f; }
    .tma-icon.crypto.sol   { background: rgba(20,241,149,.14); color: #14f195; }
    .tma-icon.crypto.ada   { background: rgba(0,51,173,.18);   color: #80a8ff; }
    .tma-icon.crypto.xrp   { background: rgba(255,255,255,.06); color: #fff; }
    .tma-icon.crypto.doge  { background: rgba(186,159,80,.18); color: #c2a633; }
    .tma-icon.forex        { background: rgba(59,130,246,.14); color: #60a5fa; }
    .tma-icon.indici       { background: rgba(34,197,94,.14);  color: #4ade80; }
    .tma-icon.materie      { background: rgba(251,191,36,.14); color: #fbbf24; }

    .tma-mid { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
    .tma-sym { font-weight: 700; font-size: .76rem; color: rgba(240,253,244,.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tma-cat { font-size: .58rem; color: rgba(240,253,244,.32); letter-spacing: .5px; text-transform: uppercase; }
    .tma-right { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; min-width: 70px; }
    .tma-price {
      font-size: .74rem; font-weight: 600;
      color: rgba(240,253,244,.78);
      font-variant-numeric: tabular-nums;
    }
    .tma-chg { font-size: .62rem; font-weight: 700; }
    .tma-chg.up { color: #4ade80; }
    .tma-chg.dn { color: #f87171; }

    .flash-up { animation: flashUp .4s ease; }
    .flash-dn { animation: flashDn .4s ease; }
    @keyframes flashUp { 0%,100% { color: rgba(240,253,244,.78); } 50% { color: #4ade80; } }
    @keyframes flashDn { 0%,100% { color: rgba(240,253,244,.78); } 50% { color: #f87171; } }

    /* ── CENTER: Chart only — full height, no scroll ── */
    .term-center {
      display: flex; flex-direction: column;
      border-right: 1px solid rgba(34,197,94,.12);
      min-height: 0;
      height: 100%;
      overflow: hidden;
    }
    .term-price-bar {
      display: flex; justify-content: space-between; align-items: center;
      padding: 10px 16px;
      border-bottom: 1px solid rgba(34,197,94,.1);
      gap: 12px;
    }
    .tpb-left { display: flex; flex-direction: column; gap: 2px; }
    .tpb-name {
      font-family: var(--fh); font-weight: 700; font-size: 1rem;
      color: rgba(240,253,244,.9); letter-spacing: 1px;
      display: flex; align-items: center; gap: 8px;
    }
    .tpb-name .tpb-asset-ic {
      width: 24px; height: 24px; border-radius: 6px;
      display: inline-flex; align-items: center; justify-content: center;
    }
    .tpb-name .tpb-asset-ic svg { width: 16px; height: 16px; }
    .tpb-cat { font-size: .6rem; color: rgba(240,253,244,.32); text-transform: uppercase; letter-spacing: 1.2px; }
    .tpb-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
    /* Chevron next to asset name — hidden on desktop, shown on mobile as a tap indicator */
    .tpb-chevron { display: none; }
    .tm-mobile-close { display: none; }
    .tpb-right-top { display: flex; align-items: baseline; gap: 10px; }
    .tpb-price {
      font-family: var(--fh); font-weight: 700; font-size: 1.42rem;
      color: rgba(240,253,244,.95); letter-spacing: .8px;
      font-variant-numeric: tabular-nums;
    }
    /* period-start price ("how much it was worth N ago") shown for non-live timeframes */
    .tpb-base {
      font-size: .66rem; font-weight: 600; letter-spacing: .3px;
      color: rgba(240,253,244,.5); font-variant-numeric: tabular-nums;
    }
    .tpb-base b { color: rgba(240,253,244,.78); font-weight: 700; }
    .tpb-chg {
      font-size: .72rem; font-weight: 700;
      padding: 2px 8px; border-radius: 5px;
    }
    .tpb-chg.up { background: rgba(34,197,94,.15);  color: #4ade80; }
    .tpb-chg.dn { background: rgba(239,68,68,.15);  color: #f87171; }

    .chart-type-bar {
      display: flex; gap: 0; padding: 6px 12px 0;
    }
    .ct-btn {
      padding: 3px 11px;
      font-family: var(--fh);
      font-size: .58rem; font-weight: 700; letter-spacing: 1.2px;
      background: none;
      border: 1px solid rgba(34,197,94,.15);
      color: rgba(240,253,244,.32);
      cursor: pointer;
      transition: all .2s;
    }
    .ct-btn:first-child { border-radius: 5px 0 0 5px; }
    .ct-btn:last-child  { border-radius: 0 5px 5px 0; border-left: none; }
    .ct-btn:not(:first-child):not(:last-child) { border-left: none; }
    .ct-btn:hover { color: rgba(240,253,244,.65); background: rgba(34,197,94,.05); }
    .ct-btn.active { background: rgba(34,197,94,.15); border-color: rgba(34,197,94,.4); color: #4ade80; }

    /* ══════════════════════════════════════════
       LIGHT THEME OVERRIDES + NEW COMPONENTS
       (overrides the older dark-themed terminal styles above)
    ══════════════════════════════════════════ */
    body.terminal-page {
      background:
        radial-gradient(ellipse 60% 45% at 20% 5%,   rgba(74,222,128,.35) 0%, transparent 60%),
        radial-gradient(ellipse 55% 45% at 80% 8%,   rgba(96,165,250,.32) 0%, transparent 60%),
        radial-gradient(ellipse 70% 60% at 50% 35%,  rgba(168,85,247,.22) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 15% 60%,  rgba(251,191,36,.16) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 90% 75%,  rgba(236,72,153,.14) 0%, transparent 55%),
        linear-gradient(180deg, #eafaf0 0%, #e1f3e8 50%, #d4ecdc 100%);
      background-attachment: fixed;
      color: rgba(20,40,28,.88);
    }
    body.terminal-page nav { background: rgba(255,255,255,.92) !important; backdrop-filter: blur(8px); border-bottom-color: rgba(34,197,94,.18); }
    body.terminal-page .nav-logo-text .nlw { color: #0a130b !important; }
    body.terminal-page .nav-links a { color: rgba(20,40,28,.7) !important; }
    body.terminal-page .nav-links a:hover { color: #16a34a !important; }
    body.terminal-page #mainNav { z-index: 200; }

    .term-status-strip { color: rgba(20,40,28,.55); }
    .tss-clock { color: rgba(20,40,28,.78); background: rgba(255,255,255,.7); padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(34,197,94,.25); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
    .tss-badge.live { background: rgba(34,197,94,.16); border: 1px solid rgba(34,197,94,.45); color: #15803d; }
    .tss-badge.demo { background: rgba(251,191,36,.18); border: 1px solid rgba(251,191,36,.45); color: #b45309; }

    /* dashboard already uses light-theme base CSS — transactions row text colors only */
    .acc-dashboard { backdrop-filter: blur(6px); }
    .at-row { background: #f9fdfa; border-color: rgba(34,197,94,.12); }
    .at-row:hover { background: rgba(34,197,94,.06); border-color: rgba(34,197,94,.3); }
    .at-row .at-time { color: rgba(20,40,28,.5); }
    .at-row .at-asset { color: #0a130b; }
    .at-row .at-side.buy  { background: rgba(34,197,94,.18); color: #15803d; }
    .at-row .at-side.sell { background: rgba(239,68,68,.18); color: #b91c1c; }
    .at-row .at-margin { color: rgba(20,40,28,.55); }
    .at-row .at-pnl.up { color: #15803d; }
    .at-row .at-pnl.dn { color: #b91c1c; }
    .at-row .at-lev { color: rgba(20,40,28,.45); }
    .at-empty { color: rgba(20,40,28,.45); }

    /* ── TERMINAL UNIFIED DARK THEME ── */
    .term-wrap-full { background: #0b0f12 !important; border-color: rgba(34,197,94,.22) !important; box-shadow: 0 0 60px rgba(0,0,0,.5), 0 16px 48px rgba(0,0,0,.4) !important; }
    .term-chrome { background: linear-gradient(180deg,#131722,#0d1117) !important; border-bottom-color: rgba(34,197,94,.12) !important; }
    .term-title-bar { color: rgba(240,253,244,.45) !important; font-size: .82rem; }
    .term-live-badge { color: #4ade80 !important; font-size: .76rem; }

    /* Markets sidebar — dark */
    .term-markets-sidebar { background: #0b0f12 !important; border-right-color: rgba(34,197,94,.1) !important; }
    .tm-search { border-bottom-color: rgba(255,255,255,.06); }
    .tm-search input { background: rgba(255,255,255,.05) !important; border-color: rgba(34,197,94,.2) !important; color: rgba(240,253,244,.85) !important; font-size: .8rem !important; }
    .tm-search input::placeholder { color: rgba(240,253,244,.25); }
    .tm-search input:focus { border-color: #4ade80 !important; box-shadow: 0 0 0 2px rgba(34,197,94,.12); }
    .tm-search-icon { color: rgba(240,253,244,.28); }
    .tm-action-btn { background: rgba(255,255,255,.04); border-color: rgba(34,197,94,.18); color: rgba(240,253,244,.4); width: 34px; height: 34px; }
    .tm-action-btn:hover { background: rgba(34,197,94,.1); color: #4ade80; }
    .tm-action-btn.active { background: rgba(34,197,94,.16); color: #4ade80; }
    .tm-cat-pop { background: #131722 !important; border-color: rgba(34,197,94,.25); box-shadow: 0 12px 28px rgba(0,0,0,.6); }
    .tm-cat-pop button { color: rgba(240,253,244,.7); font-size: .84rem; }
    .tm-cat-pop button:hover { background: rgba(34,197,94,.1); color: #4ade80; }
    .tm-cat-pop button.active { background: rgba(34,197,94,.16); color: #4ade80; }
    .tm-section-hdr { color: rgba(240,253,244,.28) !important; background: rgba(255,255,255,.02) !important; border-bottom-color: rgba(255,255,255,.06); font-size: .62rem; }
    .tm-asset { color: rgba(240,253,244,.8) !important; border-bottom-color: rgba(255,255,255,.05); padding: 9px 12px; gap: 8px; }
    .tm-asset:hover { background: rgba(34,197,94,.06) !important; }
    .tm-asset.active { background: rgba(34,197,94,.1) !important; border-left: 3px solid #22c55e; padding-left: 9px; }
    .tma-sym { font-size: .88rem; color: rgba(240,253,244,.9) !important; }
    .tma-cat { font-size: .62rem; color: rgba(240,253,244,.28); }
    .tma-price { font-size: .84rem; color: rgba(240,253,244,.85) !important; }
    .tma-chg { font-size: .72rem; }
    .tma-chg.up { color: #4ade80 !important; }
    .tma-chg.dn { color: #f87171 !important; }
    @keyframes flashUp { 0%,100% { color: rgba(240,253,244,.78); } 50% { color: #4ade80; } }
    @keyframes flashDn { 0%,100% { color: rgba(240,253,244,.78); } 50% { color: #f87171; } }

    /* Center + price bar — dark */
    .term-center { background: #0b0f12 !important; border-right-color: rgba(34,197,94,.1); }
    .term-price-bar { background: linear-gradient(180deg,#0d1117,#0b0f12) !important; border-bottom-color: rgba(34,197,94,.1); padding: 10px 16px; }
    .tpb-name { color: rgba(240,253,244,.92) !important; font-size: 1rem !important; }
    .tpb-cat  { color: rgba(240,253,244,.32) !important; font-size: .62rem; }
    .tpb-price { color: rgba(240,253,244,.95) !important; font-size: 1.42rem !important; }
    .tpb-chg.up { background: rgba(34,197,94,.15) !important; color: #4ade80 !important; border: 1px solid rgba(34,197,94,.3); font-size: .72rem; padding: 2px 8px; }
    .tpb-chg.dn { background: rgba(239,68,68,.15) !important; color: #f87171 !important; border: 1px solid rgba(239,68,68,.3); font-size: .72rem; padding: 2px 8px; }

    /* ══════════ TradingView-style dark chart panel ══════════ */
    .chart-type-bar { display: none !important; }
    .tv-chart {
      flex: 1 1 auto; display: flex; flex-direction: column;
      min-height: 560px;
      background: #0e1117; position: relative;
    }
    .tv-chart:fullscreen { background: #0e1117; min-height: 0; }

    /* TOP toolbar */
    .tv-topbar {
      display: flex; align-items: center; gap: 3px;
      padding: 6px 8px; background: #131722;
      border-bottom: 1px solid #2a2e39;
      flex-wrap: nowrap; overflow: visible; scrollbar-width: none;
    }
    .tv-topbar::-webkit-scrollbar { display: none; }
    .tv-sep { width: 1px; height: 20px; background: #2a2e39; margin: 0 4px; flex-shrink: 0; }

    /* Timeframe dropdown */
    .tv-tf-wrap { position: relative; flex-shrink: 0; }
    .tv-tf-current {
      display: inline-flex; align-items: center; gap: 5px;
      padding: 5px 9px; background: transparent; border: none; border-radius: 5px;
      color: #d1d4dc; font-family: 'Rajdhani',sans-serif; font-weight: 700;
      font-size: .82rem; letter-spacing: .5px; cursor: pointer; transition: background .15s;
    }
    .tv-tf-current svg { width: 12px; height: 12px; opacity: .7; }
    .tv-tf-current:hover { background: #2a2e39; }
    .tv-tf-menu {
      display: none; position: absolute; top: calc(100% + 5px); left: 0; z-index: 40;
      background: #1c2030; border: 1px solid #2a2e39; border-radius: 8px;
      padding: 5px; flex-direction: column; gap: 2px; min-width: 96px;
      box-shadow: 0 10px 28px rgba(0,0,0,.6);
    }
    .tv-tf-wrap.open .tv-tf-menu { display: flex; }
    .tv-tf-menu .tf-btn {
      padding: 6px 10px; background: transparent; border: none; border-radius: 5px;
      color: #b2b5be; font-family: 'Rajdhani',sans-serif; font-weight: 700;
      font-size: .8rem; letter-spacing: .5px; cursor: pointer; text-align: left; transition: all .12s;
    }
    .tv-tf-menu .tf-btn:hover { background: #2a2e39; color: #fff; }
    .tv-tf-menu .tf-btn.active { background: rgba(41,98,255,.18); color: #5b9cff; }

    /* Chart-type group */
    .tv-ct-group { display: inline-flex; gap: 1px; flex-shrink: 0; }
    .tv-ct {
      width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
      background: transparent; border: none; border-radius: 5px;
      color: #b2b5be; cursor: pointer; transition: all .13s;
    }
    .tv-ct svg { width: 17px; height: 17px; }
    .tv-ct:hover { background: #2a2e39; color: #fff; }
    .tv-ct.active { background: rgba(41,98,255,.18); color: #5b9cff; }

    /* Labelled toolbar buttons (Compare / Indicators / Templates) */
    .tv-tbtn {
      display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
      padding: 6px 9px; background: transparent; border: none; border-radius: 5px;
      color: #d1d4dc; font-family: 'Rajdhani',sans-serif; font-weight: 600;
      font-size: .78rem; letter-spacing: .3px; cursor: pointer; transition: background .13s; white-space: nowrap;
    }
    .tv-tbtn svg { width: 16px; height: 16px; opacity: .85; }
    .tv-tbtn:hover { background: #2a2e39; }

    /* Square icon buttons */
    .tv-icbtn {
      width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
      background: transparent; border: none; border-radius: 5px; flex-shrink: 0;
      color: #b2b5be; cursor: pointer; transition: all .13s;
    }
    .tv-icbtn svg { width: 16px; height: 16px; }
    .tv-icbtn:hover { background: #2a2e39; color: #fff; }
    .tv-icbtn.active { background: rgba(41,98,255,.18); color: #5b9cff; }
    .tv-top-right { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; padding-left: 6px; }

    /* BODY — flexes to fill the chart column (minus toolbar) */
    .tv-body { flex: 1 1 auto; display: flex; min-height: 0; }

    /* LEFT vertical drawing tools */
    .tv-lefttools {
      width: 46px; flex-shrink: 0; background: #131722;
      border-right: 1px solid #2a2e39;
      display: flex; flex-direction: column; align-items: center;
      padding: 6px 0; gap: 2px; overflow-y: auto; scrollbar-width: none;
    }
    .tv-lefttools::-webkit-scrollbar { display: none; }
    .tv-tool {
      width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
      background: transparent; border: none; border-radius: 6px;
      color: #989fac; cursor: pointer; transition: all .13s; flex-shrink: 0;
    }
    .tv-tool svg { width: 19px; height: 19px; }
    .tv-tool:hover { background: #2a2e39; color: #fff; }
    .tv-tool.active { background: rgba(41,98,255,.2); color: #5b9cff; }
    .tv-toggle.active { background: rgba(34,197,94,.2); color: #4ade80; }
    .tv-trash:hover { background: rgba(239,68,68,.18); color: #f87171; }
    .tv-tool-sep { width: 22px; height: 1px; background: #2a2e39; margin: 4px 0; }

    /* Canvas area + OHLC overlay */
    .tv-canvas-wrap { flex: 1; display: flex; flex-direction: column; position: relative; min-width: 0; min-height: 0; background: #0e1117; }
    .term-chart-canvas { background: #0e1117 !important; cursor: crosshair; flex: 1; display: block; width: 100%; }
    .tv-ohlc {
      position: absolute; top: 8px; left: 10px; z-index: 6;
      display: flex; flex-direction: column; gap: 2px;
      pointer-events: none; font-family: 'JetBrains Mono','Consolas',monospace;
    }
    .tv-ohlc-sym {
      font-family: 'Rajdhani',sans-serif; font-weight: 700; font-size: .82rem;
      letter-spacing: .6px; color: #d1d4dc;
    }
    .tv-ohlc-vals { font-size: .72rem; letter-spacing: .2px; color: #787b86; }
    .tv-ohlc-vals .v { color: #d1d4dc; }
    .tv-ohlc-vals .up { color: #26a69a; }
    .tv-ohlc-vals .dn { color: #ef5350; }

    /* Popover */
    .tv-popover {
      position: absolute; z-index: 50; max-width: 240px;
      background: #1c2030; border: 1px solid #2a2e39; border-radius: 9px;
      padding: 12px 14px; box-shadow: 0 14px 38px rgba(0,0,0,.65);
      color: #d1d4dc; font-size: .78rem; line-height: 1.5;
    }
    .tv-popover[hidden] { display: none; }
    .tv-popover h5 {
      margin: 0 0 5px; font-family: 'Rajdhani',sans-serif; font-size: .92rem;
      font-weight: 800; letter-spacing: .5px; color: #fff;
    }
    .tv-popover p { margin: 0; color: #989fac; }

    /* Order form — dark */
    .term-order { background: #0b0f12 !important; border-top: none !important; border-bottom: 1px solid rgba(34,197,94,.1) !important; padding: 12px 14px; }
    .term-dir-tabs { background: rgba(255,255,255,.04) !important; border-color: rgba(34,197,94,.18); border-radius: 8px; }
    .tdt { color: rgba(240,253,244,.32) !important; font-size: .75rem !important; padding: 8px; }
    .tdt[data-dir="buy"].active  { background: rgba(34,197,94,.18) !important; color: #4ade80 !important; }
    .tdt[data-dir="sell"].active { background: rgba(239,68,68,.16) !important; color: #f87171 !important; }
    .term-input-group label { color: rgba(240,253,244,.32) !important; font-size: .58rem; }
    .term-input-group input[type="number"] { background: rgba(255,255,255,.05) !important; border-color: rgba(34,197,94,.22) !important; color: rgba(240,253,244,.92) !important; font-size: .82rem !important; padding: 7px 10px; }
    .term-input-group input:focus { border-color: #4ade80 !important; box-shadow: 0 0 0 2px rgba(34,197,94,.12); }
    .info-tip { background: rgba(34,197,94,.12) !important; border-color: rgba(34,197,94,.22) !important; color: #4ade80 !important; }
    .lev-btn { background: rgba(34,197,94,.06) !important; border-color: rgba(34,197,94,.25) !important; color: rgba(240,253,244,.78) !important; font-size: .98rem !important; padding: 13px 4px !important; }
    .lev-btn:hover { background: rgba(34,197,94,.14) !important; color: rgba(240,253,244,.95) !important; border-color: rgba(34,197,94,.5) !important; }
    .lev-btn.active { background: rgba(34,197,94,.25) !important; color: #4ade80 !important; border-color: #22c55e !important; font-weight: 800 !important; }
    .lev-btn.high-risk { background: rgba(239,68,68,.06) !important; color: rgba(248,113,113,.72) !important; border-color: rgba(239,68,68,.28) !important; }
    .lev-btn.high-risk:hover { background: rgba(239,68,68,.15) !important; color: #f87171 !important; border-color: rgba(239,68,68,.5) !important; }
    .lev-btn.high-risk.active { background: rgba(239,68,68,.22) !important; color: #f87171 !important; border-color: #ef4444 !important; }
    .qa-chip { background: rgba(255,255,255,.04) !important; border-color: rgba(34,197,94,.18) !important; color: rgba(240,253,244,.62) !important; font-size: .8rem !important; padding: 8px 0 !important; }
    .qa-chip:hover { background: rgba(34,197,94,.1) !important; color: #4ade80 !important; border-color: rgba(34,197,94,.4) !important; }
    .qa-chip.max { color: #fbbf24 !important; border-color: rgba(251,191,36,.28) !important; }
    .exposure-row { background: rgba(34,197,94,.06) !important; border-color: rgba(34,197,94,.16) !important; }
    .exposure-row .exp-label { color: rgba(240,253,244,.42); }
    .exposure-row .exp-value { color: #4ade80 !important; }
    #termLevWarning { background: rgba(245,158,11,.08) !important; border-color: rgba(245,158,11,.3) !important; color: #fbbf24 !important; font-size: .68rem; }
    #termLevWarning .ic { color: #fbbf24; }
    .order-price-line { color: rgba(240,253,244,.32) !important; }
    .order-price-line strong { color: rgba(240,253,244,.65) !important; }
    .term-execute-btn { padding: 11px; font-size: .85rem !important; }

    /* Positions section — dark */
    .term-portfolio-sidebar { background: #0b0f12 !important; border-left: 1px solid rgba(34,197,94,.1); padding: 0; }
    .term-portfolio-sidebar .term-positions-section { padding: 8px 12px 12px; }
    .term-section-hdr { color: rgba(240,253,244,.32) !important; border-bottom-color: rgba(34,197,94,.1); font-size: .56rem; padding: 6px 4px 5px; }
    .term-section-hdr .ic { color: rgba(240,253,244,.28); }
    .term-empty { color: rgba(240,253,244,.22) !important; font-size: .7rem; }
    .tp-row { background: rgba(255,255,255,.03) !important; border-color: rgba(34,197,94,.12) !important; box-shadow: none; padding: 8px 10px; }
    .tpr-sym { color: rgba(240,253,244,.85) !important; font-size: .76rem; }
    .tpr-lev { background: rgba(255,255,255,.06) !important; color: rgba(240,253,244,.5) !important; font-size: .58rem; }
    .tpr-dir.buy  { color: #4ade80 !important; }
    .tpr-dir.sell { color: #f87171 !important; }
    .tpr-entry { color: rgba(240,253,244,.32) !important; font-size: .62rem; }
    .tpr-pnl { font-size: .82rem; }
    .tpr-pnl.up { color: #4ade80 !important; }
    .tpr-pnl.dn { color: #f87171 !important; }
    .tpr-close { background: rgba(239,68,68,.12) !important; border-color: rgba(239,68,68,.22) !important; color: #f87171 !important; font-size: .62rem; padding: 4px 8px; }
    .tpr-close:hover { background: rgba(239,68,68,.22) !important; }

    .ldb-card-outer { background: linear-gradient(165deg,#fff,#f4faf6 60%,#ecfdf5) !important; border-color: rgba(34,197,94,.32) !important; box-shadow: 0 10px 36px rgba(34,197,94,.14), 0 0 0 1px rgba(255,255,255,.6) inset; }
    .ldb-h-title { color: #0a130b !important; }
    .ldb-h-sub { color: rgba(20,40,28,.55) !important; }
    .ldb-myrank .ldb-mr-label { color: rgba(20,40,28,.5) !important; }
    .ldb-myrank .ldb-mr-pos { color: #15803d !important; }
    .ldb-row { background: #fff !important; border: 1.5px solid rgba(34,197,94,.12) !important; transition: transform .2s cubic-bezier(.22,1,.36,1), border-color .2s, box-shadow .2s, background .2s; }
    .ldb-row:hover { background: #fff !important; border-color: rgba(34,197,94,.5) !important; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(34,197,94,.2) !important; }
    .ldb-row:has(.ldb-rank-medal.gold)   { background: linear-gradient(90deg, rgba(251,191,36,.22), rgba(255,255,255,.5) 62%) !important; border-color: rgba(251,191,36,.5) !important; }
    .ldb-row:has(.ldb-rank-medal.silver) { background: linear-gradient(90deg, rgba(148,163,184,.22), rgba(255,255,255,.5) 62%) !important; border-color: rgba(148,163,184,.5) !important; }
    .ldb-row:has(.ldb-rank-medal.bronze) { background: linear-gradient(90deg, rgba(217,119,6,.18), rgba(255,255,255,.5) 62%) !important; border-color: rgba(217,119,6,.45) !important; }
    .ldb-table .ldb-row.is-me { background: linear-gradient(90deg, rgba(34,197,94,.24), rgba(34,197,94,.06)) !important; border-color: rgba(34,197,94,.62) !important; box-shadow: 0 4px 22px rgba(34,197,94,.22) !important; }
    .ldb-row.is-me .ldb-name { color: #15803d !important; }
    .ldb-rank-num { color: rgba(20,40,28,.55) !important; }
    .ldb-rank-medal.gold   { color: #f59e0b; filter: drop-shadow(0 1px 2px rgba(245,158,11,.55)); }
    .ldb-rank-medal.silver { color: #94a3b8; filter: drop-shadow(0 1px 2px rgba(148,163,184,.55)); }
    .ldb-rank-medal.bronze { color: #d97706; filter: drop-shadow(0 1px 2px rgba(217,119,6,.55)); }
    .ldb-name { color: #0a130b !important; }
    .ldb-col { color: rgba(20,40,28,.75) !important; }
    .ldb-col.up { color: #15803d !important; }
    .ldb-col.dn { color: #b91c1c !important; }
    .ldb-streak.win  { background: rgba(34,197,94,.18); color: #15803d; }
    .ldb-streak.loss { background: rgba(239,68,68,.18); color: #b91c1c; }
    .ldb-table-head { color: rgba(20,40,28,.5) !important; }

    /* ══ PODIUM — top 3 trader, stile classifica reale ══ */
    .ldb-podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin: 6px 0 26px; flex-wrap: nowrap; }
    .ldb-pod {
      position: relative; display: flex; flex-direction: column; align-items: center;
      text-align: center; width: clamp(108px, 24vw, 206px); padding: 14px 12px 0;
      border-radius: 16px 16px 0 0;
      transition: transform .28s cubic-bezier(.22,1,.36,1);
    }
    .ldb-pod-p1 { width: clamp(124px, 27vw, 224px); background: linear-gradient(180deg, rgba(254,243,199,.9), rgba(255,255,255,0) 78%); }
    .ldb-pod-p2 { background: linear-gradient(180deg, rgba(241,245,249,.95), rgba(255,255,255,0) 78%); }
    .ldb-pod-p3 { background: linear-gradient(180deg, rgba(255,237,213,.9), rgba(255,255,255,0) 78%); }
    .ldb-pod:hover { transform: translateY(-7px); }
    .ldb-pod-crown svg { width: 26px; height: 26px; }
    .ldb-pod-p1 .ldb-pod-crown svg { width: 34px; height: 34px; color: #f59e0b; filter: drop-shadow(0 3px 6px rgba(245,158,11,.6)); }
    .ldb-pod-p2 .ldb-pod-crown svg { color: #94a3b8; filter: drop-shadow(0 2px 4px rgba(148,163,184,.55)); }
    .ldb-pod-p3 .ldb-pod-crown svg { color: #d97706; filter: drop-shadow(0 2px 4px rgba(217,119,6,.55)); }
    .ldb-pod-av {
      margin-top: 7px; width: 58px; height: 58px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-family: 'Rajdhani',sans-serif; font-weight: 800; font-size: 1.3rem;
      color: #fff; overflow: hidden;
    }
    .ldb-pod-p1 .ldb-pod-av { width: 82px; height: 82px; font-size: 1.85rem; box-shadow: 0 0 0 4px #fff, 0 0 0 7px #f59e0b, 0 10px 26px rgba(245,158,11,.55); }
    .ldb-pod-p2 .ldb-pod-av { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #94a3b8, 0 7px 18px rgba(148,163,184,.5); }
    .ldb-pod-p3 .ldb-pod-av { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #d97706, 0 7px 18px rgba(217,119,6,.5); }
    .ldb-pod-name { margin-top: 14px; font-family: 'Rajdhani',sans-serif; font-weight: 700; font-size: .94rem; color: #0a130b; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ldb-pod-p1 .ldb-pod-name { font-size: 1.05rem; }
    .ldb-pod-name em { color: #15803d; font-style: normal; font-size: .6rem; letter-spacing: .5px; }
    .ldb-pod-pnl { font-family: 'Rajdhani',sans-serif; font-weight: 800; font-size: 1.05rem; margin-top: 4px; }
    .ldb-pod-p1 .ldb-pod-pnl { font-size: 1.25rem; }
    .ldb-pod-pnl.up { color: #15803d; }
    .ldb-pod-pnl.dn { color: #b91c1c; }
    .ldb-pod-wr { margin-top: 3px; font-size: .64rem; font-weight: 600; color: rgba(20,40,28,.5); }
    .ldb-pod-base {
      margin-top: 14px; width: 100%; display: flex; align-items: flex-start; justify-content: center;
      padding-top: 9px; border-radius: 12px 12px 0 0; color: #fff;
      box-shadow: inset 0 2px 0 rgba(255,255,255,.5);
    }
    .ldb-pod-base span { font-family: 'Rajdhani',sans-serif; font-weight: 800; font-size: 1.55rem; text-shadow: 0 2px 4px rgba(0,0,0,.28); }
    .ldb-pod-p1 .ldb-pod-base { height: 78px; background: linear-gradient(180deg, #fbbf24, #d97706); }
    .ldb-pod-p2 .ldb-pod-base { height: 58px; background: linear-gradient(180deg, #cbd5e1, #64748b); }
    .ldb-pod-p3 .ldb-pod-base { height: 44px; background: linear-gradient(180deg, #f0b06a, #b45309); }
    .ldb-pod.is-me { outline: 2px dashed rgba(34,197,94,.65); outline-offset: 3px; border-radius: 16px; }

    /* Legal buttons — contact-page style: each card fills with its own colour on hover */
    .term-legal-link { background: #fff !important; border: 1.5px solid rgba(34,197,94,.22) !important; box-shadow: 0 4px 16px rgba(34,197,94,.08); transition: transform .28s cubic-bezier(.22,1,.36,1), background .3s, border-color .25s, box-shadow .3s; }
    .term-legal-link::after { background: linear-gradient(135deg, transparent 38%, rgba(255,255,255,.55) 50%, transparent 62%) !important; }
    .term-ll-icon { transition: background .3s, color .3s, border-color .3s, transform .25s; }
    .term-ll-name { color: #0a130b !important; transition: color .3s; }
    .term-ll-desc { color: rgba(20,40,28,.55) !important; transition: color .3s; }
    .term-legal-link:hover { transform: translateY(-6px); }
    .term-legal-link:hover .term-ll-icon { background: #fff !important; border-color: #fff !important; transform: scale(1.1); }
    .term-legal-link:hover .term-ll-name { color: #fff !important; }
    .term-legal-link:hover .term-ll-desc { color: rgba(255,255,255,.82) !important; }
    .ll-privacy { border-color: rgba(59,130,246,.32) !important; }
    .ll-privacy .term-ll-icon { background: rgba(59,130,246,.14); border-color: rgba(59,130,246,.36); color: #2563eb; }
    .ll-privacy:hover { background: linear-gradient(135deg,#2563eb,#3b82f6) !important; border-color: #3b82f6 !important; box-shadow: 0 16px 38px rgba(59,130,246,.45) !important; }
    .ll-terms { border-color: rgba(34,197,94,.34) !important; }
    .ll-terms .term-ll-icon { background: rgba(34,197,94,.14); border-color: rgba(34,197,94,.36); color: #16a34a; }
    .ll-terms:hover { background: linear-gradient(135deg,#15803d,#22c55e) !important; border-color: #22c55e !important; box-shadow: 0 16px 38px rgba(34,197,94,.45) !important; }
    .ll-cookie { border-color: rgba(245,158,11,.36) !important; }
    .ll-cookie .term-ll-icon { background: rgba(245,158,11,.15); border-color: rgba(245,158,11,.4); color: #d97706; }
    .ll-cookie:hover { background: linear-gradient(135deg,#b45309,#f59e0b) !important; border-color: #f59e0b !important; box-shadow: 0 16px 38px rgba(245,158,11,.45) !important; }
    .ll-disclaimer { border-color: rgba(239,68,68,.34) !important; }
    .ll-disclaimer .term-ll-icon { background: rgba(239,68,68,.13); border-color: rgba(239,68,68,.36); color: #dc2626; }
    .ll-disclaimer:hover { background: linear-gradient(135deg,#b91c1c,#ef4444) !important; border-color: #ef4444 !important; box-shadow: 0 16px 38px rgba(239,68,68,.45) !important; }

    /* SIM vs REAL section */
    .sim-vs-real { max-width: 1800px; margin: 36px auto 0; padding: 0 32px; }
    .svr-card { background: linear-gradient(165deg, #fff 0%, #fef9f3 60%, #fff3e0 100%); border: 1px solid rgba(251,191,36,.45); border-radius: 18px; padding: 32px 36px; box-shadow: 0 12px 38px rgba(251,191,36,.16), 0 0 0 1px rgba(255,255,255,.6) inset; position: relative; overflow: hidden; }
    .svr-card::before { content: ''; position: absolute; top: 0; right: 0; width: 220px; height: 220px; background: radial-gradient(circle at 100% 0%, rgba(251,191,36,.18) 0%, transparent 60%); pointer-events: none; }
    .svr-head { position: relative; z-index: 1; margin-bottom: 24px; }
    .svr-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 20px; background: rgba(251,191,36,.18); border: 1px solid rgba(251,191,36,.5); font-family: 'Rajdhani',sans-serif; font-weight: 800; font-size: .68rem; letter-spacing: 2px; text-transform: uppercase; color: #b45309; margin-bottom: 14px; }
    .svr-eyebrow .ic { width: 13px; height: 13px; color: #b45309; }
    .svr-title { font-family: 'Rajdhani',sans-serif; font-weight: 700; font-size: 1.65rem; color: #0a130b; margin: 0 0 8px; }
    .svr-title em { color: #b45309; font-style: normal; }
    .svr-sub { font-size: .96rem; color: rgba(20,40,28,.65); line-height: 1.55; max-width: 720px; }
    .svr-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px; }
    .svr-col { background: #fff; border-radius: 14px; padding: 20px 22px; border: 1px solid rgba(20,40,28,.1); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
    .svr-col.demo { border-color: rgba(34,197,94,.42); background: linear-gradient(180deg,#fff,#f0fdf4); }
    .svr-col.real { border-color: rgba(239,68,68,.42); background: linear-gradient(180deg,#fff,#fef2f2); }
    .svr-col-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(20,40,28,.1); }
    .svr-col-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .svr-col.demo .svr-col-icon { background: linear-gradient(135deg,#16a34a,#22c55e); color: #fff; box-shadow: 0 4px 14px rgba(34,197,94,.35); }
    .svr-col.real .svr-col-icon { background: linear-gradient(135deg,#dc2626,#b91c1c); color: #fff; box-shadow: 0 4px 14px rgba(239,68,68,.35); }
    .svr-col-icon svg { width: 20px; height: 20px; }
    .svr-col-title { font-family: 'Rajdhani',sans-serif; font-weight: 700; font-size: 1.1rem; color: #0a130b; }
    .svr-col-tag { font-size: .7rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; margin-top: 2px; }
    .svr-col.demo .svr-col-tag { color: #15803d; }
    .svr-col.real .svr-col-tag { color: #b91c1c; }
    .svr-list { display: flex; flex-direction: column; gap: 10px; }
    .svr-item { display: flex; gap: 11px; align-items: flex-start; font-size: .9rem; line-height: 1.5; color: rgba(20,40,28,.78); }
    .svr-item-mark { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
    .svr-col.demo .svr-item-mark { background: rgba(34,197,94,.22); color: #15803d; }
    .svr-col.real .svr-item-mark { background: rgba(239,68,68,.2); color: #b91c1c; }
    .svr-item-mark svg { width: 12px; height: 12px; }
    .svr-item strong { color: #0a130b; font-weight: 700; }
    .svr-actions { position: relative; z-index: 1; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding-top: 20px; border-top: 1px solid rgba(20,40,28,.1); }
    .svr-cta-btn { display: inline-flex; align-items: center; gap: 9px; padding: 13px 26px; border-radius: 10px; font-family: 'Rajdhani',sans-serif; font-weight: 700; font-size: .92rem; letter-spacing: 1.2px; text-decoration: none; transition: transform .25s, box-shadow .25s; }
    .svr-cta-btn.primary { background: linear-gradient(135deg,#b45309,#d97706); color: #fff; box-shadow: 0 6px 22px rgba(217,119,6,.4); }
    .svr-cta-btn.primary:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(217,119,6,.55); }
    .svr-cta-btn .ic { width: 16px; height: 16px; }
    .svr-warn-note { flex: 1; min-width: 220px; font-size: .8rem; color: rgba(20,40,28,.6); line-height: 1.55; }
    .svr-warn-note strong { color: #b45309; font-weight: 700; }
    /* Interactive hover polish — columns lift and glow in their own colour */
    .svr-card { transition: box-shadow .3s; }
    .svr-card:hover { box-shadow: 0 18px 50px rgba(251,191,36,.26), 0 0 0 1px rgba(255,255,255,.6) inset; }
    .svr-col { transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .3s, border-color .25s; }
    .svr-col.demo:hover { transform: translateY(-5px); border-color: rgba(34,197,94,.75) !important; box-shadow: 0 16px 36px rgba(34,197,94,.24); }
    .svr-col.real:hover { transform: translateY(-5px); border-color: rgba(239,68,68,.75) !important; box-shadow: 0 16px 36px rgba(239,68,68,.24); }
    .svr-col-icon { transition: transform .25s; }
    .svr-col:hover .svr-col-icon { transform: scale(1.1) rotate(-4deg); }
    .svr-cta-btn.primary:hover { transform: translateY(-3px) scale(1.02); }

    /* Tooltip override for the JS-injected #_wolfTip — handled by JS now */

    /* ── LIGHT THEME CONTRAST FIXES ──
       Elements that kept their original dark-theme (light) text colors
       on the new light background. Forced to dark text for visibility. */
    /* Achievements — header, progress + locked cards */
    .acc-ach-title { color: rgba(20,40,28,.78) !important; }
    .acc-ach-progress { color: rgba(20,40,28,.6) !important; }
    .acc-ach-progress strong { color: #7c3aed !important; }
    .acc-ach-name { color: rgba(20,40,28,.7) !important; }
    .acc-ach-desc { color: rgba(20,40,28,.5) !important; }
    .acc-ach-card.unlocked .acc-ach-name { color: #0a130b !important; }
    /* Profile "membro dal" date (inline-styled span) */
    #accSince { color: rgba(20,40,28,.6) !important; }
    /* Markets sidebar — category-count badges + section header counts */
    .tm-section-hdr span { color: rgba(20,40,28,.55) !important; }
    /* Category popup colored buttons stay readable on white */
    .tm-cat-pop button { color: rgba(20,40,28,.78) !important; }
    .tm-cat-pop button:hover, .tm-cat-pop button.active { color: #15803d !important; }
    /* Order panel — exposure / price labels + order price value */
    .exposure-row .exp-label,
    .order-price-cell .opc-label { color: rgba(240,253,244,.45) !important; }
    .order-price-cell strong, #termOrderPrice { color: #60a5fa !important; }
    /* Positions sidebar — count badge */
    #posCountBadge { color: rgba(240,253,244,.45) !important; }
    /* Leaderboard — my-rank P&L + win/loss streak chips */
    .ldb-myrank .ldb-mr-pnl { color: #15803d !important; }
    .ldb-myrank .ldb-mr-pnl.dn { color: #b91c1c !important; }
    .ldb-streak.win  { color: #15803d !important; }
    .ldb-streak.loss { color: #b91c1c !important; }
    /* Telegram CTA card — title + subtitle */
    .term-tg-title { color: #0a130b !important; }
    .term-tg-sub { color: rgba(20,40,28,.6) !important; }

    /* ── STOP LOSS / TAKE PROFIT inputs (light theme) ── */
    .term-sltp-row { margin-top: 2px; }
    .term-sltp-row .term-input-group input[type="number"] {
      background: rgba(255,255,255,.05) !important;
      border-color: rgba(34,197,94,.22) !important;
      color: rgba(240,253,244,.9) !important;
      font-size: .92rem !important;
      padding: 8px 10px;
    }
    .term-sltp-row .term-input-group input::placeholder { color: rgba(240,253,244,.25); }
    .term-sltp-row .term-input-group input:focus { border-color: #4ade80 !important; box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
    .sltp-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
    .sltp-chip { font-size: .66rem !important; padding: 5px 0 !important; }
    .sltp-chips[data-target="sl"] .sltp-chip {
      color: #b91c1c !important; border-color: rgba(239,68,68,.32) !important;
    }
    .sltp-chips[data-target="sl"] .sltp-chip:hover {
      background: rgba(239,68,68,.12) !important; color: #b91c1c !important; border-color: rgba(239,68,68,.55) !important;
    }
    .sltp-chips[data-target="tp"] .sltp-chip {
      color: #15803d !important; border-color: rgba(34,197,94,.32) !important;
    }
    .sltp-chips[data-target="tp"] .sltp-chip:hover {
      background: rgba(34,197,94,.12) !important; color: #15803d !important; border-color: rgba(34,197,94,.55) !important;
    }
    .sltp-hint {
      font-size: .62rem; line-height: 1.35;
      color: rgba(240,253,244,.42);
      margin-top: 1px;
    }
    /* Positions list — SL/TP summary line */
    .tpr-sltp {
      display: flex; gap: 8px; flex-wrap: wrap;
      font-size: .6rem; font-weight: 600;
      font-variant-numeric: tabular-nums;
    }
    .tpr-sltp .sl-tag { color: #b91c1c; }
    .tpr-sltp .tp-tag { color: #15803d; }

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

    /* chart canvas uses flex:1 from the rule above — no absolute positioning needed */

    /* Chart settings popover panel */
    .tv-settings-panel { position: absolute; z-index: 60; width: 210px;
      background: #1c2030; border: 1px solid #2a2e39; border-radius: 9px;
      padding: 8px; box-shadow: 0 14px 38px rgba(0,0,0,.65); }
    .tv-settings-panel[hidden] { display: none; }
    .tv-settings-panel .sp-row {
      display: flex; align-items: center; justify-content: space-between;
      padding: 7px 9px; border-radius: 6px; cursor: pointer;
      color: #d1d4dc; font-family: 'Rajdhani',sans-serif; font-weight: 600;
      font-size: .82rem; letter-spacing: .3px; }
    .tv-settings-panel .sp-row:hover { background: #2a2e39; }
    .tv-settings-panel .sp-row .sp-state { color: #5b9cff; font-weight: 700; font-size: .72rem; }

    /* ── Order section (compact) ── */
    .term-order { padding: 12px 16px; border-top: 1px solid rgba(34,197,94,.1); flex-shrink: 0; }

    .term-dir-tabs {
      display: flex; gap: 0;
      margin-bottom: 10px;
      border: 1px solid rgba(34,197,94,.2);
      border-radius: 8px; overflow: hidden;
    }
    .tdt {
      flex: 1; padding: 8px;
      font-family: var(--fh); font-weight: 700; font-size: .75rem; letter-spacing: 1.2px;
      border: none; cursor: pointer; background: transparent;
      color: rgba(240,253,244,.32);
      transition: all .2s;
      display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    }
    .tdt[data-dir="buy"].active  { background: rgba(34,197,94,.18);  color: #4ade80; }
    .tdt[data-dir="sell"].active { background: rgba(239,68,68,.16); color: #f87171; }

    .term-order-inputs { display: flex; flex-direction: column; gap: 8px; }
    /* Horizontal 2-col row: Importo (left) + Leva (right) */
    .term-input-row {
      display: grid;
      grid-template-columns: minmax(120px, 1fr) minmax(0, 1.4fr);
      gap: 10px;
      align-items: stretch;
    }
    /* Importo + Leva stack full-width so the 7 leverage buttons have room to breathe */
    .term-input-row.order-main-row { grid-template-columns: 1fr; }
    .term-input-group { display: flex; flex-direction: column; gap: 4px; }
    .term-input-group label {
      font-size: .58rem; font-weight: 700; letter-spacing: 1.4px;
      text-transform: uppercase;
      color: rgba(240,253,244,.32);
      display: flex; align-items: center; gap: 5px;
    }
    .term-input-group input[type="number"] {
      background: rgba(255,255,255,.05);
      border: 1px solid rgba(34,197,94,.22);
      border-radius: 7px;
      padding: 7px 10px;
      color: rgba(240,253,244,.92);
      font-size: .82rem; font-weight: 600;
      width: 100%; box-sizing: border-box; outline: none;
      font-family: var(--fb);
      transition: border-color .2s;
    }
    .term-input-group input:focus { border-color: #4ade80; }

    .info-tip {
      display: inline-flex; align-items: center; justify-content: center;
      width: 14px; height: 14px; border-radius: 50%;
      background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.22);
      color: #4ade80; cursor: help; flex-shrink: 0;
    }
    .info-tip svg { width: 9px; height: 9px; }

    .leverage-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .lev-btn {
      padding: 13px 4px;
      font-family: var(--fh); font-weight: 700; font-size: .98rem; letter-spacing: .3px;
      border: 1px solid rgba(34,197,94,.25);
      border-radius: 6px;
      background: rgba(34,197,94,.06);
      color: rgba(240,253,244,.7);
      cursor: pointer; text-align: center;
      min-width: 0;
      transition: all .15s;
    }
    /* LIVE timeframe button */
    .tf-btn.tf-live { color: #4ade80; font-weight: 800; letter-spacing: .6px; }
    .tf-btn.tf-live::before { content: '●'; font-size: .45rem; vertical-align: middle; margin-right: 3px; animation: livePulse 1.4s ease-in-out infinite; }
    @keyframes livePulse { 0%,100% { opacity:1; } 50% { opacity:.3; } }
    .tf-btn.tf-live.active { background: rgba(34,197,94,.18); border-color: rgba(34,197,94,.45); }
    .lev-btn:hover { background: rgba(34,197,94,.1); color: rgba(240,253,244,.8); border-color: rgba(34,197,94,.4); }
    .lev-btn.active { background: rgba(34,197,94,.22); color: #4ade80; border-color: var(--gd); transform: scale(1.04); }
    .lev-btn.high-risk { border-color: rgba(239,68,68,.2); background: rgba(239,68,68,.05); color: rgba(248,113,113,.5); }
    .lev-btn.high-risk:hover { background: rgba(239,68,68,.12); color: #f87171; border-color: rgba(239,68,68,.4); }
    .lev-btn.high-risk.active { background: rgba(239,68,68,.2); color: #f87171; border-color: #ef4444; }

    /* Inline summary row: exposure + order price side by side */
    .term-summary-row {
      display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    }
    .exposure-row, .order-price-cell {
      display: flex; justify-content: space-between; align-items: center;
      padding: 7px 10px;
      border-radius: 7px;
      font-size: .68rem;
      gap: 6px;
    }
    .exposure-row {
      background: rgba(34,197,94,.06);
      border: 1px solid rgba(34,197,94,.16);
    }
    .order-price-cell {
      background: rgba(59,130,246,.05);
      border: 1px solid rgba(59,130,246,.18);
    }
    .exposure-row .exp-label,
    .order-price-cell .opc-label { color: rgba(240,253,244,.42); font-size: .62rem; letter-spacing: .3px; text-transform: uppercase; }
    .exposure-row .exp-value {
      font-family: var(--fh); font-weight: 700; font-size: .82rem; color: #4ade80;
      font-variant-numeric: tabular-nums;
    }
    .order-price-cell strong {
      font-family: var(--fh); font-weight: 700; font-size: .82rem; color: #93c5fd;
      font-variant-numeric: tabular-nums;
    }

    #termLevWarning {
      display: none; align-items: center; gap: 6px;
      padding: 7px 10px;
      background: rgba(245,158,11,.08);
      border: 1px solid rgba(245,158,11,.3);
      border-radius: 7px;
      font-size: .68rem; color: #fbbf24; line-height: 1.4;
    }
    #termLevWarning .ic { color: #fbbf24; flex-shrink: 0; }

    .term-execute-btn {
      width: 100%; padding: 11px;
      border: none; border-radius: 9px;
      font-family: var(--fh); font-weight: 700; font-size: .85rem; letter-spacing: 1.5px;
      cursor: pointer; transition: all .2s;
      display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    }
    .term-execute-btn.buy  { background: linear-gradient(135deg, #16a34a, #22c55e); color: #fff; box-shadow: 0 4px 18px rgba(34,197,94,.35); }
    .term-execute-btn.sell { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; box-shadow: 0 4px 18px rgba(220,38,38,.35); }
    .term-execute-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(34,197,94,.45); }
    .term-execute-btn.sell:hover { box-shadow: 0 8px 26px rgba(220,38,38,.45); }
    .term-execute-btn.err { background: #b45309 !important; box-shadow: none !important; }
    .term-execute-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

    .order-price-line {
      display: flex; justify-content: space-between;
      font-size: .66rem; color: rgba(240,253,244,.32);
      padding: 1px 0;
    }
    .order-price-line strong { color: rgba(240,253,244,.65); font-variant-numeric: tabular-nums; }

    /* ── RIGHT: Order form + positions — unified trade panel ── */
    .term-portfolio-sidebar {
      display: flex; flex-direction: column;
      overflow: hidden;
      min-height: 0;
      height: 100%;
      background: #0b0f12;
    }
    /* Order form sits at top of right panel, no border-top */
    .term-portfolio-sidebar .term-order {
      border-top: none;
      border-bottom: 1px solid rgba(34,197,94,.1);
      flex-shrink: 0;
      overflow-y: auto;
      max-height: 65%;
    }
    .term-portfolio-sidebar .term-order::-webkit-scrollbar { width: 3px; }
    .term-portfolio-sidebar .term-order::-webkit-scrollbar-thumb { background: rgba(34,197,94,.18); border-radius: 2px; }
    /* Positions section below — scrollable */
    .term-positions-section {
      flex: 1; overflow-y: auto; overflow-x: hidden;
      padding: 8px 12px 12px;
      display: flex; flex-direction: column; gap: 5px;
      min-height: 0;
    }
    .term-positions-section::-webkit-scrollbar { width: 4px; }
    .term-positions-section::-webkit-scrollbar-thumb { background: rgba(34,197,94,.18); border-radius: 2px; }

    .term-section-hdr {
      font-size: .56rem; font-weight: 800; letter-spacing: 2px;
      text-transform: uppercase;
      color: rgba(240,253,244,.32);
      padding: 6px 4px 5px;
      border-bottom: 1px solid rgba(34,197,94,.1);
      display: flex; align-items: center; justify-content: space-between;
    }
    .term-section-hdr .ic { color: rgba(240,253,244,.4); }
    .term-empty { font-size: .7rem; color: rgba(240,253,244,.22); text-align: center; padding: 14px 8px; }

    .term-positions { display: flex; flex-direction: column; gap: 5px; }
    .tp-row {
      background: rgba(255,255,255,.03);
      border: 1px solid rgba(34,197,94,.12);
      border-radius: 8px;
      padding: 8px 10px;
      display: flex; flex-direction: column; gap: 4px;
    }
    .tpr-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
    .tpr-sym { font-size: .76rem; font-weight: 700; color: rgba(240,253,244,.85); }
    .tpr-lev {
      font-size: .58rem; font-weight: 700;
      color: rgba(240,253,244,.5);
      background: rgba(255,255,255,.06);
      border-radius: 4px; padding: 1px 6px;
    }
    .tpr-mid { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .tpr-dir {
      font-size: .6rem; font-weight: 700;
      display: inline-flex; align-items: center; gap: 3px;
    }
    .tpr-dir.buy  { color: #4ade80; }
    .tpr-dir.sell { color: #f87171; }
    .tpr-entry { font-size: .62rem; color: rgba(240,253,244,.32); font-variant-numeric: tabular-nums; }
    .tpr-bot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
    .tpr-pnl { font-family: var(--fh); font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; }
    .tpr-pnl.up { color: #4ade80; }
    .tpr-pnl.dn { color: #f87171; }
    .tpr-close {
      background: rgba(239,68,68,.12);
      border: 1px solid rgba(239,68,68,.22);
      border-radius: 5px;
      color: #f87171;
      font-size: .62rem; font-weight: 700;
      cursor: pointer; padding: 3px 8px;
      display: inline-flex; align-items: center; gap: 4px;
      transition: background .2s;
    }
    .tpr-close:hover { background: rgba(239,68,68,.28); }
    .tpr-close .ic { width: 10px; height: 10px; }

    /* ══════════════════════════════════════════
       LEADERBOARD SECTION (full width below terminal)
    ══════════════════════════════════════════ */
    .ldb-section {
      max-width: 1800px; margin: 32px auto 0;
      padding: 0 32px;
    }
    .ldb-card-outer {
      background:
        linear-gradient(165deg, rgba(74,222,128,.08) 0%, rgba(255,255,255,.02) 50%, rgba(0,0,0,.18) 100%);
      border: 1px solid rgba(74,222,128,.28);
      border-radius: 16px; padding: 26px 28px;
      box-shadow: 0 8px 32px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.06);
    }
    .ldb-head {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 18px; flex-wrap: wrap; gap: 12px;
    }
    .ldb-head-left { display: flex; align-items: center; gap: 14px; }
    .ldb-trophy {
      width: 44px; height: 44px; border-radius: 12px;
      background: linear-gradient(135deg, rgba(251,191,36,.2), rgba(251,191,36,.05));
      border: 1px solid rgba(251,191,36,.4);
      display: flex; align-items: center; justify-content: center;
      color: #fbbf24;
    }
    .ldb-h-title {
      font-family: var(--fh); font-weight: 700;
      font-size: 1.1rem; letter-spacing: 1.5px;
      color: #f0fdf4;
    }
    .ldb-h-sub {
      font-size: .72rem; color: rgba(240,253,244,.4); margin-top: 3px;
    }
    .ldb-myrank {
      display: flex; gap: 14px; align-items: center;
    }
    .ldb-myrank .ldb-mr-label {
      font-size: .62rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
      color: rgba(240,253,244,.4);
    }
    .ldb-myrank .ldb-mr-pos {
      font-family: var(--fh); font-weight: 700; font-size: 1.4rem;
      color: #4ade80;
    }
    .ldb-myrank .ldb-mr-pnl {
      font-family: var(--fh); font-weight: 700;
      font-variant-numeric: tabular-nums;
    }

    .ldb-table {
      display: flex; flex-direction: column; gap: 4px;
    }
    .ldb-row {
      display: grid; grid-template-columns: 50px 1fr 100px 100px 130px 100px;
      gap: 12px; align-items: center;
      padding: 11px 14px;
      border-radius: 9px;
      background: rgba(255,255,255,.025);
      border: 1px solid rgba(255,255,255,.05);
      transition: all .2s;
    }
    .ldb-row:hover { background: rgba(34,197,94,.06); border-color: rgba(34,197,94,.2); }
    .ldb-row.is-me { background: linear-gradient(90deg, rgba(34,197,94,.12), rgba(34,197,94,.04)); border-color: rgba(34,197,94,.4); box-shadow: 0 0 24px rgba(34,197,94,.12); }
    .ldb-row.is-me .ldb-name { color: #4ade80; font-weight: 700; }
    .ldb-rank-col { display: flex; align-items: center; gap: 6px; }
    .ldb-rank-num {
      font-family: var(--fh); font-weight: 700; font-size: .9rem;
      color: rgba(240,253,244,.4);
      width: 26px; text-align: center;
    }
    .ldb-rank-medal {
      width: 24px; height: 24px;
      display: flex; align-items: center; justify-content: center;
    }
    .ldb-rank-medal.gold   { color: #fbbf24; }
    .ldb-rank-medal.silver { color: #cbd5e1; }
    .ldb-rank-medal.bronze { color: #d97706; }
    .ldb-name-col { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .ldb-avatar {
      width: 30px; height: 30px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-family: var(--fh); font-weight: 700; font-size: .75rem;
      color: #fff; flex-shrink: 0;
      box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.1);
    }
    .ldb-name {
      font-size: .82rem; font-weight: 600;
      color: rgba(240,253,244,.85);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .ldb-col-label {
      display: none; font-size: .55rem; letter-spacing: 1.5px;
      text-transform: uppercase; color: rgba(240,253,244,.32);
    }
    .ldb-col {
      font-family: var(--fh); font-weight: 700; font-size: .82rem;
      font-variant-numeric: tabular-nums;
      color: rgba(240,253,244,.7);
    }
    .ldb-col.up { color: #4ade80; }
    .ldb-col.dn { color: #f87171; }
    .ldb-streak {
      display: inline-flex; align-items: center; gap: 4px;
      padding: 2px 8px; border-radius: 12px;
      font-size: .65rem; font-weight: 700;
    }
    .ldb-streak.win  { background: rgba(34,197,94,.12);  color: #4ade80; }
    .ldb-streak.loss { background: rgba(239,68,68,.12);  color: #f87171; }
    .ldb-streak .ic { width: 10px; height: 10px; }
    .ldb-table-head {
      display: grid; grid-template-columns: 50px 1fr 100px 100px 130px 100px;
      gap: 12px; padding: 0 14px 8px;
      font-size: .58rem; font-weight: 800; letter-spacing: 2px;
      text-transform: uppercase;
      color: rgba(240,253,244,.32);
    }

    /* ══════════════════════════════════════════
       BOTTOM CTA SECTION (Telegram + Legal cards)
       Replicates contact-page hover-glow style
    ══════════════════════════════════════════ */
    .term-bottom-cta {
      max-width: 1800px; margin: 32px auto 80px;
      padding: 0 32px;
      display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px;
    }
    .term-tg-card {
      position: relative; overflow: hidden;
      background: linear-gradient(135deg, rgba(33,150,243,.1), rgba(13,106,191,.04));
      border: 1px solid rgba(33,150,243,.3);
      border-radius: 16px;
      padding: 28px 30px;
      display: flex; gap: 18px; align-items: center;
      text-decoration: none;
      transition: all .3s;
    }
    .term-tg-card::after {
      content: ''; position: absolute; inset: 0; pointer-events: none;
      background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%);
      transform: translateX(-110%); transition: transform .55s;
    }
    .term-tg-card:hover {
      transform: translateY(-6px);
      border-color: #2196f3;
      background: linear-gradient(135deg, #0d6abf, #2196f3);
      box-shadow: 0 20px 50px rgba(33,150,243,.5);
    }
    .term-tg-card:hover::after { transform: translateX(110%); }
    .term-tg-card:hover .term-tg-icon { background: #fff; color: #1e88e5; box-shadow: 0 6px 22px rgba(0,0,0,.3); }
    .term-tg-card:hover .term-tg-eyebrow { color: rgba(255,255,255,.92) !important; }
    .term-tg-card:hover .term-tg-title { color: #ffffff !important; }
    .term-tg-card:hover .term-tg-sub { color: rgba(255,255,255,.85) !important; }
    .term-tg-card:hover .term-tg-arrow { transform: translateX(4px); background: #fff; border-color: #fff; color: #1e88e5; }
    .term-tg-icon {
      width: 64px; height: 64px; border-radius: 16px;
      background: linear-gradient(135deg, #0d6abf, #2196f3);
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0; color: #fff;
      box-shadow: 0 6px 22px rgba(33,150,243,.45);
      transition: background .3s, color .3s, box-shadow .3s;
    }
    .term-tg-icon svg { width: 32px; height: 32px; }
    .term-tg-info { flex: 1; min-width: 0; }
    .term-tg-eyebrow {
      font-size: .65rem; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase;
      color: rgba(33,150,243,.85);
      margin-bottom: 4px; transition: color .3s;
    }
    .term-tg-title {
      font-family: var(--fh); font-weight: 700;
      font-size: 1.3rem; letter-spacing: .5px;
      color: #f0fdf4; margin-bottom: 5px; transition: color .3s;
    }
    .term-tg-sub {
      font-size: .8rem; color: rgba(240,253,244,.55); line-height: 1.5; transition: color .3s;
    }
    .term-tg-arrow {
      width: 44px; height: 44px; border-radius: 12px;
      background: rgba(33,150,243,.15);
      border: 1px solid rgba(33,150,243,.3);
      display: flex; align-items: center; justify-content: center;
      color: #60a5fa; flex-shrink: 0;
      transition: transform .25s, background .3s, border-color .3s, color .3s;
    }

    .term-legal-grid {
      display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
    }
    .term-legal-link {
      position: relative; overflow: hidden;
      display: flex; flex-direction: column; gap: 4px;
      padding: 14px 16px;
      border-radius: 12px;
      background: rgba(255,255,255,.025);
      border: 1px solid rgba(34,197,94,.14);
      text-decoration: none;
      color: rgba(240,253,244,.7);
      transition: all .25s;
    }
    .term-legal-link::after {
      content: ''; position: absolute; inset: 0; pointer-events: none;
      background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.05) 50%, transparent 60%);
      transform: translateX(-110%); transition: transform .5s;
    }
    .term-legal-link:hover { transform: translateY(-3px); border-color: rgba(34,197,94,.4); box-shadow: 0 10px 28px rgba(34,197,94,.14); color: #4ade80; }
    .term-legal-link:hover::after { transform: translateX(110%); }
    .term-legal-link.warn { border-color: rgba(251,191,36,.18); }
    .term-legal-link.warn:hover { border-color: rgba(251,191,36,.5); color: #fbbf24; box-shadow: 0 10px 28px rgba(251,191,36,.14); }
    .term-ll-icon {
      width: 30px; height: 30px; border-radius: 8px;
      background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.22);
      display: flex; align-items: center; justify-content: center;
      color: #4ade80;
    }
    .term-legal-link.warn .term-ll-icon { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.3); color: #fbbf24; }
    .term-ll-name {
      font-family: var(--fh); font-weight: 700;
      font-size: .82rem; letter-spacing: .5px;
      color: #f0fdf4;
    }
    .term-ll-desc {
      font-size: .68rem; color: rgba(240,253,244,.4);
      line-height: 1.4;
    }

    /* ══════════════════════════════════════════
       TOAST
    ══════════════════════════════════════════ */
    .toast-container {
      position: fixed; top: 80px; right: 20px; z-index: 9990;
      display: flex; flex-direction: column; gap: 10px; pointer-events: none;
    }
    .toast {
      display: flex; align-items: flex-start; gap: 10px;
      padding: 12px 16px; border-radius: 12px;
      min-width: 280px; max-width: 360px;
      font-size: .82rem; font-weight: 500; line-height: 1.4;
      pointer-events: auto;
      box-shadow: 0 8px 32px rgba(0,0,0,.5);
      animation: toastIn .3s cubic-bezier(.22,1,.36,1) both;
      backdrop-filter: blur(10px);
    }
    @keyframes toastIn {
      from { opacity: 0; transform: translateX(30px) scale(.94); }
      to   { opacity: 1; transform: translateX(0) scale(1); }
    }
    .toast.removing { animation: toastOut .3s ease forwards; }
    @keyframes toastOut { to { opacity: 0; transform: translateX(30px) scale(.9); max-height: 0; padding: 0; margin: 0; } }
    .toast-success { background: rgba(10,24,12,.92); border: 1px solid rgba(34,197,94,.4);   color: rgba(240,253,244,.9); }
    .toast-warn    { background: rgba(20,14,4,.92);  border: 1px solid rgba(245,158,11,.4);  color: #fde68a; }
    .toast-info    { background: rgba(7,18,30,.92);  border: 1px solid rgba(59,130,246,.35); color: #93c5fd; }
    .toast-error   { background: rgba(20,5,5,.92);   border: 1px solid rgba(239,68,68,.4);   color: #fca5a5; }
    .toast-icon { width: 22px; height: 22px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
    .toast-icon svg { width: 18px; height: 18px; }
    .toast-body { flex: 1; min-width: 0; }
    .toast-title { font-weight: 700; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
    .toast-msg { font-size: .76rem; opacity: .85; }
    .toast-close {
      background: none; border: none; color: inherit; opacity: .5;
      cursor: pointer; font-size: 1rem; padding: 0 4px; line-height: 1;
      align-self: flex-start;
    }
    .toast-close:hover { opacity: 1; }

    /* ══════════════════════════════════════════
       AVATAR — image upload support
    ══════════════════════════════════════════ */
    .apc-avatar { cursor: pointer; overflow: hidden; }
    .apc-avatar img {
      width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
    }
    .apc-avatar .apc-avatar-overlay {
      position: absolute; inset: 0; border-radius: 50%;
      background: rgba(0,0,0,.5);
      display: flex; align-items: center; justify-content: center;
      color: #fff; opacity: 0; transition: opacity .2s;
      font-size: .55rem; font-weight: 700; letter-spacing: 1px;
      flex-direction: column; gap: 2px;
    }
    .apc-avatar:hover .apc-avatar-overlay { opacity: 1; }
    .apc-avatar .apc-avatar-overlay svg { width: 16px; height: 16px; }

    /* ══════════════════════════════════════════
       ACHIEVEMENTS (compact)
    ══════════════════════════════════════════ */
    .acc-achievements {
      background: linear-gradient(135deg, rgba(168,85,247,.08), rgba(59,130,246,.04) 60%, rgba(0,0,0,.2));
      border: 1px solid rgba(168,85,247,.22);
      border-radius: 16px;
      padding: 16px 18px;
    }
    .acc-ach-head {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 10px;
    }
    .acc-ach-title {
      font-family: var(--fh); font-weight: 700;
      font-size: .8rem; letter-spacing: 1.6px; text-transform: uppercase;
      color: rgba(240,253,244,.7);
      display: flex; align-items: center; gap: 8px;
    }
    .acc-ach-title .ic { color: #c4b5fd; width: 18px; height: 18px; }
    .acc-ach-progress {
      font-family: var(--fh); font-weight: 700; font-size: .76rem;
      color: rgba(240,253,244,.5);
    }
    .acc-ach-progress strong { color: #c4b5fd; }
    /* thin progress bar */
    .acc-ach-bar {
      height: 5px; border-radius: 999px;
      background: rgba(124,58,237,.14);
      overflow: hidden; margin-bottom: 11px;
    }
    .acc-ach-bar-fill {
      height: 100%; border-radius: 999px;
      background: linear-gradient(90deg, #7c3aed, #a855f7);
      box-shadow: 0 0 8px rgba(124,58,237,.5);
      transition: width .7s cubic-bezier(.22,1,.36,1);
    }
    .acc-ach-grid {
      display: flex; flex-direction: column; gap: 4px;
      max-height: 420px; overflow-y: auto;
      padding-right: 6px;
    }
    .acc-ach-grid::-webkit-scrollbar { width: 5px; }
    .acc-ach-grid::-webkit-scrollbar-thumb { background: rgba(124,58,237,.3); border-radius: 3px; }
    /* Tier section header */
    .ach-tier-header {
      display: flex; align-items: center; gap: 10px;
      margin: 10px 0 6px; padding: 7px 12px;
      border-radius: 8px;
      font-family: 'Rajdhani',sans-serif;
      font-weight: 800; font-size: .82rem;
      letter-spacing: 1.5px; text-transform: uppercase;
      border-left: 3px solid;
    }
    .ach-tier-header:first-child { margin-top: 2px; }
    .ach-tier-header.tier-easy      { color: #047857; background: linear-gradient(90deg, rgba(16,185,129,.14), transparent); border-left-color: #10b981; }
    .ach-tier-header.tier-medium    { color: #b45309; background: linear-gradient(90deg, rgba(245,158,11,.16), transparent); border-left-color: #f59e0b; }
    .ach-tier-header.tier-hard      { color: #b91c1c; background: linear-gradient(90deg, rgba(239,68,68,.14), transparent); border-left-color: #ef4444; }
    .ach-tier-header.tier-legendary { color: #6d28d9; background: linear-gradient(90deg, rgba(168,85,247,.16), transparent); border-left-color: #a855f7; }
    .ach-tier-xp { font-weight: 700; font-size: .68rem; opacity: .85; letter-spacing: .5px; }
    .ach-tier-count { margin-left: auto; font-size: .76rem; font-weight: 800; opacity: .9; }
    /* Inner grid for cards within a tier */
    .ach-tier-grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
      gap: 6px;
    }
    /* XP badge on each achievement card */
    .acc-ach-card .acc-ach-xp {
      margin-left: auto; flex-shrink: 0;
      font-family: 'Rajdhani',sans-serif;
      font-weight: 800; font-size: .68rem;
      padding: 3px 8px; border-radius: 999px;
      background: rgba(124,58,237,.12); color: #7c3aed;
      border: 1px solid rgba(124,58,237,.25);
      letter-spacing: .3px; white-space: nowrap;
    }
    .acc-ach-card .acc-ach-xp::before { content: '+'; }
    .acc-ach-card .acc-ach-xp::after  { content: ' XP'; opacity: .65; }
    .acc-ach-card:not(.unlocked) .acc-ach-xp { opacity: .55; }
    .acc-ach-card.tier-easy      .acc-ach-xp { background: rgba(16,185,129,.16);  color: #047857; border-color: rgba(16,185,129,.38); }
    .acc-ach-card.tier-medium    .acc-ach-xp { background: rgba(245,158,11,.18);  color: #b45309; border-color: rgba(245,158,11,.42); }
    .acc-ach-card.tier-hard      .acc-ach-xp { background: rgba(239,68,68,.16);   color: #b91c1c; border-color: rgba(239,68,68,.38); }
    .acc-ach-card.tier-legendary .acc-ach-xp { background: linear-gradient(135deg,#fde68a,#fbbf24); color: #78350f; border-color: rgba(180,83,9,.45); }
    /* Tier accent on unlocked card */
    .acc-ach-card.tier-easy.unlocked      { border-left: 3px solid #10b981 !important; }
    .acc-ach-card.tier-medium.unlocked    { border-left: 3px solid #f59e0b !important; }
    .acc-ach-card.tier-hard.unlocked      { border-left: 3px solid #ef4444 !important; }
    .acc-ach-card.tier-legendary.unlocked { border-left: 3px solid #a855f7 !important; box-shadow: 0 8px 22px -6px rgba(124,58,237,.45) !important; }
    /* Card body wrapper (name + desc) */
    .acc-ach-body { min-width: 0; flex: 1; }
    .acc-ach-card {
      position: relative; overflow: hidden;
      display: flex; align-items: center; gap: 9px;
      padding: 8px 10px;
      border-radius: 9px;
      background: rgba(255,255,255,.025);
      border: 1px solid rgba(255,255,255,.06);
      transition: all .25s;
    }
    .acc-ach-card.unlocked {
      background: linear-gradient(135deg, rgba(168,85,247,.16), rgba(168,85,247,.04));
      border-color: rgba(168,85,247,.4);
      box-shadow: 0 4px 18px rgba(168,85,247,.18);
    }
    .acc-ach-card.unlocked::after {
      content: ''; position: absolute; inset: 0; pointer-events: none;
      background: linear-gradient(115deg, transparent 40%, rgba(196,181,253,.18) 50%, transparent 60%);
      transform: translateX(-110%); transition: transform .8s;
    }
    .acc-ach-card.unlocked:hover::after { transform: translateX(110%); }
    .acc-ach-icon {
      width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: .9rem;
      background: rgba(255,255,255,.05); color: rgba(240,253,244,.3);
      border: 1px solid rgba(255,255,255,.06);
    }
    .acc-ach-card.unlocked .acc-ach-icon {
      background: linear-gradient(135deg, rgba(196,181,253,.3), rgba(168,85,247,.15));
      color: #c4b5fd;
      border-color: rgba(196,181,253,.4);
    }
    .acc-ach-name {
      font-size: .72rem; font-weight: 700; color: rgba(240,253,244,.55);
      letter-spacing: .3px;
    }
    .acc-ach-card.unlocked .acc-ach-name { color: #f0fdf4; }
    .acc-ach-desc {
      font-size: .6rem; color: rgba(240,253,244,.32); margin-top: 1px;
      letter-spacing: .2px;
    }

    /* ══════════════════════════════════════════
       ACHIEVEMENTS — LIGHT THEME (final overrides — win over the dark rules above)
    ══════════════════════════════════════════ */
    .acc-achievements {
      background: linear-gradient(150deg,#fbf7ff,#f3e8ff 55%,#ffffff) !important;
      border: 1px solid rgba(124,58,237,.3) !important;
      box-shadow: 0 8px 22px -8px rgba(124,58,237,.22), inset 0 1px 0 rgba(255,255,255,.9) !important;
    }
    .acc-ach-title { color: #4c1d95 !important; }
    .acc-ach-title .ic { color: #7c3aed !important; }
    .acc-ach-progress { color: rgba(30,25,50,.62) !important; }
    .acc-ach-progress strong { color: #7c3aed !important; }
    .acc-ach-card {
      background: linear-gradient(150deg,#ffffff,#faf6ff) !important;
      border: 1px solid rgba(124,58,237,.2) !important;
      box-shadow: 0 2px 9px rgba(124,58,237,.08) !important;
    }
    .acc-ach-card.unlocked {
      background: linear-gradient(135deg,#f3e8ff,#ffffff) !important;
      border-color: rgba(124,58,237,.55) !important;
      box-shadow: 0 6px 18px -6px rgba(124,58,237,.32) !important;
    }
    .acc-ach-icon {
      background: #f1e7fd !important;
      color: #8b5cf6 !important;
      border: 1px solid rgba(124,58,237,.22) !important;
    }
    .acc-ach-card.unlocked .acc-ach-icon {
      background: linear-gradient(135deg,#7c3aed,#a855f7) !important;
      color: #ffffff !important;
      border-color: rgba(124,58,237,.6) !important;
    }
    .acc-ach-name { color: #1e1432 !important; }
    .acc-ach-card.unlocked .acc-ach-name { color: #4c1d95 !important; }
    .acc-ach-desc { color: rgba(30,25,50,.6) !important; }

    /* ══════════════════════════════════════════
       CSV EXPORT BUTTON in transactions header
    ══════════════════════════════════════════ */
    .at-export-btn {
      display: inline-flex; align-items: center; gap: 5px;
      padding: 5px 10px; border-radius: 6px;
      background: rgba(59,130,246,.1);
      border: 1px solid rgba(59,130,246,.3);
      color: #60a5fa;
      font-size: .65rem; font-weight: 700; letter-spacing: .5px;
      text-transform: uppercase;
      cursor: pointer;
      transition: all .2s;
    }
    .at-export-btn:hover { background: rgba(59,130,246,.2); border-color: rgba(59,130,246,.6); }
    .at-export-btn:disabled { opacity: .35; cursor: not-allowed; }
    .at-export-btn .ic { width: 11px; height: 11px; }

    /* ══════════════════════════════════════════
       CONTEXTUAL CLOSE-POSITION BUTTON
       (appears below execute button when position exists on active asset)
    ══════════════════════════════════════════ */
    .term-close-pos-btn {
      width: 100%; padding: 11px;
      margin-top: 8px;
      border: none; border-radius: 9px;
      background: linear-gradient(135deg, #b91c1c, #dc2626);
      color: #fff;
      font-family: var(--fh); font-weight: 700; font-size: .8rem; letter-spacing: 1.2px;
      cursor: pointer;
      display: none;
      align-items: center; justify-content: space-between; gap: 8px;
      box-shadow: 0 4px 18px rgba(220,38,38,.4);
      transition: all .2s;
      animation: pulseGlow 2s ease infinite;
    }
    .term-close-pos-btn.visible { display: flex; }
    .term-close-pos-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(220,38,38,.55); }
    @keyframes pulseGlow {
      0%,100% { box-shadow: 0 4px 18px rgba(220,38,38,.4); }
      50%      { box-shadow: 0 4px 28px rgba(220,38,38,.7); }
    }
    .term-close-pos-btn .tcp-left {
      display: flex; align-items: center; gap: 8px;
    }
    .term-close-pos-btn .tcp-pnl {
      font-family: var(--fh); font-weight: 700; font-size: .82rem;
      padding: 3px 10px; border-radius: 6px;
      background: rgba(0,0,0,.25);
    }
    .term-close-pos-btn .tcp-pnl.up { color: #4ade80; }
    .term-close-pos-btn .tcp-pnl.dn { color: #fca5a5; }

    /* ══════════════════════════════════════════
       USERNAME EDITOR MODAL
    ══════════════════════════════════════════ */
    .modal-backdrop {
      position: fixed; inset: 0; z-index: 9990;
      background: rgba(0,0,0,.7);
      backdrop-filter: blur(6px);
      display: none; align-items: center; justify-content: center;
      padding: 20px;
    }
    .modal-backdrop.open { display: flex; }
    .modal {
      background: #0a130b;
      border: 1px solid rgba(34,197,94,.3);
      border-radius: 16px;
      padding: 28px;
      max-width: 420px; width: 100%;
      box-shadow: 0 20px 60px rgba(0,0,0,.7);
    }
    .modal h3 {
      font-family: var(--fh); font-weight: 700; font-size: 1.1rem; letter-spacing: 1px;
      color: #f0fdf4; margin: 0 0 6px;
    }
    .modal p { font-size: .8rem; color: rgba(240,253,244,.5); margin: 0 0 16px; }
    .modal input {
      width: 100%; box-sizing: border-box;
      background: rgba(255,255,255,.05);
      border: 1px solid rgba(34,197,94,.25);
      border-radius: 9px;
      padding: 12px 14px;
      color: rgba(240,253,244,.95);
      font-size: .9rem; font-family: var(--fb);
      outline: none;
      transition: border-color .2s;
    }
    .modal input:focus { border-color: #4ade80; }
    .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
    .modal-btn {
      padding: 9px 18px; border-radius: 8px;
      font-family: var(--fh); font-weight: 700; font-size: .76rem; letter-spacing: 1px;
      cursor: pointer; transition: all .2s;
      border: 1px solid;
    }
    .modal-btn.ghost { background: transparent; border-color: rgba(255,255,255,.1); color: rgba(240,253,244,.5); }
    .modal-btn.ghost:hover { color: #f0fdf4; border-color: rgba(255,255,255,.25); }
    .modal-btn.primary { background: linear-gradient(135deg, #16a34a, #22c55e); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(34,197,94,.35); }
    .modal-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(34,197,94,.5); }

    /* ══════════════════════════════════════════
       FULLSCREEN LAYOUT
    ══════════════════════════════════════════ */
    .term-wrap-full:fullscreen {
      overflow-y: auto;
      border-radius: 0;
      background: #07110b;
    }
    .term-wrap-full:fullscreen .term-body-full {
      height: calc(100vh - 40px);
      min-height: 0;
      max-height: none;
    }
    .term-wrap-full:fullscreen .term-markets-sidebar,
    .term-wrap-full:fullscreen .tv-right-panel {
      display: flex;
    }
    .tv-tbtn.has-active {
      color: #4ade80;
      border-bottom-color: #4ade80;
    }
    .tv-tbtn.has-active span { color: #4ade80; }

    /* ══════════════════════════════════════════
       INDICATOR MODAL
    ══════════════════════════════════════════ */
    .ind-backdrop {
      position: fixed; inset: 0; z-index: 9900;
      background: rgba(0,0,0,.65);
      backdrop-filter: blur(4px);
      display: flex; align-items: center; justify-content: center;
      opacity: 0; pointer-events: none;
      transition: opacity .2s;
    }
    .ind-backdrop.open { opacity: 1; pointer-events: all; }
    .ind-modal {
      background: #0d1f15;
      border: 1px solid rgba(34,197,94,.3);
      border-radius: 16px;
      width: 440px; max-width: calc(100vw - 32px);
      max-height: calc(100vh - 80px);
      overflow-y: auto;
      box-shadow: 0 24px 64px rgba(0,0,0,.6);
      transform: translateY(14px);
      transition: transform .22s;
    }
    .ind-backdrop.open .ind-modal { transform: translateY(0); }
    .ind-modal-hdr {
      display: flex; align-items: center; justify-content: space-between;
      padding: 16px 20px 14px;
      border-bottom: 1px solid rgba(34,197,94,.18);
      position: sticky; top: 0; background: #0d1f15; z-index: 2;
    }
    .ind-modal-title {
      font-family: var(--fh); font-weight: 700; font-size: 1rem;
      color: rgba(240,253,244,.92); letter-spacing: .5px;
      display: flex; align-items: center; gap: 9px;
    }
    .ind-modal-title svg { width: 18px; height: 18px; color: #4ade80; }
    .ind-modal-close {
      background: none; border: none; color: rgba(240,253,244,.45);
      cursor: pointer; width: 30px; height: 30px;
      display: flex; align-items: center; justify-content: center;
      border-radius: 7px; transition: all .15s;
    }
    .ind-modal-close:hover { color: rgba(240,253,244,.9); background: rgba(255,255,255,.08); }
    .ind-modal-close svg { width: 17px; height: 17px; }
    .ind-modal-body { padding: 14px 20px 4px; }
    .ind-group { margin-bottom: 20px; }
    .ind-group-title {
      font-size: .6rem; font-weight: 800; letter-spacing: 1.4px;
      text-transform: uppercase; color: rgba(240,253,244,.38);
      margin-bottom: 8px; padding-left: 4px;
    }
    .ind-row {
      display: flex; align-items: center; gap: 12px;
      padding: 10px 12px; border-radius: 10px;
      cursor: pointer; margin-bottom: 4px;
      transition: background .15s; user-select: none;
    }
    .ind-row:hover { background: rgba(255,255,255,.04); }
    .ind-row.active { background: rgba(34,197,94,.06); border: 1px solid rgba(34,197,94,.12); }
    .ind-row:not(.active) { border: 1px solid transparent; }
    .ind-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
    .ind-info { flex: 1; min-width: 0; }
    .ind-name { display: block; font-weight: 700; font-size: .82rem; color: rgba(240,253,244,.88); }
    .ind-desc { display: block; font-size: .69rem; color: rgba(240,253,244,.38); margin-top: 2px; }
    .ind-toggle-wrap { position: relative; flex-shrink: 0; }
    .ind-toggle-wrap input { position: absolute; opacity: 0; width: 0; height: 0; }
    .ind-toggle-track {
      display: block; width: 36px; height: 20px; border-radius: 10px;
      background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14);
      position: relative; cursor: pointer; transition: all .2s;
    }
    .ind-toggle-track::after {
      content: ''; position: absolute; top: 2px; left: 2px;
      width: 14px; height: 14px; border-radius: 50%;
      background: rgba(255,255,255,.45); transition: transform .2s, background .2s;
    }
    .ind-toggle-wrap input:checked + .ind-toggle-track { background: #16a34a; border-color: #22c55e; }
    .ind-toggle-wrap input:checked + .ind-toggle-track::after { transform: translateX(16px); background: #fff; }
    .ind-modal-footer {
      display: flex; gap: 8px; justify-content: flex-end;
      padding: 12px 20px 16px;
      border-top: 1px solid rgba(34,197,94,.12);
      position: sticky; bottom: 0; background: #0d1f15;
    }
    .ind-clear-btn {
      padding: 8px 14px; border-radius: 8px;
      background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.22);
      color: rgba(239,68,68,.7); font-size: .76rem; font-weight: 700;
      cursor: pointer; transition: all .15s;
    }
    .ind-clear-btn:hover { background: rgba(239,68,68,.18); color: #ef4444; }
    .ind-done-btn {
      padding: 8px 20px; border-radius: 8px;
      background: linear-gradient(135deg, #16a34a, #22c55e); border: none;
      color: #fff; font-size: .76rem; font-weight: 700;
      cursor: pointer; transition: all .15s;
    }
    .ind-done-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(34,197,94,.4); }

    /* ══════════════════════════════════════════
       COMPARE MODAL
    ══════════════════════════════════════════ */
    .cmp-backdrop {
      position: fixed; inset: 0; z-index: 9980; background: rgba(0,0,0,.55);
      display: flex; align-items: center; justify-content: center;
      opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    .cmp-backdrop.open { opacity: 1; pointer-events: all; }
    .cmp-modal {
      background: #0d1f15; border: 1px solid rgba(34,197,94,.3); border-radius: 16px;
      width: min(500px, 96vw); max-height: 80vh; display: flex; flex-direction: column;
      transform: translateY(14px); transition: transform .22s;
    }
    .cmp-backdrop.open .cmp-modal { transform: translateY(0); }
    .cmp-modal-hdr {
      display: flex; align-items: center; justify-content: space-between;
      padding: 16px 20px 14px; border-bottom: 1px solid rgba(34,197,94,.18);
    }
    .cmp-modal-title { font-family: var(--fh); font-weight: 700; font-size: 1rem; color: rgba(240,253,244,.92); display: flex; align-items: center; gap: 9px; }
    .cmp-modal-title svg { width: 18px; height: 18px; color: #4ade80; }
    .cmp-modal-close { background: none; border: none; color: rgba(240,253,244,.45); cursor: pointer; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 7px; transition: all .15s; }
    .cmp-modal-close:hover { color: rgba(240,253,244,.9); background: rgba(255,255,255,.08); }
    .cmp-modal-close svg { width: 17px; height: 17px; }
    .cmp-asset-list { padding: 8px 12px 12px; overflow-y: auto; flex: 1; }
    .cmp-group-title { font-size: .58rem; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: rgba(240,253,244,.3); padding: 10px 8px 4px; }
    .cmp-row {
      display: flex; align-items: center; gap: 10px; width: 100%;
      padding: 8px 10px; border-radius: 8px; border: none;
      background: none; color: rgba(240,253,244,.8); text-align: left;
      cursor: pointer; transition: background .12s;
    }
    .cmp-row:hover { background: rgba(34,197,94,.08); }
    .cmp-row.active { background: rgba(34,197,94,.14); color: #4ade80; }
    .cmp-sym { font-weight: 700; font-size: .8rem; min-width: 90px; }
    .cmp-name { font-size: .74rem; color: rgba(240,253,244,.45); }
    .cmp-modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px 14px; border-top: 1px solid rgba(34,197,94,.12); }
    .cmp-clear-btn { padding: 8px 14px; border-radius: 8px; background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.22); color: rgba(239,68,68,.7); font-size: .76rem; font-weight: 700; cursor: pointer; transition: all .15s; }
    .cmp-clear-btn:hover { background: rgba(239,68,68,.18); color: #ef4444; }

    /* ══════════════════════════════════════════
       TEMPLATES MODAL
    ══════════════════════════════════════════ */
    .tpl-backdrop {
      position: fixed; inset: 0; z-index: 9980; background: rgba(0,0,0,.55);
      display: flex; align-items: center; justify-content: center;
      opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    .tpl-backdrop.open { opacity: 1; pointer-events: all; }
    .tpl-modal {
      background: #0d1f15; border: 1px solid rgba(34,197,94,.3); border-radius: 16px;
      width: min(600px, 96vw); max-height: 82vh; display: flex; flex-direction: column;
      transform: translateY(14px); transition: transform .22s;
    }
    .tpl-backdrop.open .tpl-modal { transform: translateY(0); }
    .tpl-modal-hdr { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 14px; border-bottom: 1px solid rgba(34,197,94,.18); }
    .tpl-modal-title { font-family: var(--fh); font-weight: 700; font-size: 1rem; color: rgba(240,253,244,.92); display: flex; align-items: center; gap: 9px; }
    .tpl-modal-title svg { width: 18px; height: 18px; color: #4ade80; }
    .tpl-modal-close { background: none; border: none; color: rgba(240,253,244,.45); cursor: pointer; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 7px; transition: all .15s; }
    .tpl-modal-close:hover { color: rgba(240,253,244,.9); background: rgba(255,255,255,.08); }
    .tpl-modal-close svg { width: 17px; height: 17px; }
    .tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 16px 18px 18px; overflow-y: auto; }
    .tpl-card {
      background: rgba(255,255,255,.03); border: 1px solid rgba(34,197,94,.15);
      border-radius: 12px; padding: 14px 14px 12px; cursor: pointer;
      transition: all .15s; text-align: left;
    }
    .tpl-card:hover { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.35); transform: translateY(-2px); }
    .tpl-card-name { font-weight: 700; font-size: .84rem; color: rgba(240,253,244,.9); margin-bottom: 5px; }
    .tpl-card-desc { font-size: .7rem; color: rgba(240,253,244,.42); line-height: 1.4; }
    .tpl-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
    .tpl-tag { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.2); border-radius: 4px; padding: 1px 6px; font-size: .62rem; font-weight: 700; color: rgba(34,197,94,.8); }

    /* ══════════════════════════════════════════
       RESPONSIVE
    ══════════════════════════════════════════ */
    @media (max-width: 1100px) {
      /* hero: mascot shrinks a little, info column stays beside it */
      .acc-hero {
        grid-template-columns: 300px 1fr;
        gap: 18px; min-height: 290px; padding: 22px 24px;
      }
      .alc-mascot-side { width: 300px; height: 290px; }
      .alc-mascot-side::before { width: 274px; height: 274px; }
      .alc-mascot-side::after { width: 274px; height: 274px; }
      .alc-mascot { width: 282px; height: 282px; }
      .acc-cols { grid-template-columns: 1fr; }
      .term-body-full { grid-template-columns: 200px 1fr 240px; min-height: 620px; height: min(80vh, 760px); }
      .term-bottom-cta { grid-template-columns: 1fr; }
    }
    @media (max-width: 900px) {
      .acc-dashboard { padding: 18px 16px 20px; }
      .acc-stats-grid { grid-template-columns: repeat(2, 1fr); }
      .acc-hero {
        grid-template-columns: 250px 1fr;
        gap: 14px; padding: 18px 18px;
      }
      .alc-mascot-side { width: 250px; height: 250px; }
      .alc-mascot-side::before { width: 234px; height: 234px; }
      .alc-mascot-side::after { width: 234px; height: 234px; }
      .alc-mascot { width: 240px; height: 240px; }
      .apc-name { font-size: 1.42rem; }
      .alc-name { font-size: 1.2rem; }
      .terminal-main-area { padding: 12px 16px 32px; }
      .term-body-full { grid-template-columns: 1fr 220px; }
      .term-markets-sidebar { display: none; }
      .ldb-row, .ldb-table-head { grid-template-columns: 40px 1fr 80px 90px; gap: 8px; padding-left: 10px; padding-right: 10px; }
      .ldb-row .ldb-streak-col, .ldb-table-head .ldb-streak-col { display: none; }
      .ldb-row .ldb-trades-col, .ldb-table-head .ldb-trades-col { display: none; }
      .term-bottom-cta { padding: 0 16px; }
      .ldb-section { padding: 0 12px; }
      /* Mobile leaderboard: tighter card + smaller podium so nothing overflows */
      .ldb-card-outer { padding: 18px 14px; overflow: hidden; }
      .ldb-podium { gap: 8px; margin: 4px 0 18px; }
      .ldb-pod { width: clamp(80px, 24vw, 150px); padding: 10px 6px 0; }
      .ldb-pod-p1 { width: clamp(95px, 28vw, 170px); }
      .ldb-pod-av { width: 46px; height: 46px; font-size: 1.05rem; }
      .ldb-pod-p1 .ldb-pod-av { width: 60px; height: 60px; font-size: 1.4rem; }
      .ldb-pod-name { font-size: .78rem; margin-top: 8px; }
      .ldb-pod-p1 .ldb-pod-name { font-size: .88rem; }
      .ldb-pod-pnl { font-size: .88rem; }
      .ldb-pod-p1 .ldb-pod-pnl { font-size: 1rem; }
      .ldb-pod-wr { font-size: .58rem; }
      .ldb-pod-base { padding-top: 6px; margin-top: 10px; }
      .ldb-pod-base span { font-size: 1.15rem; }
      .ldb-pod-p1 .ldb-pod-base { height: 52px; }
      .ldb-pod-p2 .ldb-pod-base { height: 38px; }
      .ldb-pod-p3 .ldb-pod-base { height: 28px; }
      .ldb-pod-crown svg { width: 20px; height: 20px; }
      .ldb-pod-p1 .ldb-pod-crown svg { width: 24px; height: 24px; }
      /* My-rank box wraps to its own line */
      .ldb-head { flex-direction: column; align-items: stretch; }
      .ldb-myrank { justify-content: space-between; }
      .at-row { grid-template-columns: 70px 1fr 60px 1fr 80px; }
      .at-row .at-lev { display: none; }
    }
    @media (max-width: 640px) {
      .acc-stats-grid { grid-template-columns: 1fr 1fr; }
      /* hero stacks: mascot on top (still prominent), info below */
      .acc-hero {
        grid-template-columns: 1fr;
        gap: 8px; padding: 18px 16px 20px; min-height: 0;
      }
      .alc-mascot-side {
        width: 100%; height: 240px;
        margin: 0 auto;
      }
      .alc-mascot-side::before { width: 250px; height: 250px; }
      .alc-mascot-side::after { width: 250px; height: 250px; }
      .alc-mascot { width: 250px; height: 250px; }
      .alc-rank { margin-left: 0; }
      .hero-footer .apc-since { margin-left: 0; flex: 1 0 100%; }
    }
    @media (max-width: 600px) {
      /* Single-column stack on mobile — let the page scroll, terminal block can be taller */
      .term-body-full { grid-template-columns: 1fr; height: auto; min-height: 0; }
      .term-portfolio-sidebar { border-top: 1px solid rgba(34,197,94,.12); max-height: 320px; }
      .term-center .term-order { max-height: none; }
      .leverage-grid { grid-template-columns: repeat(4, 1fr); }
      .at-row { grid-template-columns: 60px 1fr 70px 80px; }
      .at-row .at-side, .at-row .at-margin { display: none; }
      /* Chart: hide the drawing-tools rail (needs a mouse) so the chart gets full width */
      .tv-lefttools { display: none; }
      /* Compact chart on mobile so the order panel is reachable without much scrolling */
      .tv-chart { min-height: 240px; height: 240px; }
      .term-chart-canvas, .tv-canvas-wrap { min-height: 220px; }
      /* Chart top toolbar: tighter so it scrolls cleanly */
      .tv-topbar { gap: 2px; padding: 6px 6px; }
      /* Icons-only on mobile: hide the text labels so a "(1)" indicator badge
         can't push the Modelli/Confronta icons off the visible toolbar. */
      .tv-tbtn span { display: none; }
      .tv-tbtn { padding: 6px 8px !important; }
      /* Slightly tighter order panel padding so more fits above the fold */
      .term-order { padding: 12px 14px; }
      .terminal-main-area { padding: 10px 12px 28px; }
      /* Smaller leverage buttons on mobile — full-width grid stays at 4 cols
         but buttons aren't huge */
      .lev-btn { padding: 9px 4px !important; font-size: .82rem !important; }
      .leverage-grid { gap: 5px; }
      /* Mobile market picker — tap the asset name in the price bar to open
         the markets sidebar as a fullscreen overlay */
      .tpb-left { cursor: pointer; }
      .tpb-chevron { display: inline-block !important; width: 14px; height: 14px; color: rgba(240,253,244,.55); margin-left: 5px; vertical-align: middle; transition: transform .2s; flex-shrink: 0; }
      body.markets-open .tpb-chevron { transform: rotate(180deg); }
      .term-markets-sidebar.mobile-open {
        display: flex !important;
        position: fixed !important;
        top: 0; left: 0; right: 0; bottom: 0;
        z-index: 9000;
        background: #0b0f12;
        overflow-y: auto;
        padding: 56px 12px 20px;
        border: none;
        animation: slideInUp .25s cubic-bezier(.22,1,.36,1);
      }
      @keyframes slideInUp { from { transform: translateY(8%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
      .term-markets-sidebar.mobile-open .tm-mobile-close { display: flex; }
      .tm-mobile-close {
        display: none;
        position: fixed; top: 14px; right: 14px;
        width: 40px; height: 40px; border-radius: 50%;
        background: rgba(239,68,68,.18); border: 1.5px solid rgba(239,68,68,.5);
        color: #f87171; font-size: 1.6rem; line-height: 1; font-weight: 700;
        cursor: pointer; z-index: 9001;
        align-items: center; justify-content: center;
        font-family: inherit; padding: 0;
      }
      .tm-mobile-close:hover { background: rgba(239,68,68,.3); }
      body.markets-open { overflow: hidden; }
      /* Timeframe dropdown on mobile — escape ancestor overflow so the bottom
         options ("1 Mese", "1 Anno") aren't clipped; allow scroll inside */
      .tv-tf-wrap.open .tv-tf-menu {
        position: fixed !important;
        top: 64px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 24px);
        max-width: 320px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        min-width: 0;
        z-index: 100;
        padding: 8px;
      }
      .tv-tf-menu .tf-btn { font-size: .95rem; padding: 12px 14px; }
      /* Hero footer wraps neatly */
      .hero-footer { flex-wrap: wrap; gap: 8px; }
      .acc-stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
      .acc-stat-card { padding: 12px 12px; }
      .acc-dashboard { padding: 14px 12px 16px; }
    }
  
