:root{
  --bg:#0b1020;
  --text:#e8eeff;
  --muted:#a9b6df;
  --line:rgba(255,255,255,.10);

  --accent:#3b82f6;
  --accent2:#ef4444;
  --ok:#22c55e;
  --warn:#f59e0b;

  --shadow: 0 18px 40px rgba(0,0,0,.35);
  --radius:18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:var(--sans);
  background:
    radial-gradient(1200px 700px at 15% 10%, rgba(59,130,246,.22), transparent 60%),
    radial-gradient(1100px 650px at 85% 15%, rgba(239,68,68,.18), transparent 60%),
    linear-gradient(180deg, #070a14, var(--bg));
  color:var(--text);
  min-height:100vh;
}
.wrap{max-width:1240px;margin:20px auto;padding:0 16px 140px;}
header{display:flex;gap:12px;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;margin-bottom:14px}
.title{margin:0;font-size:26px;font-weight:900;letter-spacing:.2px;display:flex;gap:10px;align-items:center}
.badge{
  font-size:12px;padding:6px 10px;border-radius:999px;border:1px solid var(--line);
  background:rgba(255,255,255,.04);color:var(--muted);font-weight:900;
}
.subtitle{margin:6px 0 0;color:var(--muted);max-width:980px;line-height:1.45}
.pillrow{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.pill{
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--muted);
  padding:9px 12px;border-radius:999px;
  font-size:12px;font-weight:900;
  user-select:none;
  display:flex;align-items:center;gap:8px;
}
.grid{display:grid;grid-template-columns:1.07fr .93fr;gap:14px}
@media (max-width: 980px){ .grid{grid-template-columns:1fr} }
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.hd{
  padding:14px 16px;border-bottom:1px solid var(--line);
  background: linear-gradient(90deg, rgba(59,130,246,.12), rgba(239,68,68,.10));
  display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;
}
.hd h2{margin:0;font-size:14px;font-weight:900;letter-spacing:.2px}
.bd{padding:14px 16px}
.steps{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.step{
  display:flex;gap:10px;align-items:center;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  padding:10px 12px;border-radius:14px;
  min-width:210px;
}
.num{
  width:26px;height:26px;border-radius:999px;
  display:flex;align-items:center;justify-content:center;
  font-weight:900;font-size:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.25);
  color:var(--muted);
  flex:0 0 auto;
}
.step.active .num{background:rgba(59,130,246,.22);color:#dbeafe;border-color:rgba(59,130,246,.35)}
.step.done .num{background:rgba(34,197,94,.18);color:#d7ffe3;border-color:rgba(34,197,94,.35)}
.stepTxt{display:flex;flex-direction:column;gap:2px}
.stepTxt .t{font-weight:900;font-size:12px;color:var(--text)}
.stepTxt .s{font-size:12px;color:var(--muted);line-height:1.2}
label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted);font-weight:900}
input[type="text"], textarea, select{
  width:100%;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.22);
  color:var(--text);
  border-radius:14px;
  padding:11px 12px;
  font-size:13px;
  outline:none;
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
input[type="text"]:focus, textarea:focus, select:focus{
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 3px rgba(59,130,246,.16);
  background:rgba(0,0,0,.28);
}
textarea{min-height:112px;resize:vertical;line-height:1.35}
.row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width: 720px){ .row{grid-template-columns:1fr} }
.selectWrap{position:relative}
.selectWrap:after{
  content:"▾";
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  color:rgba(232,238,255,.7);
  pointer-events:none;
  font-weight:900;
}
select{
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  padding-right:34px;
  background:
    linear-gradient(180deg, rgba(59,130,246,.10), rgba(0,0,0,.20)),
    rgba(0,0,0,.22);
}
select option{
  background:#0a1022;
  color:#e8eeff;
}
.helpCard{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.03);
  border-radius:16px;
  padding:12px;
  margin-top:12px;
}
.helpTop{display:flex;gap:10px;align-items:flex-start;justify-content:space-between;flex-wrap:wrap}
.helpTitle{font-weight:900;font-size:13px;color:var(--text)}
.helpText{color:var(--muted);font-size:12px;line-height:1.45;margin-top:6px}
.hintBtnRow{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
.chip{
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--muted);
  padding:6px 10px;border-radius:999px;font-size:12px;font-weight:900;
  user-select:none;
  display:inline-flex;gap:8px;align-items:center;
}
.chip strong{color:var(--text)}
.toggle{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted);font-weight:900}
.toggle input{width:18px;height:18px;accent-color:var(--accent)}
.inline{display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between}
details{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.03);
  border-radius:16px;
  overflow:hidden;
  margin-top:12px;
}
details summary{
  list-style:none;
  cursor:pointer;
  padding:12px 12px;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  user-select:none;
  font-weight:900;font-size:13px;
  color:var(--text);
}
details summary::-webkit-details-marker{display:none}
.sumRight{display:flex;gap:8px;align-items:center}
.chev{opacity:.85}
details[open] .chev{transform:rotate(90deg)}
.accBody{padding:12px 12px 14px;border-top:1px solid rgba(255,255,255,.10)}
.muted{color:var(--muted);font-size:12px;line-height:1.4}
.chipsRow{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.roleChip{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.18);
  color:rgba(232,238,255,.82);
  padding:8px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
  user-select:none;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.roleChip:hover{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.18)}
