:root{
  --bg:#070a14;
  --card:#0b1224;
  --card2:#0a1020;
  --stroke:#162041;
  --text:#e9eefc;
  --muted:#a7b3d6;
  --btn:#22305a;
  --btn2:#2a3c77;
  --accent:#4d6bff;
  --accent2:#7b4dff;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background: radial-gradient(1200px 700px at 20% 0%, #0d1633, var(--bg));
}

.wrap{
  max-width:1200px;
  margin:0 auto;
  padding:24px;
}

.header h1{
  margin:0 0 6px;
  font-size:42px;
  letter-spacing:.2px;
}
.sub{margin:0 0 18px; color:var(--muted)}

.grid{
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap:18px;
}
@media (max-width: 980px){
  .grid{grid-template-columns:1fr}
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--stroke);
  border-radius:16px;
  padding:18px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}

.card h2{margin:2px 0 12px; font-size:18px}
.field{margin:10px 0}
label{display:block; margin:0 0 6px; color:var(--muted); font-size:13px}
input,textarea{
  width:100%;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);
  color:var(--text);
  border-radius:12px;
  padding:12px 12px;
  outline:none;
}
input:focus,textarea:focus{
  border-color:rgba(77,107,255,.6);
  box-shadow:0 0 0 3px rgba(77,107,255,.15);
}

.row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.formula{
  margin:12px 0;
  padding:12px;
  border:1px dashed rgba(255,255,255,.10);
  border-radius:12px;
  background:rgba(0,0,0,.12);
}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:12.5px; opacity:.95}
.muted{color:var(--muted)}

.btnRow{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin:10px 0;
}
.btn{
  border:1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  color:var(--text);
  border-radius:12px;
  padding:12px 12px;
  cursor:pointer;
  font-weight:700;
}
.btn:hover{border-color:rgba(255,255,255,.18)}
.btn.primary{
  border:none;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.btn.full{width:100%; margin-top:10px}

.hr{
  height:1px;
  background:rgba(255,255,255,.08);
  margin:16px 0;
}

.status{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  background:rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.08);
  color:var(--muted);
}

.previewCard .previewWrap{
  position:relative;
  width:100%;
  height:520px;
  border-radius:14px;
  overflow:hidden;
  background: radial-gradient(700px 400px at 30% 0%, rgba(77,107,255,.18), rgba(0,0,0,.25));
  border:1px solid rgba(255,255,255,.08);
}
@media (max-width: 980px){
  .previewCard .previewWrap{height:420px}
}

#preview{
  width:100%;
  height:100%;
  display:block;
}
.hint{
  position:absolute;
  bottom:10px;
  left:10px;
  padding:8px 10px;
  border-radius:10px;
  background:rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.10);
  font-size:12px;
  color:var(--muted);
}
.mini{margin-top:12px; color:var(--muted); font-size:13px}
