:root {
  --q-bg: #050816;
  --q-panel: #0f172a;
  --q-panel2: #111827;
  --q-border: #334155;
  --q-text: #e5e7eb;
  --q-muted: #94a3b8;
  --q-accent: #7c3aed;
  --q-accent2: #2563eb;
  --q-danger: #dc2626;
  --q-success: #16a34a;
  --q-input: #020617;
}
* { box-sizing: border-box; }
.qapi-body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--q-text);
  background: radial-gradient(circle at 20% 0%, rgba(124,58,237,.28), transparent 30%), linear-gradient(180deg, #0f172a, #020617 70%);
}
.qapi-shell { width: min(1500px, calc(100vw - 24px)); margin: 14px auto 32px; }
.qapi-header {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 20px; border: 1px solid var(--q-border); border-radius: 18px;
  background: rgba(15, 23, 42, .88); box-shadow: 0 18px 50px rgba(0,0,0,.26);
}
.qapi-kicker { color: #c4b5fd; text-transform: uppercase; letter-spacing: .09em; font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.qapi-header h1 { margin: 0 0 4px; font-size: 28px; }
.qapi-header p { margin: 0; color: var(--q-muted); font-size: 14px; }
.qapi-back { color: #ddd6fe; border: 1px solid rgba(196,181,253,.4); padding: 9px 13px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.qapi-alert { margin: 12px 0; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(250,204,21,.35); background: rgba(113,63,18,.25); color: #fde68a; }
.qapi-layout { display: grid; grid-template-columns: 290px 1fr; gap: 12px; }
.qapi-side, .qapi-card { border: 1px solid var(--q-border); border-radius: 16px; background: rgba(15,23,42,.92); box-shadow: 0 12px 35px rgba(0,0,0,.18); }
.qapi-side { padding: 14px; }
.panel-title { font-weight: 800; margin-bottom: 10px; }
.panel-title.small { font-size: 14px; margin-bottom: 8px; color: #ddd6fe; }
label { display: block; margin: 9px 0 5px; color: var(--q-muted); font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; background: var(--q-input); color: var(--q-text); border: 1px solid var(--q-border); border-radius: 10px; padding: 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,.18); }
.btn, .tiny { border: none; border-radius: 10px; cursor: pointer; font-weight: 800; }
.btn { padding: 10px 14px; }
.tiny { padding: 6px 9px; color: #e5e7eb; background: #334155; }
.btn.primary { background: linear-gradient(135deg, var(--q-accent), var(--q-accent2)); color: white; }
.btn.secondary { background: #334155; color: #e5e7eb; }
.btn.full { width: 100%; margin-top: 10px; }
.divider { border-top: 1px solid rgba(148,163,184,.25); margin: 16px 0; }
.usecase-list { padding-left: 18px; margin: 0; color: #cbd5e1; line-height: 1.7; font-size: 14px; }
.check-row { display: flex; align-items: center; gap: 8px; line-height: 1.3; }
.check-row input { width: auto; }
.qapi-main { display: grid; gap: 12px; }
.qapi-card { padding: 14px; }
.grid-row { display: grid; gap: 10px; }
.grid-row.first { grid-template-columns: 130px 1.2fr 1fr; }
.grid-row.auth { grid-template-columns: 1fr 250px 1fr; margin-top: 8px; }
.editor-grid { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 12px; min-height: 360px; }
.editor-card { display: flex; flex-direction: column; min-height: 360px; }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-weight: 800; }
textarea { min-height: 280px; resize: vertical; font-family: Consolas, Menlo, Monaco, monospace; font-size: 13px; line-height: 1.45; white-space: pre; }
.body-card textarea { min-height: 315px; }
.qapi-results { min-height: 280px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--q-border); padding-bottom: 8px; }
.tab { background: #1f2937; color: #cbd5e1; border: 1px solid var(--q-border); padding: 8px 11px; border-radius: 999px; cursor: pointer; font-weight: 800; }
.tab.active { background: #4c1d95; border-color: #8b5cf6; color: white; }
.tab-panel { display: none; margin: 10px 0 0; min-height: 220px; max-height: 420px; overflow: auto; background: #020617; border: 1px solid var(--q-border); border-radius: 12px; padding: 12px; color: #d1d5db; font-family: Consolas, Menlo, Monaco, monospace; font-size: 13px; line-height: 1.45; }
.tab-panel.active { display: block; }
@media (max-width: 1000px) {
  .qapi-layout, .editor-grid, .grid-row.first, .grid-row.auth { grid-template-columns: 1fr; }
  .qapi-header { align-items: flex-start; flex-direction: column; }
}


.qapi-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.qapi-help-button { color: #ddd6fe; border: 1px solid rgba(196,181,253,.4); padding: 9px 13px; border-radius: 999px; text-decoration: none; white-space: nowrap; font-weight: 800; }
.qapi-help-button:hover { background: rgba(196,181,253,.12); }
