/* ==========================================================================
   Quantara Edge - Unified Design System
   --------------------------------------------------------------------------
   ONE stylesheet for every page: /dashboard, /gamma, /edge, /chart, /tools,
   /automation, /upgrade, /aate and all auth pages. (/hotstocks is now just a
   301 redirect to /tools, not a page of its own - MasterBK 2026-08-14.)

   Sources (nothing here is invented):
     - Background, card and navy palette  ..... live/static/auth.css (account dash)
     - Data-surface / accent palette ......... PROD/gamma/gamma_dashboard_page.local.py
     - Fonts ................................. live/static/fonts/*.woff2 (self-hosted)
     - Logo / icon ........................... live/static/QUANTARAEDGE{LOGO,ICON}.png

   RULES
     1. ASCII only. LF line endings (see .gitattributes: * text=auto eol=lf).
     2. Blue is chrome. Green/red/amber/cyan carry MEANING only.
     3. Nothing in this file may style the TradingView component. The #chart /
        #vix-chart elements and everything the chart JS paints inside them
        (layout.background, candle and series colours, grid, panes, price axis)
        are owned by edge_chart.js / live_chart.js and are out of scope.
        The CARD that frames the chart is page chrome and IS styled - but it
        lives in each page's own <style> block, not here, so this rule stays a
        simple "no chart styling in the shared sheet".
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts - self-hosted, no external runtime dependency
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('/static/fonts/Manrope-var.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/IBMPlexMono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/IBMPlexMono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/IBMPlexMono-600.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/IBMPlexMono-700.woff2') format('woff2');
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* -- Type ------------------------------------------------------------- */
  --q-font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
            Helvetica, Arial, sans-serif;
  --q-font-num: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas,
                'Liberation Mono', monospace;

  /* -- Canonical page background (from the account dashboard) ------------ */
  --q-bg-base-0:   #030712;
  --q-bg-base-1:   #040a16;
  --q-bg-base-2:   #030711;
  --q-glow-1:      rgba(39, 104, 222, 0.22);
  --q-glow-2:      rgba(21, 67, 154, 0.16);
  --q-glow-top:    rgba(63, 113, 255, 0.18);
  --q-grid-line:   rgba(255, 255, 255, 0.02);

  /* -- Surfaces ---------------------------------------------------------- */
  --q-topbar-bg:   rgba(2, 8, 19, 0.92);
  --q-card-top:    rgba(11, 22, 43, 0.88);
  --q-card-bot:    rgba(9, 18, 36, 0.80);
  --q-panel:       rgba(7, 17, 32, 0.80);
  --q-panel-2:     rgba(5, 12, 28, 0.85);
  --q-inset:       rgba(5, 12, 28, 0.85);

  /* -- Lines ------------------------------------------------------------- */
  --q-border:      rgba(86, 124, 201, 0.20);
  --q-border-hi:   rgba(86, 124, 201, 0.34);
  --q-rule:        rgba(73, 122, 221, 0.15);
  --q-rule-soft:   rgba(73, 122, 221, 0.08);

  /* -- Text -------------------------------------------------------------- */
  --q-text:        #f5f7fb;
  --q-text-1:      #c7d0de;
  --q-text-2:      rgba(199, 208, 222, 0.62);
  --q-text-3:      rgba(199, 208, 222, 0.38);
  --q-label:       rgba(73, 122, 221, 0.62);

  /* -- Chrome accent (blue is chrome, never meaning) --------------------- */
  --q-accent:      #3384ff;
  --q-accent-hi:   #60a5fa;
  --q-accent-dim:  rgba(51, 132, 255, 0.15);
  --q-accent-line: rgba(51, 132, 255, 0.40);

  /* -- Semantic (meaning only - do not reassign) ------------------------- */
  --q-pos:         #4ade80;   /* credit, active, completed, positive */
  --q-pos-bg:      rgba(74, 222, 128, 0.13);
  --q-neg:         #f87171;   /* failure, sign out, inactive */
  --q-neg-bg:      rgba(248, 113, 113, 0.12);
  --q-warn:        #facc15;   /* pending, caution */
  --q-warn-bg:     rgba(250, 204, 21, 0.12);
  --q-cyan:        #00d4ff;   /* live data / active data tab (gamma heritage) */
  --q-green-data:  #00e28a;   /* positive gamma, net gex */
  --q-red-data:    #ff4d6d;   /* put wall, negative exposure */
  --q-amber-data:  #ffb020;   /* abs gamma */
  --q-lock:        #8a94a6;   /* locked nav + lock glyphs */

  /* -- Geometry ---------------------------------------------------------- */
  --q-r-xs:        6px;
  --q-r-sm:        8px;
  --q-r-md:        12px;
  --q-r-lg:        16px;
  --q-r-pill:      999px;
  --q-topbar-h:    64px;
  --q-maxw:        1360px;

  /* -- Elevation --------------------------------------------------------- */
  --q-e1:          0 8px 30px rgba(0, 0, 0, 0.30);
  --q-e2:          0 20px 60px rgba(0, 0, 0, 0.55);
  --q-e3:          0 14px 40px rgba(0, 0, 0, 0.62);
}

