/* =================================================================
   BØRSHAI – professional trading-terminal design · black & blue
   Bootstrap 5.3.8 (dark) + this layer. One typeface: IBM Plex Sans.
   Tokens first; components below reuse them.
   ================================================================= */

:root {
  --bg:        #070A10;   /* page                       */
  --panel:     #0D131D;   /* panels / chart surface     */
  --panel-2:   #111925;   /* table heads, inputs        */
  --raise:     #162131;   /* hover, active rows         */
  --line:      #1C2636;   /* hairlines                  */
  --line-2:    #26324A;   /* stronger dividers          */
  --text:      #E6ECF5;
  --text-2:    #B4C0D3;
  --muted:     #8A97AB;
  --accent:    #2F7FF5;   /* signal blue – the one accent */
  --accent-2:  #1F63D1;
  --accent-soft: rgba(47, 127, 245, .14);
  --up:        #26A69A;   /* validated with --down for colour-blind separation */
  --down:      #EF5350;
  --warn:      #E0A100;

  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-panel: 8px;
  --r-ctrl: 6px;
  --r-chip: 4px;

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-body-font-family: var(--font);
  --bs-body-font-size: .9375rem;
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-link-color: #7FB2FF;
  --bs-link-color-rgb: 127, 178, 255;
  --bs-link-hover-color: #A9CBFF;
  --bs-link-hover-color-rgb: 169, 203, 255;
  --bs-emphasis-color: #fff;
  --bs-border-radius: var(--r-ctrl);
}
[data-bs-theme="dark"] {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--panel-2);
  --bs-border-color: var(--line);
}

html { background: var(--bg); }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: .9375rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }
a { text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }

