:root{
  --bg:#0b1220;
  --panel:#0f172a;
  --card:#111c33;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --line:#1f2a44;
  --accent:#60a5fa;
  --accent2:#34d399;
  --danger:#fb7185;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:14px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background: radial-gradient(1200px 800px at 20% 0%, #0f1a33, var(--bg));
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  background: rgba(15, 23, 42, .65);
  backdrop-filter: blur(10px);
  position:sticky;
  top:0;
  z-index:10;
}
.brand{ display:flex; align-items:center; gap:12px;}
.logo{
  width:46px; height:46px;
  border-radius:14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, #1f2937, #0b1220);
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  font-weight:800;
  letter-spacing:.5px;
}
.title .name{ font-weight:700; }
.title .sub{ color:var(--muted); font-size:12px; margin-top:2px; }

.actions{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.sep{ width:1px; height:28px; background: var(--line); margin:0 6px; }

.btn{
  border:1px solid var(--line);
  background: rgba(17, 28, 51, .8);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}
.btn:hover{ border-color: rgba(96,165,250,.6); }
.btn:active{ transform: translateY(1px); }
.btn-primary{ background: rgba(96,165,250,.18); border-color: rgba(96,165,250,.45); }
.btn-secondary{ background: rgba(156,163,175,.12); }
.btn-danger{ background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.35); }

.layout{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap:14px;
  padding:14px;
  height: calc(100% - 78px);
}

.panel{
  overflow:auto;
  padding-right:6px;
}

.card{
  background: rgba(17, 28, 51, .72);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:14px;
  margin-bottom:12px;
}
.card h2{
  margin:0 0 10px 0;
  font-size:14px;
  letter-spacing:.2px;
  color:#f3f4f6;
}

.row{ display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
label{ font-size:12px; color:var(--muted); }
input, select, textarea{
  border:1px solid rgba(31,42,68,.9);
  background: rgba(11,18,32,.65);
  color:var(--text);
  padding:10px 10px;
  border-radius:12px;
  outline:none;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(96,165,250,.6);
  box-shadow: 0 0 0 3px rgba(96,165,250,.12);
}
textarea{ resize:vertical; min-height:74px; }

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
.hint{ color:var(--muted); font-size:12px; line-height:1.35; }
.mini{ color:var(--muted); font-size:11px; margin-top:4px; }
.mini code{ color:#d1fae5; }

.check{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:var(--muted);
}
.check input{ transform: scale(1.05); }

.pill{
  padding:8px 10px;
  border:1px dashed rgba(96,165,250,.35);
  border-radius:999px;
  color:#e0f2fe;
  background: rgba(96,165,250,.08);
  font-size:12px;
}

.nudge{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:10px; }

.stage{
  background: rgba(15,23,42,.35);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  display:grid;
  grid-template-rows: 1fr auto;
}
.canvasWrap{
  overflow:auto;
  height:100%;
  padding:18px;
}
canvas{
  background:#fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  border: 1px solid rgba(0,0,0,.06);
  transform-origin: 0 0;
}

.footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-top:1px solid var(--line);
  background: rgba(17,28,51,.55);
}
.status{ color:var(--muted); font-size:12px; }
.right{ display:flex; gap:10px; }

@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; height:auto; }
  .panel{ max-height: none; }
}
