/* HasanagoTrade dashboard. Private trading terminal, 2035 build:
   deep-space near-black ground with radial glow fields, liquid-glass
   panels over a fine CRT grid, one committed neon-emerald accent for
   positive/active, red strictly for negative. Terminal DNA: mono
   numerals, tracked mono micro-labels, pulsing LIVE dot.
   Spacing scale: 4 / 8 / 12 / 16 / 24 / 32.

   Contrast verified >= 4.5:1 for text/muted/accent/neg on the glass
   panels at their worst case (panel over the brightest glow field)
   and on the solid @supports fallback. */

:root {
  --bg: #05080B;
  --panel: #0E151A;                            /* solid fallback + blend base */
  --panel-glass: rgba(14, 21, 26, 0.62);
  --edge: rgba(170, 225, 205, 0.09);           /* luminous 1px borders */
  --edge-strong: rgba(170, 225, 205, 0.2);
  --hover: rgba(52, 211, 153, 0.05);
  --text: #E7F1ED;
  --muted: #93A8A4;
  --accent: #34D399;
  --accent-bright: #7CF0C8;
  --accent-glow: rgba(52, 211, 153, 0.35);
  --accent-dim: rgba(52, 211, 153, 0.12);
  --neg: #F87171;
  --neg-glow: rgba(248, 113, 113, 0.35);
  --grid-line: rgba(148, 232, 197, 0.026);
  --radius: 14px;
  --radius-s: 8px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Deep-space glow fields, kept in the accent family, behind everything */
body.crt::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(52rem 34rem at 12% -8%, rgba(52, 211, 153, 0.1), transparent 60%),
    radial-gradient(44rem 30rem at 92% 6%, rgba(34, 170, 150, 0.06), transparent 62%),
    radial-gradient(46rem 42rem at 78% 112%, rgba(52, 211, 153, 0.05), transparent 60%);
}

/* Fine CRT grid + scanlines, pure CSS, no assets */
body.crt::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, var(--grid-line) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(90deg, var(--grid-line) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px);
}

a { color: var(--text); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-bright); }

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
  border-radius: 2px;
}

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.pos { color: var(--accent); }
.neg { color: var(--neg); }
.big { font-size: 15px; }
.r { text-align: right; }

.label, .eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before { content: "// "; color: var(--accent); }
.label { margin: 16px 0 8px; }
.label:first-child { margin-top: 0; }
.label em { font-style: italic; text-transform: none; letter-spacing: 0.04em; }

/* Top bar: glass strip pinned over the glow field */
.topbar {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--edge);
  position: sticky;
  top: 0;
  background: rgba(6, 10, 13, 0.94);
  z-index: 10;
}
.brand-mark {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.18em;
  text-shadow: 0 0 16px var(--accent-dim);
}
.brand-mark::after { content: "_"; color: var(--accent); animation: cursorBlink 1.2s steps(1) infinite; }
@keyframes cursorBlink { 50% { opacity: 0; } }
.brand-sub {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.topnav { display: flex; gap: 16px; }
.topnav a {
  font-size: 13px;
  color: var(--muted);
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, text-shadow 0.15s ease;
}
.topnav a:hover { color: var(--text); border-bottom-color: var(--edge-strong); }
.topnav a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
}
.topbar-right { margin-left: auto; display: flex; align-items: baseline; gap: 16px; }
.poll-status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.poll-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 1px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.poll-status.live { color: var(--accent); }
.poll-status.live::before { animation: pulse 2s ease-in-out infinite; }
.poll-status.offline { color: var(--neg); }
@keyframes pulse { 50% { opacity: 0.3; } }
.logout { font-size: 12px; color: var(--muted); }

/* Page scaffold */
.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

/* Liquid glass panels. Solid by default (the @supports fallback), frosted
   when the browser can blur. 1px luminous border + inner top highlight. */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 24px 48px -28px rgba(0, 4, 8, 0.9);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card {
    background:
      linear-gradient(155deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 42%),
      var(--panel-glass);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
  }
  .topbar {
    background: rgba(6, 10, 13, 0.72);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
  }
}
@media (hover: hover) {
  .card {
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  }
  .card:hover {
    transform: translateY(-2px);
    border-color: var(--edge-strong);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 0 0 1px rgba(52, 211, 153, 0.07),
      0 0 32px rgba(52, 211, 153, 0.06),
      0 28px 56px -28px rgba(0, 4, 8, 0.9);
  }
}

.sec { margin-bottom: 16px; }
.sec-title { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin-top: 4px; text-wrap: balance; }
.sec-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; max-width: 62ch; }