/* --------------------------------------------------------------------------
   3. Reset + canonical page background
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body.q-body {
  font-family: var(--q-font);
  font-size: 14px;
  font-weight: 500;
  color: var(--q-text);
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 80% 10%, var(--q-glow-1), transparent 22%),
    radial-gradient(circle at 15% 70%, var(--q-glow-2), transparent 25%),
    linear-gradient(180deg, var(--q-bg-base-0) 0%, var(--q-bg-base-1) 35%, var(--q-bg-base-2) 100%);
  background-attachment: fixed;
}

/* Fine grid overlay - the texture that makes the navy read as a surface */
body.q-body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(var(--q-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--q-grid-line) 1px, transparent 1px);
  background-size: 120px 120px;
  opacity: 0.18;
}

/* Top radial glow behind the header */
body.q-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background: radial-gradient(circle at 50% 0%, var(--q-glow-top), transparent 36%);
}

/* Every price, level, P&L, count and timestamp uses the mono face. */
.q-num,
.q-table td.q-num,
.q-metric-value,
.q-code {
  font-family: var(--q-font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* --------------------------------------------------------------------------
   4. Global header - logo left, navigation + account right
   Present on EVERY page. Markup is produced by PROD/PROD_Nav.py.
   -------------------------------------------------------------------------- */
.q-topbar {
  position: sticky;
  top: 0;
  z-index: 300;
  width: 100%;
  height: var(--q-topbar-h);
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  /* Solid black: the logo art has a black background, so a solid-black bar
     hides the image's rectangular edge. No backdrop blur (it hazed the logo). */
  background: #000;
  border-bottom: 1px solid rgba(73, 122, 221, 0.18);
}

.q-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.q-brand img {
  height: 40px;
  width: auto;
  display: block;
  /* 827x226 source downscaled hard into the bar — hint the browser toward its
     high-quality resampler so the wordmark stays crisp instead of hazy. */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
}

/* Right-hand cluster: primary nav + account control */
.q-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.q-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 8px;
  margin-right: 6px;
  border-right: 1px solid var(--q-rule);
}

.q-nav a,
.q-nav span.q-nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--q-r-sm);
  border: 1px solid transparent;
  font-family: var(--q-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--q-text-1);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.q-nav a:hover {
  background: var(--q-accent-dim);
  border-color: var(--q-accent-line);
  color: var(--q-text);
}

.q-nav .q-nav-item.is-active,
.q-nav a.is-active {
  background: var(--q-accent-dim);
  border-color: var(--q-accent-line);
  color: #ffffff;
}

