:root {
  color-scheme: dark;
  --bg: #05070d;
  --panel: #0d1320;
  --panel2: #121827;
  --text: #e7fbff;
  --muted: #7e92a6;
  --cyan: #00e5ff;
  --pink: #ff2bd6;
  --green: #3cff9e;
  --red: #ff456c;
  --yellow: #ffd166;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(255, 43, 214, 0.12), transparent 35%),
    linear-gradient(315deg, rgba(0, 229, 255, 0.14), transparent 38%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar, .grid, .metrics, .bottom {
  display: grid;
  gap: 14px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 14px;
}

h1, h2, p { margin: 0; }
h1 { font-size: clamp(22px, 3vw, 36px); letter-spacing: 0; }
h2 { font-size: 15px; color: var(--cyan); text-transform: uppercase; letter-spacing: 0; }

.topbar p {
  color: var(--muted);
  margin-top: 4px;
}

.price {
  font-size: clamp(26px, 4vw, 48px);
  color: var(--green);
  text-shadow: 0 0 18px rgba(60, 255, 158, 0.35);
}

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

.panel, .metrics > div {
  background: linear-gradient(180deg, rgba(18, 24, 39, 0.96), rgba(9, 14, 25, 0.96));
  border: 1px solid rgba(0, 229, 255, 0.24);
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.08), inset 0 0 22px rgba(255, 43, 214, 0.04);
}

.chart-panel {
  height: 560px;
  padding: 10px;
}

#chart {
  width: 100%;
  height: 100%;
}

.ai-panel, .position {
  padding: 18px;
}

.decision {
  margin: 18px 0 10px;
  font-size: 46px;
  font-weight: 800;
  color: var(--yellow);
}

.confidence {
  height: 10px;
  background: #1a2435;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
}

.confidence span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
}

.ai-panel p {
  color: #c9d7e8;
  min-height: 72px;
  line-height: 1.45;
}

dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin: 18px 0 0;
}

dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-weight: 700; }

.metrics {
  grid-template-columns: repeat(9, minmax(110px, 1fr));
  margin: 14px 0;
}

.metrics > div {
  padding: 14px;
  min-width: 0;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.bottom {
  grid-template-columns: 360px minmax(0, 1fr);
}

.log {
  padding: 18px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

th, td {
  padding: 9px 8px;
  border-bottom: 1px solid rgba(126, 146, 166, 0.18);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.positive { color: var(--green); }
.negative { color: var(--red); }

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

@media (max-width: 620px) {
  .shell { padding: 10px; }
  .topbar { grid-template-columns: 1fr; }
  .chart-panel { height: 440px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  table { font-size: 12px; }
}