/* Type scale (1.25 ratio) – sentence case everywhere */
h1, .h1 { font-size: 1.75rem; font-weight: 600; letter-spacing: -.01em; color: #fff; }
h2, .h2 { font-size: 1.25rem; font-weight: 600; color: #fff; }
h3, .h3 { font-size: 1.05rem; font-weight: 600; color: #fff; }
.display-5 { font-size: 2rem; font-weight: 600; letter-spacing: -.015em; }
.display-6 { font-size: 1.6rem; font-weight: 600; }
.stencil { font-weight: 600; }                       /* legacy class: now just semibold */
.mono, .num { font-variant-numeric: tabular-nums; } /* aligned figures, same typeface */
.text-muted { color: var(--muted) !important; }
.up   { color: var(--up) !important; }
.down { color: var(--down) !important; }
.flat { color: var(--muted); }
.bi { width: 1em; height: 1em; vertical-align: -.125em; flex-shrink: 0; }
.page-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-title h1 { margin: 0; }
.page-title p { margin: .25rem 0 0; color: var(--muted); }

/* ---------- Simulation notice ---------- */
.sim-strip {
  background: #0A1426;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: .78rem;
  text-align: center;
  padding: .3rem 1rem;
}
.sim-strip a { color: #A9CBFF; }

/* ---------- Ticker tape ---------- */
.ticker-tape {
  overflow: hidden;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-size: .8rem;
  white-space: nowrap;
  position: relative;
  font-variant-numeric: tabular-nums;
}
.ticker-tape::before, .ticker-tape::after { content: ""; position: absolute; top: 0; bottom: 0; width: 48px; z-index: 1; }
.ticker-tape::before { left: 0;  background: linear-gradient(90deg, var(--bg), transparent); }
.ticker-tape::after  { right: 0; background: linear-gradient(-90deg, var(--bg), transparent); }
.ticker-track { display: inline-flex; gap: 2rem; padding: .4rem 0 .4rem 100%; animation: tape 70s linear infinite; }
.ticker-tape:hover .ticker-track { animation-play-state: paused; }
.tick b { color: var(--text-2); font-weight: 500; margin-right: .4rem; }
.tick-price { color: var(--text); margin-right: .35rem; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; padding-left: 1rem; } }

/* ---------- Top bar ---------- */
.gm-nav {
  background: rgba(9, 13, 20, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: .5rem; padding-bottom: .5rem;
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; }
.brand-stamp {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 7px;
  background: linear-gradient(135deg, #3B8BFF, #1F55C4);
  color: #fff; font-size: 1rem;
}
.brand-word { font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; color: #fff; }
.gm-nav .nav-link {
  font-size: .9rem; font-weight: 500;
  color: var(--text-2);
  padding: .45rem .7rem !important;
  border-radius: var(--r-ctrl);
  white-space: nowrap;
}
.gm-nav .nav-link:hover { color: #fff; background: var(--raise); }
.gm-nav .nav-link.active { color: #fff; background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.gm-nav .nav-link .bi { opacity: .75; margin-right: .2rem; }
.nav-search .form-control { width: 160px; }
.nav-money { white-space: nowrap; }
@media (max-width: 1199.98px) { .nav-money { flex-wrap: wrap; padding: .5rem 0; } }

.market-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .75rem; font-weight: 500;
  padding: .2rem .55rem; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text-2);
}
.market-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.market-pill.is-open { color: #8FE0D7; border-color: rgba(38,166,154,.45); }
.market-pill.is-open .dot { background: var(--up); box-shadow: 0 0 0 0 rgba(38,166,154,.6); animation: pulse 2s infinite; }
.market-pill.is-closed .dot { background: var(--down); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(38,166,154,0); } 100% { box-shadow: 0 0 0 0 rgba(38,166,154,0); } }

.cash-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--text); text-decoration: none;
  padding: .3rem .65rem; border-radius: var(--r-ctrl);
  background: var(--panel-2); border: 1px solid var(--line-2);
}
.cash-chip:hover { border-color: var(--accent); color: #fff; }
.cash-plus { color: var(--accent); display: inline-flex; }
.gm-dropdown { --bs-dropdown-bg: var(--panel); --bs-dropdown-border-color: var(--line-2); --bs-dropdown-link-hover-bg: var(--raise); --bs-dropdown-link-active-bg: var(--accent); border-radius: var(--r-panel); font-size: .9rem; }

/* ---------- Panels ---------- */
.gm-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 1.1rem 1.2rem;
}
.gm-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
  margin: -.1rem 0 .9rem;
}
.gm-card-head h2 { font-size: 1rem; font-weight: 600; margin: 0; color: #fff; display: flex; align-items: center; gap: .45rem; }
.gm-card-head h2 .bi { color: var(--muted); }
.gm-card-head .sub { color: var(--muted); font-size: .8rem; }
.gm-card-head h2.up, .gm-card-head h2.down { color: #fff !important; }

/* small badge (was the rotated rubber stamp) */
.stamp {
  display: inline-block;
  font-size: .75rem; font-weight: 500;
  color: #A9CBFF; background: var(--accent-soft);
  padding: .15rem .55rem; border-radius: 999px;
}
.stamp-rotate { transform: none; }

/* ---------- Figures ---------- */
.networth-card .stamp { background: none; padding: 0; color: var(--muted); font-size: .85rem; }
.big-money, .hero-figure {
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  font-weight: 600; letter-spacing: -.02em; line-height: 1.1;
  color: #fff; margin-top: .2rem;
}
.big-price { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 600; color: #fff; line-height: 1; letter-spacing: -.02em; }
.big-price small { font-size: .9rem; color: var(--muted); font-weight: 400; }
.stat-tile { display: flex; flex-direction: column; justify-content: center; gap: .15rem; min-height: 92px; }
.stat-label { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }
.stat-value { font-size: clamp(1.05rem, 1.7vw, 1.35rem); font-weight: 600; color: #fff; white-space: nowrap; }
.stat-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .78rem; color: var(--muted); }
.delta { font-weight: 500; font-variant-numeric: tabular-nums; }
.delta.up::before { content: "▲ "; font-size: .65em; }
.delta.down::before { content: "▼ "; font-size: .65em; }
.kpi-row .stat-tile { min-height: 110px; }

/* key-figure strip under a hero */
.figure-row { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: .6rem; font-size: .9rem; color: var(--text-2); }
.figure-row b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.gm-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--line);
  --bs-table-hover-bg: var(--raise);
  --bs-table-hover-color: #fff;
  margin: 0; font-size: .875rem;
}
.gm-table thead th {
  font-size: .75rem; font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  background: transparent;
  padding-top: .45rem; padding-bottom: .45rem;
}
.gm-table th[data-sort] { cursor: pointer; user-select: none; }
.gm-table th[data-sort]:hover { color: #fff; }
.gm-table th.sorted-asc::after  { content: " ↑"; color: var(--accent); }
.gm-table th.sorted-desc::after { content: " ↓"; color: var(--accent); }
.gm-table td { padding-top: .55rem; padding-bottom: .55rem; font-variant-numeric: tabular-nums; }
.gm-table td.mono, .gm-table td.text-end { white-space: nowrap; }
.sym { font-weight: 600; color: #fff; text-decoration: none; }
a.sym:hover { color: #A9CBFF; text-decoration: underline; }
.nm { color: var(--muted); font-size: .85em; }
.pct-pill { display: inline-block; min-width: 5.4em; padding: .1rem .4rem; border-radius: var(--r-chip); text-align: right; font-weight: 500; }
.up .pct-pill   { background: rgba(38,166,154,.14); }
.down .pct-pill { background: rgba(239,83,80,.14); }
.own-badge { font-size: .65rem; font-weight: 600; color: #A9CBFF; background: var(--accent-soft); padding: .05rem .35rem; border-radius: var(--r-chip); vertical-align: 1px; }
.btn-star { background: none; border: 0; padding: 0 .1rem; color: #4D5B73; line-height: 1; }
.btn-star:hover, .btn-star.on { color: #F5B83D; }
.spark { display: block; }
td.spark-cell { width: 104px; }

/* live price flashes */
.flash-up   { animation: flashUp 1.2s ease-out; }
.flash-down { animation: flashDown 1.2s ease-out; }
@keyframes flashUp   { 0% { background: rgba(38,166,154,.35); } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: rgba(239,83,80,.35); } 100% { background: transparent; } }

/* ---------- Compact lists ---------- */
.mini-list li {
  display: grid; grid-template-columns: 4.4rem 1fr auto 5.2rem; align-items: baseline; gap: .5rem;
  padding: .42rem 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; font-size: .875rem;
}
.mini-list li:last-child { border-bottom: 0; }
.mini-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .chg { text-align: right; }

/* ---------- Buttons ---------- */
.btn {
  --bs-btn-border-radius: var(--r-ctrl);
  --bs-btn-border-radius-sm: var(--r-chip);
  --bs-btn-border-radius-lg: var(--r-ctrl);
  --bs-btn-font-weight: 500;
  font-family: var(--font);
}
.btn-blue {
  --bs-btn-color: #fff; --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #4A90F7; --bs-btn-hover-border-color: #4A90F7;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--accent-2); --bs-btn-active-border-color: var(--accent-2);
  --bs-btn-disabled-color: #8EA3C4; --bs-btn-disabled-bg: #1A2A44; --bs-btn-disabled-border-color: #1A2A44;
}
.btn-outline-blue {
  --bs-btn-color: var(--text-2); --bs-btn-border-color: var(--line-2);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--raise); --bs-btn-hover-border-color: var(--line-2);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--accent-soft); --bs-btn-active-border-color: var(--accent);
}
.btn-buy {
  --bs-btn-color: #fff; --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #4A90F7; --bs-btn-hover-border-color: #4A90F7;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--accent-2); --bs-btn-active-border-color: var(--accent-2);
  --bs-btn-disabled-color: #8EA3C4; --bs-btn-disabled-bg: #1A2A44; --bs-btn-disabled-border-color: #1A2A44;
}
.btn-sell {
  --bs-btn-color: #fff; --bs-btn-bg: #D84340; --bs-btn-border-color: #D84340;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--down); --bs-btn-hover-border-color: var(--down);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #B53532; --bs-btn-active-border-color: #B53532;
  --bs-btn-disabled-color: #C9A2A2; --bs-btn-disabled-bg: #3A1F24; --bs-btn-disabled-border-color: #3A1F24;
}
.btn-paypal {
  --bs-btn-color: #fff; --bs-btn-bg: #003087; --bs-btn-border-color: #003087;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #0070BA; --bs-btn-hover-border-color: #0070BA;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #00256B; --bs-btn-active-border-color: #00256B;
  --bs-btn-disabled-color: #7F93B3; --bs-btn-disabled-bg: #11213D; --bs-btn-disabled-border-color: #11213D;
}
.btn-group-sm > .btn, .btn-sm { font-size: .8rem; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-ctrl); padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; color: var(--text-2); font-size: .8rem; font-weight: 500; padding: .25rem .6rem; border-radius: var(--r-chip); }
.seg button:hover { color: #fff; }
.seg button.active { background: var(--raise); color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }

/* ---------- Forms (inputs carry .shadow-none) ---------- */
.form-control, .form-select, .input-group-text {
  border-radius: var(--r-ctrl);
  background-color: var(--panel-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: .9rem;
}
.form-control:focus, .form-select:focus { background-color: var(--panel-2); border-color: var(--accent); color: #fff; }
.form-control::placeholder { color: #66758C; }
.input-group-text { color: var(--muted); }
.form-label { font-size: .8rem; font-weight: 500; color: var(--text-2); margin-bottom: .3rem; }
.form-check-input { background-color: var(--panel-2); border: 1px solid var(--line-2); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { border-color: var(--accent); }

/* ---------- Trade ticket ---------- */
.trade-ticket { background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.trade-ticket .modal-header, .trade-ticket .modal-footer { border-color: var(--line); }
.trade-ticket .modal-title { color: #fff; font-size: 1.05rem; font-weight: 600; display: flex; gap: .4rem; align-items: center; }
.side-toggle .btn { font-weight: 600; }
.side-toggle .btn-check:not(:checked) + .btn { background: var(--panel-2); border-color: var(--line-2); color: var(--muted); }
.ticket-lines { font-size: .9rem; border-top: 1px solid var(--line); padding-top: .6rem; font-variant-numeric: tabular-nums; }
.ticket-lines > div { padding: .15rem 0; }
.total-line { font-size: 1.05rem; font-weight: 600; border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .4rem !important; color: #fff; }
.trade-box .position-box { border: 1px solid var(--line); border-radius: var(--r-ctrl); padding: .6rem .8rem; background: var(--panel-2); font-variant-numeric: tabular-nums; }

/* ---------- Tags ---------- */
.side-tag, .status-tag, .role-tag {
  display: inline-block; font-size: .7rem; font-weight: 600;
  padding: .1rem .45rem; border-radius: var(--r-chip); border: 1px solid transparent;
}
.side-buy  { color: #A9CBFF; background: var(--accent-soft); }
.side-sell { color: #FFB3B1; background: rgba(239,83,80,.14); }
.status-paid      { color: #8FE0D7; background: rgba(38,166,154,.14); }
.status-pending   { color: #F2CC6B; background: rgba(224,161,0,.14); }
.status-cancelled { color: var(--muted); background: var(--panel-2); }
.status-failed    { color: #FFB3B1; background: rgba(239,83,80,.14); }
.role-player  { color: var(--muted); background: var(--panel-2); }
.role-support { color: #8FE0D7; background: rgba(38,166,154,.14); }
.role-admin   { color: #F2CC6B; background: rgba(224,161,0,.14); }
.ticket-open     { color: #F2CC6B; background: rgba(224,161,0,.14); }
.ticket-answered { color: #A9CBFF; background: var(--accent-soft); }
.ticket-bot      { color: var(--muted); background: var(--panel-2); }
.ticket-closed   { color: var(--muted); background: var(--panel-2); opacity: .75; }
.tx-mini li { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .875rem; }

/* ---------- Markets ---------- */
.breadth { display: flex; gap: 1rem; font-size: .85rem; font-variant-numeric: tabular-nums; }
.breadth-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; gap: 2px; margin-top: .35rem; min-width: 220px; }
.breadth-bar span { display: block; }
.heavy-hitters { font-size: .85rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.hitter { text-decoration: none; color: var(--text); border: 1px solid var(--line); border-radius: var(--r-chip); padding: .15rem .5rem; background: var(--panel); font-variant-numeric: tabular-nums; }
.hitter:hover { border-color: var(--line-2); color: #fff; }

/* ---------- Stock page ---------- */
.chart-wrap { position: relative; }
.chart-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.quote-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1.5rem; font-variant-numeric: tabular-nums; }
.quote-grid > div { display: flex; justify-content: space-between; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.quote-grid span { color: var(--muted); }
.quote-grid b { font-weight: 500; color: #fff; }
@media (min-width: 768px) { .quote-grid { grid-template-columns: repeat(3, 1fr); } }
.range-bar { position: relative; height: 4px; border-radius: 2px; background: var(--line-2); margin: .5rem 0 .25rem; }
.range-bar .fill { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: linear-gradient(90deg, var(--down), var(--muted), var(--up)); opacity: .55; }
.range-bar .mark { position: absolute; top: -4px; width: 2px; height: 12px; background: #fff; border-radius: 1px; }
.range-ends { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.orderbook { width: 100%; font-size: .82rem; font-variant-numeric: tabular-nums; border-collapse: separate; border-spacing: 0 2px; }
.orderbook th { color: var(--muted); font-weight: 500; font-size: .72rem; padding: 0 .4rem .2rem; }
.orderbook td { position: relative; padding: .22rem .4rem; }
.orderbook .bid-bar, .orderbook .ask-bar { position: absolute; top: 1px; bottom: 1px; border-radius: 2px; z-index: 0; }
.orderbook .bid-bar { right: 0; background: rgba(38,166,154,.18); }
.orderbook .ask-bar { left: 0; background: rgba(239,83,80,.18); }
.orderbook span { position: relative; z-index: 1; }

/* ---------- Charts ---------- */
.chart { position: relative; min-height: 120px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.c-grid { stroke: #172031; stroke-width: 1; shape-rendering: crispEdges; }
.c-axis { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.c-ref  { stroke: #4D5B73; stroke-width: 1; stroke-dasharray: 4 4; }
.c-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; font-family: var(--font); }
.c-end  { fill: var(--text); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; font-family: var(--font); }
.c-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-dot  { stroke: var(--panel); stroke-width: 2; }
.c-cross { stroke: #6B7A92; stroke-width: 1; }
.c-hit { cursor: crosshair; outline: none; }
.c-hit:focus-visible { outline: none; }
rect.c-hover { filter: brightness(1.25); }
.chart-tip {
  position: absolute; z-index: 5; display: none; pointer-events: none;
  min-width: 140px; max-width: 260px;
  background: #0A0F18; border: 1px solid var(--line-2); border-radius: var(--r-ctrl);
  padding: .45rem .6rem; font-size: .78rem; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.tip-title { color: var(--muted); margin-bottom: .2rem; font-size: .72rem; }
.tip-row { display: flex; align-items: center; gap: .45rem; font-variant-numeric: tabular-nums; }
.tip-row b { color: #fff; font-weight: 600; }
.tip-label { color: var(--text-2); margin-left: auto; padding-left: .6rem; }
.tip-key { width: 10px; height: 2px; border-radius: 1px; flex: none; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--text-2); margin-bottom: .4rem; }
.lg-item { display: inline-flex; align-items: center; gap: .4rem; }
.lg-line { width: 14px; height: 2px; border-radius: 1px; }
.lg-box  { width: 10px; height: 10px; border-radius: 2px; }
.chart-empty, .empty-note { color: var(--muted); font-size: .875rem; padding: 2.2rem .5rem; text-align: center; margin: 0; }
.hbars { display: flex; flex-direction: column; gap: .3rem; }
.hb-row { display: grid; grid-template-columns: minmax(70px, 42%) 1fr auto; align-items: center; gap: .6rem; font-size: .84rem; color: var(--text); text-decoration: none; padding: .12rem 0; }
a.hb-row:hover .hb-label { color: #A9CBFF; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-label small { color: var(--muted); margin-left: .35rem; }
.hb-track { position: relative; height: 10px; }
.hb-bar { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 0 3px 3px 0; min-width: 2px; }
.is-div .hb-bar.neg { border-radius: 3px 0 0 3px; left: auto; }
.is-div .hb-track::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-2); }
.hb-val { font-variant-numeric: tabular-nums; color: var(--text-2); min-width: 4.8em; text-align: right; }
.tm-group { fill: var(--text-2); font-size: 11px; font-weight: 500; font-family: var(--font); }
.tm-sym { fill: #fff; font-size: 11px; font-weight: 600; font-family: var(--font); pointer-events: none; }
.tm-sym.big { font-size: 15px; }
.tm-chg { fill: rgba(255,255,255,.85); font-size: 11px; font-variant-numeric: tabular-nums; font-family: var(--font); pointer-events: none; }
.tm-tile rect { transition: filter .12s; }
.tm-tile:hover rect, .tm-tile:focus rect { filter: brightness(1.3); }
.heat-legend { display: flex; align-items: center; gap: .5rem; font-size: .75rem; color: var(--muted); }
.heat-legend .scale { width: 140px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #c9403f, #2A3140, #1f8a7f); }

/* ---------- Metric list (analysis) ---------- */
.metric-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem 1.5rem; }
.metric-list dt { font-size: .78rem; color: var(--muted); font-weight: 400; }
.metric-list dd { margin: .1rem 0 0; font-size: 1.15rem; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.metric-list dd small { font-size: .75rem; color: var(--muted); font-weight: 400; display: block; }
.metric-help { font-size: .78rem; color: var(--muted); }
.alloc-meter { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin: .5rem 0; }
.alloc-meter span { display: block; }

/* ---------- Leaderboards ---------- */
.leaderboard li { display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: .5rem; padding: .45rem .3rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.leaderboard .pos { color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.leaderboard .podium-1 .pos { color: #F5C451; }
.leaderboard .podium-2 .pos { color: #C9D1DC; }
.leaderboard .podium-3 .pos { color: #D49A6A; }
.leaderboard .is-me { background: var(--accent-soft); border-radius: var(--r-chip); }
.leaderboard .amt { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Achievements ---------- */
.ach-list li { padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.ach-list li.done { color: #fff; }
.ach-list .ach-ico { color: #3B4860; }
.ach-list li.done .ach-ico { color: var(--tier-color, var(--accent)); }
.gm-progress { height: 5px; border-radius: 3px; background: var(--panel-2); }
.gm-progress .progress-bar { background: var(--tier-color, var(--accent)); border-radius: 3px; }
.tier-bronze   { --tier-color: #D49A6A; }
.tier-silver   { --tier-color: #C9D1DC; }
.tier-gold     { --tier-color: #F5C451; }
.tier-platinum { --tier-color: #8FD3D0; }
.tier-diamond  { --tier-color: #B9A3FF; }
.tier .gm-card-head h2 .bi { color: var(--tier-color); }

/* ---------- Alerts / toasts ---------- */
.gm-alert { border-radius: var(--r-ctrl); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); background: var(--panel); color: var(--text); font-size: .9rem; }
.gm-alert-success { border-left-color: var(--up); }
.gm-alert-warning { border-left-color: var(--warn); }
.gm-alert-danger  { border-left-color: var(--down); }
.gm-alert-info, .gm-alert-blue { border-left-color: var(--accent); }
.gm-toast { border-radius: var(--r-ctrl); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); background: var(--panel); color: var(--text); box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.gm-toast.ok  { border-left-color: var(--up); }
.gm-toast.bad { border-left-color: var(--down); }
.gm-toast .toast-body { font-size: .875rem; font-variant-numeric: tabular-nums; }
.gm-pagination { --bs-pagination-bg: var(--panel); --bs-pagination-border-color: var(--line); --bs-pagination-color: var(--text-2); --bs-pagination-active-bg: var(--accent); --bs-pagination-active-border-color: var(--accent); --bs-pagination-hover-bg: var(--raise); --bs-pagination-hover-color: #fff; --bs-pagination-font-size: .85rem; }

/* ---------- Auth ---------- */
.auth-wrap { display: grid; place-items: center; min-height: 62vh; }
.auth-card { width: 100%; max-width: 440px; padding: 2rem; }

/* ---------- Empty states ---------- */
.empty-vault { text-align: center; padding: 2rem 1rem; border: 1px dashed var(--line-2); border-radius: var(--r-panel); }
.empty-vault .stencil { font-size: 1.1rem !important; color: #fff; }

/* ---------- Cookie banner ---------- */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1080; background: var(--panel); border-top: 1px solid var(--line-2); padding: 1rem 0; box-shadow: 0 -12px 32px rgba(0,0,0,.5); font-size: .9rem; }

/* ---------- Footer ---------- */
.gm-footer { flex-shrink: 0; margin-top: 2.5rem; padding: 1.25rem 0; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); }
.gm-footer a { color: var(--text-2); }
.footer-disclaimer { color: var(--muted); max-width: 90ch; }

/* ---------- Language menu ---------- */
.lang-menu .dropdown-item.active, .lang-menu .dropdown-item:active { background: var(--accent); color: #fff; }

/* ---------- Front page ---------- */
.hero { padding: 3rem 0 1rem; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 2.5rem; align-items: center; }
@media (max-width: 991.98px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-title { font-size: clamp(2.2rem, 5.5vw, 3.6rem); line-height: 1.05; letter-spacing: -.03em; font-weight: 700; color: #fff; margin: .6rem 0 0; }
.hero-lead { font-size: 1.1rem; color: var(--text-2); max-width: 54ch; margin: 1rem 0 0; }
.hero-chart { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1rem .5rem; }
.hero-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.hero-chart-head b { font-size: 1.4rem; color: #fff; font-variant-numeric: tabular-nums; }
.not-real { border-color: rgba(47,127,245,.45); background: linear-gradient(180deg, rgba(47,127,245,.08), var(--panel) 70%); }
.not-real-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; font-size: 1.6rem; color: #fff; background: var(--accent); border-radius: 12px; }
.feature-icon { font-size: 1.4rem; color: #7FB2FF; }
.steps { counter-reset: none; }
.step { padding-top: 1.2rem; }
.step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: #A9CBFF; font-weight: 600; font-size: .85rem; margin-bottom: .6rem; position: static; }
.stats-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.stats-strip div { background: var(--panel); padding: 1.1rem; text-align: center; }
.stats-strip b { display: block; font-size: 1.7rem; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.stats-strip span { font-size: .8rem; color: var(--muted); }
.final-cta { padding: 2.5rem 1.5rem; }
.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 1.6rem; margin-bottom: .5rem; }
.check-list li::before { content: "✕"; position: absolute; left: 0; color: var(--down); font-weight: 600; }
.lesson-num { font-size: .85rem; color: var(--accent); font-weight: 600; }
.gm-accordion { --bs-accordion-bg: var(--panel); --bs-accordion-border-color: var(--line); --bs-accordion-border-radius: var(--r-panel); --bs-accordion-inner-border-radius: var(--r-panel);
  --bs-accordion-btn-color: var(--text); --bs-accordion-active-bg: var(--raise); --bs-accordion-active-color: #fff; --bs-accordion-btn-focus-box-shadow: none; }
.shop-notreal { color: var(--text-2); font-size: .9rem; }

/* ---------- Cash Desk ---------- */
.test-banner { display: inline-block; font-size: .8rem; font-weight: 500; color: #F2CC6B; background: rgba(224,161,0,.12); border: 1px solid rgba(224,161,0,.4); padding: .3rem .8rem; border-radius: var(--r-ctrl); }
.pack-card { text-align: center; padding: 1.75rem 1.5rem 1.5rem; overflow: hidden; }
.pack-hot { border-color: var(--accent); }
.pack-ribbon { position: absolute; top: 12px; right: 12px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; }
.pack-name { font-size: 1.15rem; color: #fff; font-weight: 600; }
.pack-tag { font-size: .85rem; }
.pack-cash { font-size: 2.1rem; font-weight: 600; line-height: 1; margin-top: 1rem; color: #fff; letter-spacing: -.02em; }
.pack-cash small { font-size: 1rem; color: var(--muted); font-weight: 400; }
.pack-sub { font-size: .8rem; color: var(--muted); }
.pack-price { display: inline-block; margin-top: .9rem; font-size: 1.5rem; font-weight: 600; color: #fff; }
.fine-print { padding-left: 1.1rem; }
.fine-print li { margin-bottom: .45rem; color: var(--muted); }

/* ---------- Support chat ---------- */
.support-fab { position: fixed; left: 1rem; bottom: 1rem; z-index: 1070; border-radius: 999px !important; padding: .55rem 1rem; box-shadow: 0 8px 24px rgba(47,127,245,.35); }
.cookie-banner ~ .support-fab { bottom: 7rem; }
.support-panel { --bs-offcanvas-width: 420px; --bs-offcanvas-bg: var(--panel); border-left: 1px solid var(--line-2) !important; }
.support-log { overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.support-log .msg { max-width: 88%; padding: .55rem .8rem; white-space: pre-wrap; font-size: .9rem; line-height: 1.45; border-radius: 10px; }
.support-log .msg small { display: block; font-size: .68rem; color: var(--muted); margin-top: .2rem; }
.msg-user   { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 3px !important; }
.msg-user small { color: rgba(255,255,255,.7) !important; }
.msg-ai     { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 3px !important; }
.msg-staff  { align-self: flex-start; background: rgba(38,166,154,.12); border: 1px solid rgba(38,166,154,.4); }
.msg-system { align-self: center; color: var(--muted); font-size: .8rem !important; text-align: center; background: none; }
.msg-typing { color: var(--muted); letter-spacing: .3em; }
.staff-view { max-height: 55vh; border: 1px solid var(--line); border-radius: var(--r-ctrl); background: var(--bg); }
.support-form { border-top: 1px solid var(--line); }
.support-suggest .btn { font-size: .78rem; }

/* ---------- Back office ---------- */
.admin-tag { font-size: .7rem; font-weight: 600; color: #A9CBFF; background: var(--accent-soft); padding: .1rem .45rem; border-radius: var(--r-chip); margin-left: .3rem; }
.admin-side { border-right: 1px solid var(--line); background: #090D14; }
@media (min-width: 992px) { .admin-side { min-height: calc(100vh - 56px); } }
.admin-side .nav-link { color: var(--text-2); border-radius: var(--r-ctrl); font-size: .9rem; padding: .45rem .7rem; }
.admin-side .nav-link:hover { color: #fff; background: var(--raise); }
.admin-side .nav-link.active { color: #fff; background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.health-list li { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.log-list li { padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; font-size: .875rem; }
.kv dt { color: var(--muted); font-weight: 400; }
.kv dd { margin: 0; }
.ticket-list .list-group-item { background: transparent; color: var(--text); border-color: var(--line); font-size: .875rem; }
.ticket-list .list-group-item.active { background: var(--accent-soft); border-color: var(--line); color: #fff; }
.gm-pills .nav-link { color: var(--text-2); border-radius: var(--r-ctrl); font-size: .875rem; }
.gm-pills .nav-link.active { background: var(--accent); color: #fff; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.funnel li { display: grid; grid-template-columns: 9rem 1fr 6rem; gap: .6rem; align-items: center; padding: .35rem 0; font-size: .875rem; font-variant-numeric: tabular-nums; }
.funnel .bar { height: 14px; border-radius: 0 3px 3px 0; }

/* ---------- Small screens ---------- */
@media (max-width: 575.98px) {
  .gm-card { padding: .95rem; }
  .mini-list li { grid-template-columns: 4rem 1fr 5rem; }
  .mini-list li [data-f="last"] { display: none; }
  .brand-word { font-size: 1.05rem; }
  .funnel li { grid-template-columns: 6.5rem 1fr 4.5rem; }
}

/* ---- additions: segmented links, funnel track, order book bars ---- */
.seg a.btn { border: 0; color: var(--text-2); font-size: .8rem; font-weight: 500; padding: .25rem .7rem; border-radius: var(--r-chip); }
.seg a.btn:hover { color: #fff; }
.seg a.btn.active { background: var(--raise); color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.funnel .bar-track { display: block; background: var(--panel-2); border-radius: 0 3px 3px 0; }
.funnel .bar { display: block; }
.orderbook i { display: block; }
.chart-wrap[aria-busy="true"] { opacity: .55; transition: opacity .2s; }
@media (max-width: 575.98px) {
  .funnel li { grid-template-columns: 6.5rem 1fr 4.5rem; }
  .chart-toolbar .seg { overflow-x: auto; max-width: 100%; }
}

/* ---- candlestick chart: OHLC read-out, price tags ---- */
.ohlc { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .9rem; min-height: 1.6rem; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: .2rem; }
.ohlc b { color: var(--text); font-weight: 600; }
.ohlc b.up { color: var(--up); } .ohlc b.down { color: var(--down); }
.ohlc-t { color: var(--text-2); font-weight: 500; }
.ohlc-key { display: inline-block; width: 10px; height: 2px; border-radius: 1px; margin-right: .3rem; vertical-align: middle; }
.c-tag { fill: #fff; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; font-family: var(--font); pointer-events: none; }
.c-tagbox { fill: #3A475C; }
.c-cross { stroke-dasharray: 3 3; }

/* ---- order ticket with chart ---- */
.trade-ticket .modal-body { padding: 1.25rem; }
.ticket-chart-col { border-right: 1px solid var(--line); }
@media (max-width: 991.98px) { .ticket-chart-col { border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 1rem; } }