.roleChip:active{transform:translateY(1px)}
.chGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media (max-width: 720px){ .chGrid{grid-template-columns:1fr} }
.tags{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.tag{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.18);
  color:rgba(232,238,255,.78);
  padding:8px 10px;border-radius:999px;font-size:12px;font-weight:900;
  cursor:pointer;user-select:none;
  transition: background .15s ease, border-color .15s ease;
}
.tag.on{
  background:rgba(59,130,246,.16);
  border-color:rgba(59,130,246,.35);
  color:#dbeafe;
}
.tag.on.ok{ background:rgba(34,197,94,.14); border-color:rgba(34,197,94,.35); color:#d7ffe3;}
.tag.on.warn{ background:rgba(245,158,11,.14); border-color:rgba(245,158,11,.35); color:#ffefcc;}
.out{
  background: rgba(0,0,0,.25);
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  padding:14px;
  min-height:270px;
  white-space:pre-wrap;
  font-family:var(--mono);
  font-size:12.6px;
  line-height:1.45;
  color:#f2f6ff;
}
.hr{height:1px;background:rgba(255,255,255,.10);margin:14px 0}
button{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 12px;border-radius:14px;cursor:pointer;font-weight:900;font-size:13px;
  transition:transform .05s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
}
button:hover{background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.18)}
button:active{transform:translateY(1px)}
button:disabled{opacity:.45;cursor:not-allowed}
.primary{background:linear-gradient(90deg, rgba(59,130,246,.95), rgba(239,68,68,.85));border-color:rgba(255,255,255,.10)}
.ghost{background:rgba(0,0,0,.18)}
.mini{font-size:12px;padding:9px 10px;border-radius:12px}
.bottomBar{
  position:fixed; left:0; right:0; bottom:0;
  padding:10px 12px;
  background: rgba(7,10,20,.72);
  backdrop-filter: blur(10px);
  border-top:1px solid rgba(255,255,255,.10);
  z-index:40;
}
.bbInner{
  max-width:1240px;margin:0 auto;
  display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;
}
.bbBtns{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.bbInfo{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.readyDot{
  width:10px;height:10px;border-radius:999px;background:rgba(245,158,11,.9);
  box-shadow:0 0 0 3px rgba(245,158,11,.18);
}
.readyDot.ok{background:rgba(34,197,94,.95); box-shadow:0 0 0 3px rgba(34,197,94,.18)}
.toast{
  position:fixed;right:16px;bottom:86px;background:rgba(0,0,0,.72);
  border:1px solid rgba(255,255,255,.14);
  color:var(--text);padding:10px 12px;border-radius:14px;box-shadow:var(--shadow);
  opacity:0;transform:translateY(8px);transition:opacity .2s ease, transform .2s ease;
  pointer-events:none;font-size:13px;font-weight:900;
  z-index:60;
}
.toast.show{opacity:1;transform:translateY(0)}
/* Structured form */
.structured-panel{
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  padding:12px;
  background:rgba(255,255,255,.02);
  margin-bottom:14px;
}
.structured-panel h3{margin:0;font-size:15px;font-weight:900}
.structured-panel .structured-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
@media (max-width: 720px){ .structured-panel .structured-fields{grid-template-columns:1fr} }
.structured-buttons{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.help-panel{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.65);
  display:none;
  justify-content:center;
  align-items:flex-start;
  padding:40px 16px 16px;
  z-index:80;
}
.help-panel.open{display:flex}
.help-panel-content{
  background:#05070f;
  border:1px solid rgba(255,255,255,.15);
  border-radius:20px;
  width:min(960px,100%);
  max-height:90vh;
  overflow:auto;
  padding:24px;
  box-shadow:0 40px 80px rgba(0,0,0,.55);
  position:relative;
}
.help-panel-content h1,
.help-panel-content h2,
.help-panel-content h3{color:#e8eeff;margin-top:24px}
.help-panel-content h1{margin-top:0}
.help-panel-content p{color:var(--muted);line-height:1.6}
.help-panel-content ul{padding-left:18px;}
.help-panel-content code{background:rgba(59,130,246,.15);padding:2px 6px;border-radius:6px;}
.help-panel-close{
  position:absolute;
  top:14px;
  right:14px;
  border:none;
  background:rgba(255,255,255,.08);
  width:32px;
  height:32px;
  border-radius:50%;
  font-size:18px;
  cursor:pointer;
}
/* Status chip / ready info */
.status-chip{border-radius:999px;padding:6px 12px;border:1px solid var(--line);display:inline-flex;align-items:center;gap:6px;font-size:12px;margin-top:6px}
/* Elements area modifications */
.element-panel .hd{border-bottom:1px solid var(--line);}
.element-panel .elements-area{margin-top:12px}
.element-panel textarea{min-height:180px}
.help-panel-markdown code{display:block;white-space:pre;}
@media (max-width: 600px){
  .wrap{padding-bottom:180px;}
}
