.qbc-ar-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgb(15 23 42 / 45%);
  backdrop-filter: blur(2px);
}

.qbc-ar-dialog {
  display: flex;
  flex-direction: column;
  width: min(1080px, 100%);
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgb(15 23 42 / 24%);
}

.qbc-ar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #e2e8f0;
}

.qbc-ar-title {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
  font-weight: 700;
}

.qbc-ar-subtitle {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.qbc-ar-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.qbc-ar-close:hover {
  background: #f8fafc;
}

.qbc-ar-message {
  margin: 12px 22px 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
}

.qbc-ar-message[data-tone="ok"] {
  background: #dcfce7;
  color: #166534;
}

.qbc-ar-message[data-tone="error"] {
  background: #fee2e2;
  color: #991b1b;
}

.qbc-ar-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 16px 22px 22px;
}

.qbc-ar-loading {
  padding: 32px;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

.qbc-ar-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.qbc-ar-select,
.qbc-ar-input,
.qbc-ar-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  outline: none;
}

.qbc-ar-select:focus,
.qbc-ar-input:focus,
.qbc-ar-textarea:focus {
  border-color: #3b82f6;
}

.qbc-ar-select {
  max-width: 320px;
}

.qbc-ar-textarea {
  min-height: 76px;
  line-height: 1.6;
  resize: vertical;
}

.qbc-ar-card {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.qbc-ar-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.qbc-ar-card-title {
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}

.qbc-ar-card-hint {
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.qbc-ar-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.qbc-ar-field {
  display: grid;
  gap: 5px;
  color: #475569;
  font-size: 12px;
}

.qbc-ar-field.wide {
  grid-column: 1 / -1;
}

.qbc-ar-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 12px;
}

.qbc-ar-toggle input {
  width: 15px;
  height: 15px;
}

.qbc-ar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid #2563eb;
  border-radius: 9px;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.qbc-ar-btn.secondary {
  border-color: #e2e8f0;
  background: #fff;
  color: #475569;
}

.qbc-ar-btn.danger {
  border-color: #fecaca;
  background: #fff;
  color: #b91c1c;
}

.qbc-ar-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.qbc-ar-models {
  display: grid;
  gap: 8px;
}

.qbc-ar-model-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) auto auto;
  align-items: center;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.qbc-ar-table-wrap {
  overflow-x: auto;
}

.qbc-ar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.qbc-ar-table th,
.qbc-ar-table td {
  padding: 8px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  text-align: left;
  white-space: nowrap;
}

.qbc-ar-table th {
  color: #64748b;
  font-weight: 600;
}

.qbc-ar-test-result {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.qbc-ar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid #e2e8f0;
}

.qbc-ar-footer-hint {
  color: #94a3b8;
  font-size: 12px;
}

@media (max-width: 720px) {
  .qbc-ar-overlay {
    padding: 0;
  }

  .qbc-ar-dialog {
    max-height: 100vh;
    border-radius: 0;
  }

  .qbc-ar-header,
  .qbc-ar-body,
  .qbc-ar-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .qbc-ar-model-row {
    grid-template-columns: 1fr;
  }

  .qbc-ar-footer {
    flex-direction: column;
    align-items: stretch;
  }
}