/* Active underline marker - reads as "you are here" without extra chrome */
.q-nav a.is-active::after,
.q-nav .q-nav-item.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--q-accent);
}

/* Locked destination: visible, dimmed, and still clickable (routes to /upgrade) */
.q-nav a.is-locked {
  color: var(--q-lock);
  opacity: 0.72;
}

.q-nav a.is-locked:hover {
  background: rgba(138, 148, 166, 0.10);
  border-color: rgba(138, 148, 166, 0.28);
  color: var(--q-text-1);
}

.q-lock-glyph {
  font-size: 11px;
  line-height: 1;
  opacity: 0.85;
}

/* Tier chip riding on a locked nav item */
.q-tier-chip {
  font-family: var(--q-font-num);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(138, 148, 166, 0.16);
  color: var(--q-lock);
}


/* --------------------------------------------------------------------------
   5. Account control (right end of the header)
   -------------------------------------------------------------------------- */
.q-acct { position: relative; flex-shrink: 0; }

/* Avatar + caret only, no name label (MasterBK 2026-08-14). Padding is
   tightened from the old three-child layout so the button reads as a
   compact control instead of a wide bar with empty space on the right. */
.q-acct-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 10px 0 7px;
  border-radius: var(--q-r-sm);
  border: 1px solid var(--q-border);
  background: rgba(11, 22, 43, 0.70);
  color: var(--q-text-1);
  font-family: var(--q-font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.q-acct-btn:hover {
  background: var(--q-accent-dim);
  border-color: var(--q-accent-line);
  color: var(--q-text);
}

.q-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #3c8cff 0%, #2f78ef 100%);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* No longer rendered - the account button dropped the visible name span
   (MasterBK 2026-08-14), the name still shows in the dropdown head. Rule
   kept in case a future layout brings the label back. */
.q-acct-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.q-caret { font-size: 9px; opacity: 0.6; }

.q-acct-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  padding: 8px;
  border-radius: var(--q-r-md);
  border: 1px solid var(--q-border-hi);
  background: linear-gradient(180deg, rgba(11, 22, 43, 0.98), rgba(6, 13, 27, 0.98));
  box-shadow: var(--q-e3);
  display: none;
  z-index: 400;
}

.q-acct-menu.is-open { display: block; }

.q-acct-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--q-rule);
  margin-bottom: 6px;
}

.q-acct-head .n {
  font-size: 13px;
  font-weight: 700;
  color: var(--q-text);
}

.q-acct-head .e {
  font-size: 11px;
  color: var(--q-text-3);
  word-break: break-all;
  margin-top: 2px;
}

.q-acct-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--q-r-xs);
  font-size: 13px;
  font-weight: 600;
  color: var(--q-text-1);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.q-acct-menu a:hover { background: var(--q-accent-dim); color: var(--q-text); }

.q-acct-menu a.is-danger { color: var(--q-neg); }
.q-acct-menu a.is-danger:hover { background: var(--q-neg-bg); }

.q-acct-sep {
  height: 1px;
  background: var(--q-rule);
  margin: 6px 4px;
}

.q-acct-group {
  padding: 10px 10px 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--q-label);
}

/* Mobile nav disclosure - hidden on desktop */
.q-navtoggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--q-r-sm);
  border: 1px solid var(--q-border);
  background: rgba(11, 22, 43, 0.70);
  color: var(--q-text-1);
  font-size: 15px;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   6. Page shell
   -------------------------------------------------------------------------- */
.q-main { width: 100%; }

.q-container {
  width: min(var(--q-maxw), calc(100% - 44px));
  margin: 0 auto;
  padding: 30px 0 64px;
}

.q-container-narrow { --q-maxw: 960px; }
.q-container-wide   { --q-maxw: 1680px; }

.q-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.q-page-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--q-text);
}

.q-page-sub {
  font-size: 13px;
  color: var(--q-text-2);
  margin-top: 5px;
}

.q-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--q-label);
  margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   7. Cards + layout helpers
   -------------------------------------------------------------------------- */
