:root{
  --bg:#0b1220;
  --bg2:#0f1b33;
  --card:rgba(255,255,255,.06);
  --stroke:rgba(255,255,255,.12);
  --text:#eaf0ff;
  --muted:rgba(234,240,255,.72);
  --accent:#7aa7ff;
  --accent2:#60f3d3;
  --danger:#ff6b6b;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius:18px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(122,167,255,.25), transparent 55%),
    radial-gradient(900px 500px at 85% 30%, rgba(96,243,211,.18), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  min-height:100vh;
}

.wrap{max-width:1200px;margin:0 auto;padding:28px 18px 40px}
.topbar{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:16px}
h1{margin:0;font-size:22px;letter-spacing:.2px;line-height:1.25}
.subtitle{margin:6px 0 0;color:var(--muted);font-size:13px}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.mt8{margin-top:8px}.mt10{margin-top:10px}.mt12{margin-top:12px}
.between{justify-content:space-between}

.pill{
  display:inline-flex;align-items:center;gap:8px;
  padding:8px 12px;border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid var(--stroke);
  color:var(--muted);font-size:12px;white-space:nowrap;
}
.pillSoft{background:rgba(0,0,0,.18)}

.grid{display:grid;grid-template-columns:420px 1fr;gap:16px}
@media (max-width: 980px){.grid{grid-template-columns:1fr}}

.card{
  background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.05));
  border:1px solid var(--stroke);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.cardHeader{
  padding:14px;border-bottom:1px solid rgba(255,255,255,.08);
  display:flex;justify-content:space-between;align-items:center;gap:12px;
}
.cardTitle{
  font-size:13px;font-weight:800;letter-spacing:.3px;text-transform:uppercase;
  color:rgba(234,240,255,.85);
}
.cardBody{padding:14px}

.btn{
  padding:10px 12px;border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.10);
  color:var(--text);cursor:pointer;transition:.15s ease;
  display:inline-flex;align-items:center;gap:8px;
}
.btn:hover{transform:translateY(-1px);background:rgba(255,255,255,.14)}
.btn:disabled{opacity:.45;cursor:not-allowed;transform:none}
.btnPrimary{
  background:linear-gradient(135deg, rgba(122,167,255,.35), rgba(96,243,211,.22));
  border-color:rgba(122,167,255,.35);
}
.btnDanger{
  background:rgba(255,107,107,.10);
  border-color:rgba(255,107,107,.25);
  color:#ffd2d2;
}
.btnGhost{
  background:rgba(0,0,0,.18);
  border-color:rgba(255,255,255,.10);
  color:rgba(234,240,255,.85);
}

.drop{
  border:1.5px dashed rgba(122,167,255,.55);
  background:rgba(122,167,255,.08);
  border-radius:16px;padding:14px;transition:.18s ease;
}
.drop.dragover{
  transform:scale(1.01);
  background:rgba(96,243,211,.10);
  border-color:rgba(96,243,211,.65);
}
.dropRow{display:flex;gap:12px;align-items:center;flex-wrap:wrap;justify-content:space-between}
.dropLeft{display:flex;flex-direction:column;gap:6px}
.dropTitle{font-weight:800}
.dropHint{color:var(--muted);font-size:13px}

.field{display:flex;flex-direction:column;gap:6px}
label{font-size:12px;color:rgba(234,240,255,.8)}
select,input[type="number"],input[type="text"]{
  padding:10px 12px;border-radius:14px;border:1px solid var(--stroke);
  background:rgba(0,0,0,.18);color:var(--text);outline:none;min-width:180px
}
input::placeholder{color:rgba(234,240,255,.45)}

.status{color:var(--muted);font-size:13px;display:flex;align-items:center;gap:10px;min-height:20px;margin-top:12px}
.spinner{
  width:14px;height:14px;border-radius:999px;
  border:2px solid rgba(234,240,255,.25);
  border-top-color: rgba(234,240,255,.85);
  animation:spin .8s linear infinite;
  display:none;
}
.status.loading .spinner{display:inline-block}
@keyframes spin{to{transform:rotate(360deg)}}

.preview{
  margin-top:12px;border-radius:16px;border:1px solid rgba(255,255,255,.10);
  overflow:hidden;background:rgba(0,0,0,.18);
}
.preview img,.preview canvas{
  width:100%;display:block;max-height:380px;object-fit:contain;background:rgba(0,0,0,.18);
}
.previewMeta{
  padding:10px 12px;border-top:1px solid rgba(255,255,255,.08);
  display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;
  color:var(--muted);font-size:12px;
}

.tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.tab{
  padding:9px 12px;border-radius:999px;border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);color:rgba(234,240,255,.85);cursor:pointer;
  transition:.15s ease;font-size:13px;
}
.tab.active{
  background:linear-gradient(135deg, rgba(122,167,255,.25), rgba(96,243,211,.14));
  border-color:rgba(122,167,255,.30);
  font-weight:800;
}

.box{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  border-radius:16px;padding:12px;
}
.small{font-size:12px;color:var(--muted)}
textarea{
  width:100%;height:260px;padding:12px;border-radius:16px;border:1px solid var(--stroke);
  background:rgba(0,0,0,.18);color:var(--text);outline:none;resize:vertical;line-height:1.45;font-size:14px;
}
.panel{display:none}.panel.active{display:block}

.fields{display:grid;grid-template-columns:repeat(3,minmax(220px,1fr));gap:10px}
@media (max-width: 980px){.fields{grid-template-columns:repeat(2,minmax(200px,1fr))}}
@media (max-width: 560px){.fields{grid-template-columns:1fr}}

.tableWrap{overflow:auto}
table{
  width:100%;border-collapse:separate;border-spacing:0;
  border-radius:16px;border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.14);overflow:hidden;
}
th,td{
  padding:10px;font-size:13px;border-bottom:1px solid rgba(255,255,255,.08);
  border-right:1px solid rgba(255,255,255,.06);vertical-align:top;
}
th{
  background:rgba(255,255,255,.07);
  color:rgba(234,240,255,.92);
  font-weight:800;text-transform:lowercase;
}
tr:last-child td{border-bottom:none}
th:last-child,td:last-child{border-right:none}
td[contenteditable="true"]{outline:none}
td[contenteditable="true"]:focus{
  box-shadow:0 0 0 2px rgba(122,167,255,.35) inset;
  background:rgba(122,167,255,.08);
}

.alert{
  border-radius:14px;padding:10px 12px;border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.18);color:rgba(234,240,255,.88);font-size:13px;
}
.alert.good{border-color:rgba(96,243,211,.35); background:rgba(96,243,211,.08)}
.alert.bad{border-color:rgba(255,107,107,.35); background:rgba(255,107,107,.08)}
.alert ul{margin:8px 0 0 18px}
.alert li{margin:4px 0}

.hint{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}

.footer{
  margin-top:14px;
  display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;
  color:rgba(234,240,255,.7);font-size:12px;
}
.muted{color:var(--muted)}
