:root {
  color-scheme: dark;
  --bg: #03060b;
  --panel: #07101a;
  --line: #1d3344;
  --text: #e9f7ff;
  --muted: #7f96aa;
  --cyan: #35f3ff;
  --green: #52f5ad;
  --gold: #ffc857;
  --red: #ff5578;
  --magenta: #ff3fc8;
  font-family: Inter, Segoe UI, sans-serif;
  font-size: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 80% 0%, #12304a55, transparent 32%),
    radial-gradient(circle at 10% 80%, #2a0b3244, transparent 28%),
    var(--bg);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: linear-gradient(#163047 1px, transparent 1px), linear-gradient(90deg, #163047 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(#000, transparent 80%);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.boot { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.boot-card, .panel {
  position: relative;
  width: min(460px, 100%);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #0b1824, #050b12 70%);
  box-shadow: inset 0 1px #21435a55, 0 20px 60px #000a;
  padding: 28px;
}
.panel { width: auto; padding: 16px; }
.boot-card::after, .panel::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 48px; height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}
.eyebrow { font: 11px Consolas, monospace; letter-spacing: .18em; color: var(--cyan); text-transform: uppercase; }
h1 { font-family: Consolas, monospace; font-weight: 600; letter-spacing: .04em; margin: 8px 0; }
.lede, .muted, .heading p { color: var(--muted); }
form label { display: grid; gap: 6px; margin: 14px 0; font: 11px Consolas, monospace; letter-spacing: .08em; color: var(--muted); }
input, select {
  background: #061019;
  border: 1px solid #27445a;
  border-radius: 4px;
  padding: 10px 12px;
  letter-spacing: 0;
  text-transform: none;
}
button.primary { background: var(--cyan); color: #042027; border: 0; border-radius: 4px; padding: 11px 14px; font-weight: 700; }
button.flat, button.ghost { background: transparent; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; }
button.ghost.buy { color: var(--green); border-color: #1f6b52; }
button.ghost.sell { color: var(--red); border-color: #6d3144; }
.check { display: flex !important; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; }
.error { color: var(--red); min-height: 1.2em; }
.shell { display: grid; grid-template-columns: 72px minmax(0, 1fr); min-height: 100vh; }
.rail { display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 16px 8px; border-right: 1px solid #214158; background: linear-gradient(#07111b, #04080e); }
.logo { color: var(--cyan); font: 700 18px Consolas, monospace; text-shadow: 0 0 12px #35f3ff88; margin-bottom: 8px; }
.rail button { width: 44px; height: 36px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: #6d879b; font: 10px Consolas, monospace; }
.rail button[aria-current="page"] { color: var(--cyan); border-color: #1b5961; background: #0d2930; box-shadow: inset 0 0 16px #21f5e522; }
main { padding: 0 22px 28px; max-width: 1100px; }
.topbar { min-height: 58px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #203747; position: relative; overflow: hidden; }
.qd-motion .topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: qd-scan 7s ease-in-out infinite;
}
@keyframes qd-scan { from { transform: translateX(-60%); } to { transform: translateX(60%); } }
.brand { font: 12px Consolas, monospace; letter-spacing: .16em; color: var(--cyan); }
.brand span { color: var(--muted); letter-spacing: .08em; }
.topright { display: flex; gap: 8px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid currentColor; border-radius: 2px; padding: 4px 8px; font: 10px Consolas, monospace; letter-spacing: .08em; color: var(--green); }
.pill.gold { color: var(--gold); }
.pill.red { color: var(--red); background: #35131e; animation: live-pulse 1.4s ease-in-out infinite; }
@keyframes live-pulse { 50% { box-shadow: 0 0 16px #ff557888; } }
.radar { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.qd-motion .radar.on { animation: radar 1.6s ease-out infinite; }
@keyframes radar { 70% { transform: scale(1.7); opacity: .35; } }
.manual-banner { border-left: 3px solid var(--gold); background: #221c12; color: #f0d7a4; padding: 10px 12px; margin: 14px 0; }
.heading h1 { margin-bottom: 0; }
.cards { display: grid; gap: 12px; }
.card {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #0c1824, #071018);
  padding: 14px;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
}
.qd-motion .card { animation: card-in .35s ease; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card.buy { box-shadow: inset 3px 0 var(--green); }
.card.sell { box-shadow: inset 3px 0 var(--red); }
.card h2 { margin: 0 0 4px; font: 600 16px Consolas, monospace; color: #f4fbff; letter-spacing: .03em; }
.card p { margin: 0; color: #d7e6f2; font: 12px Consolas, monospace; }
.ring { width: 64px; height: 64px; }
.ring circle { fill: none; stroke-width: 6; }
.ring .track { stroke: #1a3344; }
.ring .value { stroke: var(--cyan); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .4s linear; }
.chip { font: 10px Consolas, monospace; letter-spacing: .08em; padding: 4px 6px; border: 1px solid var(--line); color: var(--gold); }
.chip.ok { color: var(--green); border-color: #1f6b52; }
.chip.bad { color: var(--red); border-color: #6d3144; }
button.ghost:disabled { opacity: .5; cursor: default; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 80; max-width: 520px; margin: 0 auto; padding: 10px 12px; border: 1px solid var(--red); background: #2a1218; color: #ffd0d8; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.detail p, .form p { line-height: 1.55; }
.form { display: grid; gap: 8px; width: min(640px, 100%); }
svg#marketChart { width: 100%; height: 220px; background: #050b12; }
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .rail { flex-direction: row; overflow: auto; border-right: 0; border-bottom: 1px solid #214158; }
  .card { grid-template-columns: 1fr; }
  main { padding: 0 12px 20px; }
  #candleChart { height: 280px; }
  .filters { display: grid; }
  .wizard-card { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .qd-motion .topbar::after, .qd-motion .radar.on, .qd-motion .card, .pill.red, .qd-motion .wizard-card { animation: none; }
  .ring .value { transition: none; }
}
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 12px 0 16px; }
.filters label { margin: 0; min-width: 140px; }
#candleChart { height: 460px; background: #050b12; border: 1px solid var(--line); }
@media (max-width: 720px) {
  #candleChart { height: 280px; }
}
.chart-credit, .steps { color: var(--muted); }
.steps { padding-left: 18px; line-height: 1.5; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 10px 0; }
.stat { border: 1px solid var(--line); padding: 8px; display: grid; gap: 4px; }
.stat b { font: 10px Consolas, monospace; letter-spacing: .08em; color: var(--muted); font-weight: 500; }
.spark { width: min(420px, 100%); height: 80px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; padding: 8px; color: var(--muted); }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; font: 12px Consolas, monospace; }
.wizard { position: fixed; inset: 0; background: #03060bcc; display: grid; place-items: center; z-index: 20; padding: 16px; }
.wizard-card { width: min(680px, 100%); max-height: min(90vh, 820px); overflow: auto; border: 1px solid var(--line); background: #071018; padding: 22px; }
.qd-motion .wizard-card { animation: card-in .35s ease; }
.coverage-banner { border-left: 3px solid var(--red); background: #2a1218; color: #ffd0da; padding: 10px 12px; margin: 14px 0; }
.event-badge { color: var(--gold); }
.timeline, .time-row { display: grid; gap: 6px; margin: 8px 0 16px; }
.time-row { grid-template-columns: 180px 1fr auto; align-items: center; font: 11px Consolas, monospace; }
.bar { display: block; height: 8px; width: 36px; background: var(--gold); }
.card.test { box-shadow: inset 3px 0 var(--gold); }
fieldset { border: 1px solid var(--line); margin: 8px 0; }
legend { padding: 0 6px; color: var(--muted); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
textarea { width: 100%; background: #061019; border: 1px solid #27445a; color: inherit; padding: 8px; }
