:root{
  --bg:#0b1020;
  --card:#121a33;
  --card2:#0f1730;
  --text:#e7eaf3;
  --muted:#a9b0c7;
  --accent:#7aa2ff;
  --good:#5ef2c2;
  --warn:#ffcd6a;
  --bad:#ff6b7a;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --radius: 18px;
  --border: rgba(255,255,255,.08);
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 800px at 20% 0%, #121a33 0%, var(--bg) 60%);
  color:var(--text);
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 22px;
  border-bottom:1px solid var(--border);
  background: rgba(10,15,30,.6);
  backdrop-filter: blur(10px);
  position: sticky;
  top:0;
  z-index:10;
}

.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:42px; height:42px;
  border-radius:14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(122,162,255,.25), rgba(94,242,194,.18));
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  font-weight:800;
}
.title{font-size:16px; font-weight:800}
.subtitle{font-size:12px; color:var(--muted)}

.status{display:flex; gap:10px; align-items:center}
.pill{
  padding:8px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--border);
  font-size:12px;
}

.layout{
  display:grid;
  grid-template-columns: 1.5fr .85fr;
  gap:18px;
  padding:18px;
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}

.cardHeader{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

h2,h3{margin:0 0 8px 0}
.muted{color:var(--muted); margin:0}
.small{font-size:12px}

.legend{display:flex; gap:10px; align-items:center; color:var(--muted); font-size:12px}
.dot{width:10px; height:10px; border-radius:999px; display:inline-block; margin-right:6px}
.dot.a{background:var(--accent)}
.dot.b{background:var(--good)}
.dot.c{background:var(--warn)}
.dot.d{background:var(--bad)}

.canvasWrap{
  margin-top:12px;
  border-radius: 16px;
  overflow:hidden;
  border:1px solid var(--border);
  background: rgba(0,0,0,.18);
}

.controls{
  margin-top:12px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:flex-start;
}

.controlGroup{
  padding:10px;
  border:1px solid var(--border);
  border-radius:16px;
  background: rgba(0,0,0,.12);
  min-width: 200px;
}
.controlGroup.grow{flex:1; min-width: 280px}
.label{font-size:12px; color:var(--muted); margin-bottom:8px}
.btnRow{display:flex; gap:8px; flex-wrap:wrap}

.btn{
  border:none;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  border:1px solid var(--border);
  cursor:pointer;
  font-weight:700;
  transition: transform .08s ease, background .12s ease;
}
.btn:hover{transform: translateY(-1px); background: rgba(255,255,255,.12)}
.btn:disabled{opacity:.45; cursor:not-allowed}
.btn.ghost{background: rgba(255,255,255,.05)}
.btn.primary{background: rgba(122,162,255,.25); border-color: rgba(122,162,255,.35)}
.btn.primary:hover{background: rgba(122,162,255,.32)}

.console{
  margin:0;
  padding:10px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.20);
  min-height: 110px;
  overflow:auto;
  font-size:12px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.side{display:flex; flex-direction:column; gap:18px}

.steps{margin:0; padding-left: 18px; color:var(--text)}
.steps li{margin:8px 0}

.hintRow{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px}

/* Switch */
.switch{position:relative; display:inline-block; width:48px; height:28px}
.switch input{opacity:0; width:0; height:0}
.slider{
  position:absolute; cursor:pointer; inset:0;
  background: rgba(255,255,255,.12);
  border:1px solid var(--border);
  border-radius: 999px;
  transition:.2s;
}
.slider:before{
  position:absolute; content:"";
  height:22px; width:22px;
  left:3px; top:2px;
  background: rgba(255,255,255,.85);
  border-radius:999px;
  transition:.2s;
}
.switch input:checked + .slider{
  background: rgba(94,242,194,.18);
  border-color: rgba(94,242,194,.35);
}
.switch input:checked + .slider:before{
  transform: translateX(20px);
}