/* Hero */
.hero-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.hero-title { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin-top: 4px; text-wrap: balance; }
.hero-budget { font-size: 12.5px; color: var(--muted); }
.hero-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.hero-tile {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--edge);
  border-radius: var(--radius-s);
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
@media (hover: hover) {
  .hero-tile:hover {
    border-color: var(--edge-strong);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 0 20px rgba(52, 211, 153, 0.07);
  }
}
.hero-tile.bench { border-style: dashed; background: transparent; }
.hero-tile .label { margin: 0 0 8px; }
.hero-eur { font-size: 26px; font-weight: 500; }
.hero-usdt { font-size: 13px; margin-top: 4px; }
.hero-tile.bench .hero-usdt { font-size: 18px; color: var(--text); }
.hero-ret { font-size: 14px; margin-top: 8px; }
.hero-note {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--edge-strong);
}
.table th.r { text-align: right; }
.table td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--edge); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background-color 0.15s ease; }
.table tbody tr:hover { background: var(--hover); }
.table .desc { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.spark svg { display: block; }

/* Desk */
.chart-wrap { margin: 4px 0 8px; overflow-x: auto; }
.chart-wrap svg { max-width: 100%; height: auto; }
.desk-split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 12px; }

/* Judgment vs gate */
.duel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.regime-now { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 8px; }
.regime-word { font-family: var(--mono); font-size: 24px; letter-spacing: 0.08em; }
.regime-word.bull { color: var(--accent); text-shadow: 0 0 18px var(--accent-glow); }
.regime-word.bear { color: var(--neg); text-shadow: 0 0 18px var(--neg-glow); }
.regime-word.chop { color: var(--muted); }
.conf-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: visible;
  margin-bottom: 12px;
}
.conf-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.conf-fill.bear { background: var(--neg); box-shadow: 0 0 12px var(--neg-glow); }
.conf-fill.chop { background: var(--muted); box-shadow: none; }
.rationale { font-size: 13px; color: var(--muted); font-style: italic; max-width: 52ch; margin-bottom: 16px; }
.timeline { list-style: none; }
.timeline li { display: flex; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--edge); font-size: 12.5px; }
.timeline li:last-child { border-bottom: none; }
.tl-regime { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; width: 52px; }
.tl-regime.bull { color: var(--accent); }
.tl-regime.bear { color: var(--neg); }
.tl-regime.chop { color: var(--muted); }
.gate-chip {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--edge);
  border-radius: 4px;
  color: var(--muted);
}
.gate-chip.g100 {
  color: var(--accent);
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 10px var(--accent-dim);
}
.gate-chip.g0 {
  color: var(--neg);
  border-color: rgba(248, 113, 113, 0.45);
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.12);
}
.footnote { font-size: 11.5px; color: var(--muted); margin-top: 12px; max-width: 58ch; }

/* Fear & Greed */
.fng { margin-top: 16px; }
.fng-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.fng-row .big { font-size: 22px; }
.fng-bar {
  position: relative;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--neg), rgba(255, 255, 255, 0.1) 50%, var(--accent));
}
.fng-marker {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 11px;
  background: var(--text);
  box-shadow: 0 0 8px rgba(231, 241, 237, 0.6);
  transform: translateX(-1px);
  transition: left 0.4s ease;
}

/* Intelligence */
.newslist { list-style: none; }
.newslist li { padding: 8px 0; border-bottom: 1px solid var(--edge); font-size: 13px; }
.newslist li:last-child { border-bottom: none; }
.newslist a, .newslist .news-title { display: block; }
.newslist .muted { font-size: 11.5px; }
.joblist { list-style: none; }
.joblist li { display: flex; align-items: baseline; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--edge); font-size: 12.5px; flex-wrap: wrap; }
.joblist li:last-child { border-bottom: none; }
.job-name { min-width: 150px; }
.job-line { font-family: var(--mono); font-size: 11px; flex-basis: 100%; padding-left: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); align-self: center; }
.dot.ok { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.dot.stale, .dot.missing { background: var(--neg); box-shadow: 0 0 8px var(--neg-glow); }

/* Research + carry */
.carrylist { list-style: none; }
.carrylist li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--edge); font-size: 12.5px; }
.carrylist li:last-child { border-bottom: none; }
.carry-state { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }
.carry-state.active { color: var(--accent); text-shadow: 0 0 10px var(--accent-glow); }

/* Risk desk */
.rules { list-style: none; counter-reset: rule; }
.rules li { counter-increment: rule; padding: 8px 0; border-bottom: 1px solid var(--edge); font-size: 13.5px; display: flex; gap: 12px; }
.rules li:last-child { border-bottom: none; }
.rules li::before {
  content: "0" counter(rule);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  padding-top: 3px;
}