.q-card {
  background: linear-gradient(180deg, var(--q-card-top), var(--q-card-bot));
  border: 1px solid var(--q-border);
  border-radius: var(--q-r-lg);
  padding: 22px 24px;
  box-shadow: var(--q-e1);
}

.q-card-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--q-label);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--q-rule-soft);
}

.q-grid   { display: grid; gap: 16px; margin-bottom: 16px; }
.q-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.q-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.q-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.q-stack   { display: flex; flex-direction: column; gap: 16px; }
.q-row     { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-spacer  { margin-left: auto; }

/* Metric card - the shared "one number" unit */
.q-metric {
  background: var(--q-panel);
  border: 1px solid var(--q-border);
  border-radius: var(--q-r-md);
  padding: 12px 15px;
  min-width: 120px;
}

.q-metric-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--q-text-2);
}

.q-metric-value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
  color: var(--q-text);
  line-height: 1.2;
}

.q-metric-sub {
  font-family: var(--q-font-num);
  font-size: 11px;
  color: var(--q-text-3);
  margin-top: 3px;
}

.q-metric-value.is-pos  { color: var(--q-green-data); }
.q-metric-value.is-neg  { color: var(--q-red-data); }
.q-metric-value.is-cyan { color: var(--q-cyan); }
.q-metric-value.is-warn { color: var(--q-amber-data); }

/* --------------------------------------------------------------------------
   8. Buttons
   -------------------------------------------------------------------------- */
.q-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--q-r-sm);
  border: 1px solid var(--q-border);
  background: rgba(11, 22, 43, 0.70);
  color: var(--q-text-1);
  font-family: var(--q-font);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.q-btn:hover {
  background: var(--q-accent-dim);
  border-color: var(--q-accent-line);
  color: var(--q-text);
}

.q-btn-primary {
  background: linear-gradient(180deg, #3c8cff 0%, #2f78ef 100%);
  border-color: transparent;
  color: #f8fbff;
  box-shadow: 0 12px 28px rgba(36, 110, 238, 0.28);
}

.q-btn-primary:hover {
  background: linear-gradient(180deg, #4b97ff 0%, #3782f5 100%);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(36, 110, 238, 0.38);
}

.q-btn-good {
  background: var(--q-pos-bg);
  border-color: rgba(74, 222, 128, 0.35);
  color: var(--q-pos);
}
.q-btn-good:hover { background: rgba(74, 222, 128, 0.24); color: var(--q-pos); }

.q-btn-danger {
  background: rgba(42, 10, 10, 0.60);
  border-color: rgba(180, 60, 60, 0.35);
  color: var(--q-neg);
}
.q-btn-danger:hover { background: rgba(60, 15, 15, 0.85); border-color: rgba(200, 80, 80, 0.5); color: var(--q-neg); }

.q-btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.q-btn-lg { height: 46px; padding: 0 26px; font-size: 15px; }
.q-btn-block { width: 100%; }

.q-btn:disabled,
.q-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   9. Chips, pills, badges
   -------------------------------------------------------------------------- */
.q-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--q-r-pill);
  border: 1px solid var(--q-border);
  background: rgba(11, 22, 43, 0.60);
  font-size: 11px;
  font-weight: 700;
  color: var(--q-text-1);
  white-space: nowrap;
}

.q-chip-pos  { background: var(--q-pos-bg);  border-color: rgba(74, 222, 128, 0.35); color: var(--q-pos); }
.q-chip-neg  { background: var(--q-neg-bg);  border-color: rgba(248, 113, 113, 0.35); color: var(--q-neg); }
.q-chip-warn { background: var(--q-warn-bg); border-color: rgba(250, 204, 21, 0.35);  color: var(--q-warn); }
.q-chip-info { background: var(--q-accent-dim); border-color: var(--q-accent-line);   color: var(--q-accent-hi); }
.q-chip-lock { background: rgba(138, 148, 166, 0.12); border-color: rgba(138, 148, 166, 0.30); color: var(--q-lock); }

