:root {
  --bg: #090b0d;
  --panel: #101316;
  --panel-2: #14181c;
  --line: #252a2f;
  --text: #f3f5f7;
  --muted: #858d95;
  --acid: #c9ff3d;
  --cyan: #42d8e8;
  --red: #ff5d68;
  --green: #54e38e;
  --shadow: 0 24px 70px rgb(0 0 0 / 32%);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% -12%, rgb(201 255 61 / 10%), transparent 31rem),
    radial-gradient(circle at 102% 14%, rgb(66 216 232 / 7%), transparent 30rem),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(255 255 255 / 2%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 2%) 1px, transparent 1px);
  background-size: 52px 52px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.login-body {
  min-height: 100vh;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.login-card {
  width: min(430px, 100%);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgb(201 255 61 / 7%), transparent 38%),
    var(--panel);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.login-brand strong,
.login-brand small {
  display: block;
  letter-spacing: 0.16em;
}

.login-brand strong {
  font-size: 14px;
}

.login-brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.login-copy {
  margin: 44px 0 26px;
}

.login-copy h1 {
  margin: 8px 0;
  font-size: 34px;
}

.login-copy p,
.login-footnote {
  color: var(--muted);
}

.login-copy p {
  margin: 0;
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  padding: 14px 15px;
  color: var(--text);
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  background: var(--panel-2);
}

.login-form input:focus {
  border-color: var(--acid);
  box-shadow: 0 0 0 3px rgb(201 255 61 / 10%);
}

.login-form button,
.logout-button {
  border: 0;
  cursor: pointer;
}

.login-form button {
  margin-top: 4px;
  padding: 14px;
  color: #090b0d;
  font-weight: 850;
  border-radius: 9px;
  background: var(--acid);
}

.login-error {
  padding: 12px 14px;
  color: #ffd9dc;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid rgb(255 93 104 / 35%);
  border-radius: 9px;
  background: rgb(255 93 104 / 9%);
}

.login-footnote {
  margin: 26px 0 0;
  font-size: 11px;
  text-align: center;
}

.logout-button {
  padding: 7px 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
}

.logout-button:hover {
  color: var(--text);
  border-color: #42494f;
}

.shell {
  width: min(1500px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 32px 28px;
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 86px;
  border-bottom: 1px solid var(--line);
}

.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  padding: 9px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  background: var(--text);
  border-radius: 2px;
  transition:
    transform 160ms ease,
    opacity 160ms ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #090b0d;
  font-size: 19px;
  font-weight: 900;
  background: var(--acid);
  border-radius: 9px;
  box-shadow: 0 0 30px rgb(201 255 61 / 16%);
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0.16em;
}

.brand strong {
  font-size: 14px;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.topbar-meta {
  display: flex;
  gap: 22px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgb(255 255 255 / 2%);
}

.main-nav a {
  padding: 8px 13px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: 0.06em;
  border-radius: 6px;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--text);
}

.main-nav a.active {
  color: #090b0d;
  background: var(--acid);
}

.mode-badge {
  padding: 6px 10px;
  color: var(--acid);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  border: 1px solid rgb(201 255 61 / 28%);
  border-radius: 100px;
  background: rgb(201 255 61 / 7%);
}

.connection {
  display: flex;
  gap: 7px;
  align-items: center;
}

.connection i {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgb(84 227 142 / 8%);
}

.connection.offline i {
  background: var(--red);
}

main {
  padding-top: 28px;
}

.hero {
  position: relative;
  padding: 34px 38px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(130deg, rgb(201 255 61 / 7%), transparent 37%),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  top: -120px;
  right: -90px;
  width: 340px;
  height: 340px;
  border: 1px solid rgb(201 255 61 / 12%);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 0 0 42px rgb(201 255 61 / 2%),
    0 0 0 96px rgb(201 255 61 / 2%);
}

.hero-kicker,
.hero-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-kicker {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-main {
  gap: 30px;
  min-height: 128px;
}

.hero h1 {
  max-width: 850px;
  margin: 12px 0 8px;
  font-size: clamp(30px, 4.2vw, 60px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.hero-pnl {
  min-width: 220px;
  text-align: right;
}

.hero-pnl span,
.hero-pnl strong {
  display: block;
}

.hero-pnl span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero-pnl strong {
  font-size: 29px;
  letter-spacing: -0.04em;
}

.positive {
  color: var(--green) !important;
}

.negative {
  color: var(--red) !important;
}

.neutral {
  color: var(--text) !important;
}

.risk-rail {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.risk-rail > span {
  padding: 19px 20px 21px 0;
  border-right: 1px solid var(--line);
}

.risk-rail > span:not(:first-child) {
  padding-left: 20px;
}

.risk-rail > span:last-child {
  border-right: 0;
}

.risk-rail small,
.risk-rail strong {
  display: block;
}

.risk-rail small {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.risk-rail strong {
  font-size: 14px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 12px 0;
}

.metric,
.panel {
  border: 1px solid var(--line);
  background: rgb(16 19 22 / 92%);
}

.metric {
  padding: 22px 24px;
  border-radius: 13px;
}

.metric span,
.metric strong,
.metric small {
  display: block;
}

.metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  margin: 12px 0 5px;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.metric small {
  color: var(--muted);
  font-size: 11px;
}

.panel {
  min-width: 0;
  padding: 26px;
  border-radius: 15px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--acid);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.section-heading h2 {
  margin: 5px 0 0;
  font-size: 19px;
  letter-spacing: -0.025em;
}

.section-total {
  font-size: 14px;
  font-weight: 750;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th {
  padding: 0 14px 12px;
  color: #6f7780;
  font-size: 9px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 17px 14px;
  color: #c5cbd1;
  font-size: 12px;
  border-bottom: 1px solid rgb(37 42 47 / 70%);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td strong {
  color: var(--text);
}

.number.positive strong,
.number.negative strong,
.number.neutral strong {
  color: inherit;
}

.number {
  text-align: right;
}

.side {
  display: inline-flex;
  min-width: 58px;
  justify-content: center;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 800;
  border-radius: 6px;
}

.side.long {
  color: var(--green);
  background: rgb(84 227 142 / 9%);
}

.side.short {
  color: var(--red);
  background: rgb(255 93 104 / 9%);
}

.empty-state {
  display: grid;
  min-height: 160px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state strong {
  margin-top: 12px;
  font-size: 14px;
}

.empty-state p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.empty-state.compact {
  min-height: 110px;
}

.radar {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(201 255 61 / 35%);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 10px rgb(201 255 61 / 3%),
    0 0 0 9px rgb(201 255 61 / 3%);
}

.radar::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--acid);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px var(--acid);
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.65fr);
  gap: 12px;
  margin-top: 12px;
}

.activity-list {
  max-height: 352px;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  list-style: none;
}

.activity-list li {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  gap: 11px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid rgb(37 42 47 / 70%);
}

.activity-list li::before {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  background: var(--cyan);
  border-radius: 50%;
  content: "";
}

.activity-copy strong,
.activity-copy small {
  display: block;
}

.activity-copy strong {
  font-size: 11px;
}

.activity-copy small,
.activity-time {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.error-banner {
  padding: 14px 16px;
  margin-top: 12px;
  color: #ffc2c6;
  font-size: 12px;
  border: 1px solid rgb(255 93 104 / 24%);
  border-radius: 10px;
  background: rgb(255 93 104 / 8%);
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 22px 3px 0;
  color: #626a72;
  font-size: 10px;
}

.charts-main {
  padding-top: 34px;
}

.chart-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.chart-heading h1 {
  margin: 7px 0 8px;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.chart-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.chart-price {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.chart-price span,
.chart-price strong,
.chart-price small {
  display: block;
}

.chart-price span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.chart-price strong {
  margin: 7px 0 3px;
  font-size: 31px;
  letter-spacing: -0.04em;
}

.chart-price small {
  font-size: 12px;
  font-weight: 750;
}

.symbol-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.symbol-tabs::-webkit-scrollbar {
  display: none;
}

.symbol-tabs button {
  flex: 0 0 auto;
  padding: 9px 15px;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.symbol-tabs button:hover,
.symbol-tabs button:focus-visible {
  color: var(--text);
  border-color: #3a4249;
}

.symbol-tabs button.active {
  color: #090b0d;
  border-color: var(--acid);
  background: var(--acid);
}

.chart-panel {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgb(16 19 22 / 94%);
  box-shadow: var(--shadow);
}

.chart-toolbar,
.chart-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-toolbar {
  padding: 0 5px 20px;
}

.chart-toolbar strong,
.chart-toolbar span {
  display: block;
}

.chart-toolbar strong {
  font-size: 14px;
}

.chart-toolbar span,
.chart-toolbar time,
.chart-legend {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.canvas-wrap {
  position: relative;
  height: min(62vh, 610px);
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(rgb(255 255 255 / 1.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 1.5%) 1px, transparent 1px),
    #0c0f11;
  background-size: 48px 48px;
}

#priceChart {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  background: rgb(9 11 13 / 70%);
  backdrop-filter: blur(4px);
}

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

.chart-legend {
  justify-content: flex-start;
  gap: 18px;
  padding: 15px 4px 0;
}

.chart-legend span:last-child {
  margin-left: auto;
}

.chart-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 2px;
}

.chart-legend .bull {
  background: var(--green);
}

.chart-legend .bear {
  background: var(--red);
}

.performance-main {
  padding-top: 34px;
}

.performance-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.performance-heading h1 {
  margin: 7px 0 8px;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.performance-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.performance-total {
  min-width: 240px;
  text-align: right;
}

.performance-total span,
.performance-total strong,
.performance-total small {
  display: block;
}

.performance-total span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.performance-total strong {
  margin: 8px 0 3px;
  font-size: 31px;
  letter-spacing: -0.04em;
}

.performance-total small {
  font-size: 12px;
  font-weight: 750;
}

.performance-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.performance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.performance-canvas-wrap {
  position: relative;
  height: 270px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(rgb(255 255 255 / 1.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 1.5%) 1px, transparent 1px),
    #0c0f11;
  background-size: 48px 48px;
}

.performance-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.performance-canvas-wrap .empty-state {
  position: absolute;
  inset: 0;
}

.performance-table {
  min-width: 420px;
}

@media (max-width: 950px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .lower-grid > * {
    min-width: 0;
  }

  .risk-rail {
    grid-template-columns: repeat(3, 1fr);
  }

  .risk-rail > span:nth-child(3) {
    border-right: 0;
  }

  .performance-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .login-shell {
    padding: 14px;
  }

  .login-card {
    padding: 28px 24px;
  }

  .login-copy {
    margin: 34px 0 24px;
  }

  .login-copy h1 {
    font-size: 30px;
  }

  .shell {
    padding: 0 14px 20px;
  }

  .topbar {
    gap: 10px;
    height: auto;
    min-height: 72px;
    padding: 14px 0;
  }

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .brand small {
    display: none;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .brand strong {
    font-size: 12px;
  }

  .main-nav {
    position: absolute;
    top: calc(100% - 6px);
    right: 0;
    display: none;
    width: min(240px, calc(100vw - 28px));
    padding: 7px;
    flex-direction: column;
    gap: 3px;
    border-color: #343b42;
    background: #111519;
    box-shadow: 0 20px 45px rgb(0 0 0 / 48%);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 12px 14px;
    font-size: 10px;
    text-align: left;
  }

  .topbar-meta {
    gap: 10px;
  }

  .mode-badge,
  .connection,
  #clock {
    display: none;
  }

  .logout-button {
    padding: 7px 9px;
  }

  main {
    padding-top: 14px;
  }

  .hero {
    padding: 25px 22px 0;
  }

  .hero-main {
    align-items: flex-start;
    flex-direction: column;
    min-height: 180px;
    padding: 10px 0 24px;
  }

  .hero-pnl {
    min-width: 0;
    text-align: left;
  }

  .risk-rail {
    grid-template-columns: repeat(2, 1fr);
  }

  .risk-rail > span,
  .risk-rail > span:not(:first-child) {
    padding: 15px 12px;
  }

  .risk-rail > span:nth-child(2n) {
    border-right: 0;
  }

  .metrics {
    gap: 8px;
  }

  .metric,
  .panel {
    padding: 18px;
  }

  .metric strong {
    font-size: 19px;
  }

  .lower-grid table {
    min-width: 620px;
  }

  .table-scroll {
    scrollbar-width: thin;
    scrollbar-color: #3a4249 transparent;
  }

  footer {
    gap: 8px;
    flex-direction: column;
  }

  .charts-main {
    padding-top: 24px;
  }

  .chart-heading {
    gap: 22px;
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-price {
    text-align: left;
  }

  .chart-panel {
    padding: 14px;
  }

  .canvas-wrap {
    height: 56vh;
    min-height: 360px;
  }

  .performance-main {
    padding-top: 24px;
  }

  .performance-heading {
    gap: 22px;
    align-items: flex-start;
    flex-direction: column;
  }

  .performance-total {
    min-width: 0;
    text-align: left;
  }

  .performance-metrics {
    gap: 8px;
  }

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

  .performance-canvas-wrap {
    height: 230px;
  }

  .performance-table {
    min-width: 100%;
  }

  .performance-table th,
  .performance-table td {
    padding-right: 6px;
    padding-left: 6px;
    font-size: 10px;
  }
}