/* Status flags */
.stale {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--neg);
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 3px;
  padding: 1px 4px;
  vertical-align: middle;
}

/* Empty states: an intentional quiet panel, not a bare line */
.empty {
  font-size: 12.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed var(--edge-strong);
  border-radius: var(--radius-s);
  padding: 16px;
  text-align: center;
  margin: 8px 0;
}

/* Live flash on value change */
@keyframes flashUp { 0% { color: var(--accent); text-shadow: 0 0 10px var(--accent-glow); } 100% { color: inherit; text-shadow: none; } }
@keyframes flashDown { 0% { color: var(--neg); text-shadow: 0 0 10px var(--neg-glow); } 100% { color: inherit; text-shadow: none; } }
.flash-up { animation: flashUp 0.9s ease-out; }
.flash-down { animation: flashDown 0.9s ease-out; }

/* Footer */
.footline {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px 32px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Login and error pages */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: 24px; }
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 16px;
  padding: 32px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 48px rgba(52, 211, 153, 0.05),
    0 32px 64px -32px rgba(0, 4, 8, 0.9);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .login-card {
    background:
      linear-gradient(155deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 42%),
      var(--panel-glass);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
  }
}
.login-title { font-size: 24px; font-weight: 600; margin: 8px 0 4px; }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.login-error { font-size: 13px; color: var(--neg); margin-bottom: 16px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input {
  background: rgba(4, 8, 10, 0.6);
  border: 1px solid var(--edge);
  border-radius: var(--radius-s);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px;
  caret-color: var(--accent);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.login-form button {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-s);
  color: #06231A;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 12px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.login-form button:hover { filter: brightness(1.08); box-shadow: 0 0 20px var(--accent-glow); }
.login-form button:active { transform: scale(0.98); }
.login-foot {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 16px;
}

/* Motion preferences: kill pulses, blinks, flashes, lifts */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .card:hover, .login-form button:active { transform: none; }
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .page { padding: 12px; gap: 12px; }
  .card { padding: 16px; }
  .grid-2, .desk-split, .duel-grid { grid-template-columns: 1fr; }
  .topbar { gap: 16px; padding: 12px; flex-wrap: wrap; }
  .brand-sub { display: none; }
  .footline { padding: 12px 12px 24px; }
  .table { font-size: 12px; }
  /* Lighter compositing for mobile GPUs: shallower blur, one glow field */
  .card, .login-card {
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    backdrop-filter: blur(10px) saturate(130%);
  }
  .topbar {
    -webkit-backdrop-filter: blur(8px) saturate(130%);
    backdrop-filter: blur(8px) saturate(130%);
  }
  body.crt::after {
    background: radial-gradient(40rem 28rem at 16% -8%, rgba(52, 211, 153, 0.09), transparent 60%);
  }
}
@media (max-width: 560px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-eur { font-size: 24px; }
  .regime-word { font-size: 20px; }
  .job-name { min-width: 0; }
}

/* The Grid: live grid-bot panel (additions only; reuses card/table/label DNA).
   Text colors reuse the verified text/muted/accent/neg tokens, so the
   >= 4.5:1 contrast audit above still holds on the glass panels. */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.gstat {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--edge);
  border-radius: var(--radius-s);
  padding: 12px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.gstat .label { margin: 0 0 6px; }
.gstat-value { font-size: 17px; }
.grid-split {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
  align-items: start;
}
.ladder td { padding-top: 6px; padding-bottom: 6px; }
.lot-chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--edge);
  border-radius: 4px;
  color: var(--muted);
  white-space: nowrap;
}
.lot-chip.holding {
  color: var(--accent);
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 10px var(--accent-dim);
}
.lot-chip.armed { color: var(--text); border-color: var(--edge-strong); }
.lot-chip.sold { color: var(--muted); border-style: dashed; }
/* The price cursor: a luminous rail between the two levels the live
   price sits between, with the price itself riding on it. */
.ladder .ladder-cursor td { padding: 3px 0; border-bottom: none; }
.table tbody tr.ladder-cursor:hover { background: transparent; }
.cursor-flag {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--accent-bright);
  text-shadow: 0 0 10px var(--accent-glow);
  white-space: nowrap;
}
.cursor-flag::before,
.cursor-flag::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--accent));
  box-shadow: 0 0 6px var(--accent-glow);
}
.cursor-flag::after { background: linear-gradient(90deg, var(--accent), transparent); }
@media (max-width: 900px) {
  .grid-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .grid-split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-stats { grid-template-columns: 1fr; }
}