.q-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   10. Alerts
   -------------------------------------------------------------------------- */
.q-alert {
  border-radius: var(--q-r-sm);
  padding: 12px 15px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid transparent;
}

.q-alert a { color: inherit; font-weight: 700; }

.q-alert-info    { background: rgba(5, 20, 45, 0.90);  border-color: rgba(51, 100, 200, 0.40); color: var(--q-accent-hi); }
.q-alert-success { background: rgba(5, 30, 15, 0.90);  border-color: rgba(30, 110, 60, 0.45);  color: var(--q-pos); }
.q-alert-error   { background: rgba(42, 10, 10, 0.90); border-color: rgba(180, 60, 60, 0.45);  color: var(--q-neg); }
.q-alert-warning { background: rgba(40, 30, 5, 0.90);  border-color: rgba(200, 160, 40, 0.40); color: var(--q-warn); }

/* --------------------------------------------------------------------------
   11. Tables
   -------------------------------------------------------------------------- */
.q-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.q-table th {
  text-align: left;
  padding: 0 12px 10px 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--q-label);
  border-bottom: 1px solid var(--q-rule);
  white-space: nowrap;
}

.q-table td {
  padding: 11px 12px 11px 0;
  color: var(--q-text-1);
  border-bottom: 1px solid var(--q-rule-soft);
  vertical-align: middle;
}

.q-table tr:last-child td { border-bottom: none; }
.q-table tbody tr:hover td { background: rgba(51, 132, 255, 0.05); }

.q-empty {
  text-align: center;
  padding: 34px 0;
  color: var(--q-text-3);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   12. Toolbar - the symbol / date control strip used by /edge and /chart
   Class names below are intentionally the EXISTING ones those pages and their
   JS already bind to (.sym-btn, .symbol-group, .gear-btn, .controls-panel).
   Only their appearance changes.
   -------------------------------------------------------------------------- */
.q-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 18px;
  margin-bottom: 12px;
  border-radius: var(--q-r-md);
  border: 1px solid var(--q-border);
  background: linear-gradient(180deg, var(--q-card-top), var(--q-card-bot));
  box-shadow: var(--q-e1);
}

.q-toolbar .symbol-groups {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.q-toolbar .symbol-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.q-toolbar .symbol-group-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--q-label);
  white-space: nowrap;
}

.q-toolbar .symbol-group-btns { display: flex; gap: 4px; flex-wrap: wrap; }

.q-toolbar .sym-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 27px;
  padding: 0 9px;
  border-radius: var(--q-r-xs);
  border: 1px solid var(--q-border);
  background: rgba(5, 12, 28, 0.72);
  color: var(--q-text-2);
  font-family: var(--q-font-num);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.q-toolbar .sym-btn:hover {
  background: var(--q-accent-dim);
  border-color: var(--q-accent-line);
  color: var(--q-text);
}

.q-toolbar .sym-btn.active {
  background: var(--q-accent-dim);
  border-color: var(--q-accent);
  color: #ffffff;
  box-shadow: inset 0 -2px 0 var(--q-accent);
}

.q-toolbar .sym-btn[disabled] {
  opacity: 0.34;
  cursor: not-allowed;
  border-style: dashed;
}

.q-toolbar .sym-btn[disabled]:hover {
  background: rgba(5, 12, 28, 0.72);
  border-color: var(--q-border);
  color: var(--q-text-2);
}

.q-toolbar input[type="date"] {
  height: 27px;
  padding: 0 8px;
  border-radius: var(--q-r-xs);
  border: 1px solid var(--q-border);
  background: rgba(5, 12, 28, 0.72);
  color: var(--q-text-1);
  font-family: var(--q-font-num);
  font-size: 11px;
  cursor: pointer;
  outline: none;
}

