:root {
  color-scheme: dark;
  --bg: #07090c;
  --panel: #10151b;
  --panel-2: #151b22;
  --line: rgba(214, 224, 232, 0.14);
  --text: #eef4f7;
  --muted: #9aa8b2;
  --soft: #c9d3da;
  --gold: #d8b15f;
  --gold-2: #f0d58a;
  --aqua: #51d3c8;
  --red: #ff6b6b;
  --green: #60d394;
  --blue: #7aa7ff;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(216, 177, 95, 0.15), transparent 34%),
    radial-gradient(circle at 84% 4%, rgba(81, 211, 200, 0.1), transparent 28%),
    linear-gradient(135deg, #050607 0%, #091015 44%, #090c10 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 280px minmax(0, 1fr);
}

.side-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(7, 9, 12, 0.86);
  backdrop-filter: blur(22px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 30px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(216, 177, 95, 0.52);
  border-radius: 8px;
  color: #111;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(216, 177, 95, 0.18);
}

.brand-name,
.brand-subtitle,
.eyebrow,
.rail-kicker,
.fine-print,
.status-pill,
.panel-badge {
  margin: 0;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-stack {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--soft);
  text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(216, 177, 95, 0.26);
  color: var(--text);
  background: rgba(216, 177, 95, 0.08);
}

.nav-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--gold-2);
  font-size: 0.95rem;
}

.rail-panel {
  margin-top: 34px;
  padding: 18px;
  border: 1px solid rgba(81, 211, 200, 0.16);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(81, 211, 200, 0.1), rgba(255, 255, 255, 0.03));
}

.rail-kicker {
  color: var(--aqua);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.rail-copy {
  margin: 10px 0 0;
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.main-stage {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 24px;
  max-width: 1360px;
}

.eyebrow {
  color: var(--gold-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  margin-top: 8px;
  font-size: clamp(2.1rem, 4.2vw, 5.2rem);
  line-height: 0.96;
}

h2 {
  font-size: 1.05rem;
  line-height: 1.25;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

#tradeFile {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.icon-button,
.primary-upload {
  display: inline-flex;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.icon-button {
  width: 44px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.primary-upload {
  gap: 10px;
  padding: 0 16px;
  border: 1px solid rgba(216, 177, 95, 0.56);
  color: #111;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  font-weight: 800;
}

.icon-button:hover,
.primary-upload:hover {
  transform: translateY(-1px);
}

.hero-console,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 24, 30, 0.95), rgba(10, 13, 17, 0.95));
  box-shadow: var(--shadow);
}

.hero-console {
  max-width: 1360px;
  margin: 0 auto;
  overflow: hidden;
}

.risk-core {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 34px;
}

.risk-meter {
  position: relative;
  display: grid;
  min-height: 342px;
  place-items: center;
}

.risk-meter canvas {
  width: min(100%, 340px);
  height: auto;
}

.risk-center {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  width: 158px;
  min-height: 128px;
  place-items: center;
  transform: translate(-50%, -50%);
  text-align: center;
}

.risk-label,
.risk-center span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.risk-center strong {
  color: var(--text);
  font-size: 4rem;
  line-height: 0.94;
}

.hero-copy {
  min-width: 0;
}

.status-pill,
.panel-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(81, 211, 200, 0.24);
  border-radius: 999px;
  color: var(--aqua);
  background: rgba(81, 211, 200, 0.08);
  font-size: 0.75rem;
  font-weight: 800;
}

.hero-copy h2 {
  max-width: 780px;
  margin-top: 18px;
  font-size: clamp(1.7rem, 3vw, 3.7rem);
  line-height: 1.01;
}

.hero-copy p:not(.status-pill) {
  max-width: 740px;
  margin: 18px 0 0;
  color: var(--soft);
  font-size: 1rem;
  line-height: 1.65;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.hero-stats div {
  min-height: 90px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
  line-height: 1.35;
}

.hero-stats span {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 900;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.insight-strip article {
  min-height: 118px;
  padding: 22px 24px;
  border-right: 1px solid var(--line);
}

.insight-strip article:last-child {
  border-right: 0;
}

.insight-strip span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.insight-strip strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 1.08rem;
}

.insight-strip p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.grid-layout {
  display: grid;
  max-width: 1360px;
  margin: 24px auto 0;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 18px;
}

.panel {
  min-width: 0;
  padding: 22px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.behavior-list {
  display: grid;
  gap: 12px;
}

.behavior-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.behavior-score {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  color: #111;
  background: var(--gold);
  font-weight: 900;
}

.behavior-item h3,
.behavior-item p {
  margin: 0;
}

.behavior-item h3 {
  font-size: 0.98rem;
}

.behavior-item p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.behavior-tag {
  white-space: nowrap;
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.bar-chart {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 76px;
  gap: 12px;
  align-items: center;
}

.bar-label,
.bar-value {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.bar-value {
  text-align: right;
}

.bar-track {
  position: relative;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 10%;
  background: linear-gradient(90deg, rgba(96, 211, 148, 0.18), var(--green));
}

.bar-fill.negative {
  right: 50%;
  left: auto;
  background: linear-gradient(90deg, var(--red), rgba(255, 107, 107, 0.18));
}

.upload-panel,
.rules-panel,
.coach-panel,
.market-panel {
  min-height: 250px;
}

.drop-zone {
  display: grid;
  min-height: 176px;
  place-items: center;
  padding: 24px;
  border: 1px dashed rgba(216, 177, 95, 0.38);
  border-radius: 8px;
  text-align: center;
  background: rgba(216, 177, 95, 0.05);
}

.drop-zone.dragging {
  border-color: var(--gold-2);
  background: rgba(216, 177, 95, 0.11);
}

.drop-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  color: #111;
  background: var(--gold);
  font-weight: 900;
}

.drop-zone strong {
  margin-top: 12px;
}

.drop-zone p,
.fine-print {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.fine-print {
  margin-top: 12px;
}

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

.rules-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.rules-form input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  padding: 0 12px;
}

.coach-brief {
  display: grid;
  gap: 14px;
}

.brief-line {
  padding: 15px;
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.04);
  line-height: 1.5;
}

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

.positioning-grid div {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.positioning-grid span {
  color: var(--gold-2);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.positioning-grid p {
  margin: 12px 0 0;
  color: var(--soft);
  line-height: 1.5;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-rail {
    position: relative;
    height: auto;
    padding: 18px;
  }

  .nav-stack {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rail-panel {
    display: none;
  }

  .risk-core,
  .grid-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .main-stage {
    padding: 18px 14px;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    width: 100%;
  }

  .primary-upload {
    flex: 1;
  }

  .nav-stack {
    grid-template-columns: 1fr 1fr;
  }

  .risk-core {
    padding: 20px;
  }

  .risk-meter {
    min-height: 272px;
  }

  .risk-center strong {
    font-size: 3.1rem;
  }

  .hero-stats,
  .insight-strip,
  .rules-form,
  .positioning-grid {
    grid-template-columns: 1fr;
  }

  .insight-strip article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .insight-strip article:last-child {
    border-bottom: 0;
  }

  .behavior-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .behavior-tag {
    grid-column: 2;
  }

  .bar-row {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .bar-value {
    grid-column: 2;
    text-align: left;
  }
}