.q-toolbar input[type="date"]:focus {
  border-color: var(--q-accent);
  box-shadow: 0 0 0 3px rgba(51, 132, 255, 0.12);
}

.q-toolbar input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

.q-toolbar .gear-btn {
  margin-left: auto;
  align-self: center;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--q-r-xs);
  border: 1px solid transparent;
  background: none;
  color: var(--q-text-3);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.q-toolbar .gear-btn:hover { color: var(--q-text-1); background: rgba(51, 132, 255, 0.10); }
.q-toolbar .gear-btn.open  { color: var(--q-accent-hi); border-color: var(--q-accent-line); background: var(--q-accent-dim); }

/* Collapsible controls / legend strip */
.q-controls {
  display: none;
  padding: 11px 18px;
  margin-bottom: 12px;
  border-radius: var(--q-r-md);
  border: 1px solid var(--q-border);
  background: var(--q-panel);
}

.q-controls.open { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

.q-controls .legend-inline {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11px;
}

.q-controls .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--q-text-2);
  white-space: nowrap;
}

.q-controls .color-box {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  vertical-align: middle;
  position: relative;
}

/* --------------------------------------------------------------------------
   13. Data panel - the wrapper used around signal tables on /edge and /chart
   -------------------------------------------------------------------------- */
.q-datapanel {
  border-radius: var(--q-r-md);
  border: 1px solid var(--q-border);
  background: linear-gradient(180deg, var(--q-card-top), var(--q-card-bot));
  box-shadow: var(--q-e1);
  padding: 16px 18px;
  margin-bottom: 16px;
  overflow: hidden;
}

.q-datapanel .table-wrapper { overflow-x: auto; }

/* Signal tables keep their existing class + status hooks; restyle only. */
.q-datapanel .signal-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--q-font-num);
  font-size: 11px;
  background: transparent;
}

.q-datapanel .signal-table th {
  padding: 9px 7px;
  text-align: center;
  white-space: nowrap;
  font-family: var(--q-font);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--q-label);
  background: rgba(5, 12, 28, 0.60);
  border: 1px solid var(--q-rule-soft);
}

.q-datapanel .signal-table td {
  padding: 8px 7px;
  text-align: center;
  color: var(--q-text-1);
  background: transparent;
  border: 1px solid var(--q-rule-soft);
  font-variant-numeric: tabular-nums;
}

.q-datapanel .signal-table tbody tr:hover td { background: rgba(51, 132, 255, 0.06); }

.q-datapanel .signal-table tfoot td {
  background: rgba(5, 12, 28, 0.60);
  font-weight: 700;
  padding: 10px 7px;
  color: var(--q-text);
}

.q-datapanel .signal-table .status-taken {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--q-r-pill);
  background: rgba(38, 166, 154, 0.18);
  border: 1px solid rgba(38, 166, 154, 0.45);
  color: #4fd6c8;
  font-weight: 700;
  font-size: 10px;
}

.q-datapanel .signal-table .status-skipped {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--q-r-pill);
  background: rgba(138, 148, 166, 0.14);
  border: 1px solid rgba(138, 148, 166, 0.32);
  color: var(--q-lock);
  font-weight: 700;
  font-size: 10px;
}

/* Semantic value colors - identical meaning to the old sheet, new surface. */
.q-datapanel .signal-table .type-long,
.q-datapanel .signal-table .profit  { color: #2fe6a8; font-weight: 700; }

.q-datapanel .signal-table .type-short,
.q-datapanel .signal-table .loss    { color: #ff5577; font-weight: 700; }

.q-datapanel .signal-table .na      { color: var(--q-text-3); }

/* --------------------------------------------------------------------------
   14. Locked / coming-soon page states
   -------------------------------------------------------------------------- */
.q-gate {
  max-width: 760px;
  margin: 40px auto 0;
  text-align: left;
  padding: 34px 36px;
  border-radius: var(--q-r-lg);
  border: 1px solid var(--q-border-hi);
  background: linear-gradient(180deg, rgba(11, 22, 43, 0.94), rgba(9, 18, 36, 0.90));
  box-shadow: var(--q-e2);
  position: relative;
  overflow: hidden;
}

.q-gate::before {
  content: "";
  position: absolute;
  inset: auto -10% -40px;
  height: 140px;
  background: radial-gradient(circle at 50% 0%, rgba(70, 145, 255, 0.12), transparent 58%);
  pointer-events: none;
}

.q-gate-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--q-text);
  margin-bottom: 6px;
}

.q-gate-sub {
  font-size: 13px;
  color: var(--q-text-2);
  margin-bottom: 22px;
}

.q-feature-list { list-style: none; margin: 0 0 24px; }

.q-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--q-rule-soft);
  font-size: 13px;
  line-height: 1.55;
  color: var(--q-text-1);
}

.q-feature-list li:last-child { border-bottom: none; }

.q-feature-list .q-tick {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--q-accent-dim);
  color: var(--q-accent-hi);
  font-size: 10px;
  font-weight: 800;
}

.q-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--q-text-3);
  padding: 12px 14px;
  border-radius: var(--q-r-sm);
  border: 1px solid var(--q-rule);
  background: var(--q-panel-2);
  margin-top: 18px;
}

/* --------------------------------------------------------------------------
   15. Forms (auth pages inherit these)
   -------------------------------------------------------------------------- */
.q-body label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--q-text-1);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.q-body input[type="text"],
.q-body input[type="email"],
.q-body input[type="password"],
.q-body input[type="tel"],
.q-body input[type="number"],
.q-body select,
.q-body textarea {
  width: 100%;
  background: var(--q-inset);
  border: 1px solid rgba(73, 122, 221, 0.28);
  border-radius: var(--q-r-sm);
  color: var(--q-text);
  padding: 10px 13px;
  font-size: 14px;
  font-family: var(--q-font);
  margin-bottom: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.q-body input:focus,
.q-body select:focus,
.q-body textarea:focus {
  border-color: var(--q-accent);
  box-shadow: 0 0 0 3px rgba(51, 132, 255, 0.12);
}

.q-body input::placeholder,
.q-body textarea::placeholder { color: var(--q-text-3); }

.q-body select option { background: #071120; }

/* --------------------------------------------------------------------------
   16. Focus visibility (keyboard accessibility)
   -------------------------------------------------------------------------- */
.q-body a:focus-visible,
.q-body button:focus-visible,
.q-body input:focus-visible,
.q-body select:focus-visible {
  outline: 2px solid var(--q-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   17. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .q-nav a, .q-nav span.q-nav-item { padding: 0 11px; font-size: 12px; }
  .q-acct-name { max-width: 96px; }
}

@media (max-width: 940px) {
  .q-topbar { padding: 0 14px; }
  .q-navtoggle { display: inline-flex; }

  .q-nav {
    position: absolute;
    top: var(--q-topbar-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 14px 14px;
    margin: 0;
    border-right: none;
    border-bottom: 1px solid var(--q-border-hi);
    background: rgba(3, 9, 22, 0.985);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--q-e3);
    display: none;
  }

  .q-nav.is-open { display: flex; }
  .q-nav a, .q-nav span.q-nav-item { height: 44px; justify-content: flex-start; }
  .q-nav a.is-active::after, .q-nav .q-nav-item.is-active::after { display: none; }

  .q-container { width: calc(100% - 28px); padding: 22px 0 48px; }
  .q-grid-2, .q-grid-3, .q-grid-4 { grid-template-columns: 1fr; }
  .q-page-title { font-size: 24px; }
  .q-acct-name { display: none; }
}

@media (max-width: 620px) {
  .q-brand img { height: 32px; }
  .q-gate { padding: 26px 22px; }
  .q-gate-title { font-size: 21px; }
  .q-card { padding: 18px 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
