.qbc-pp-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.qbc-pp-dialog {
  width: min(860px, 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.32);
  color: #0f172a;
  font-size: 13px;
}

.qbc-pp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(120deg, #0f172a 0%, #1e293b 55%, #0f766e 100%);
  color: #f8fafc;
}

.qbc-pp-header h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.qbc-pp-header p {
  margin: 0;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.78);
  line-height: 1.6;
}

.qbc-pp-close {
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.qbc-pp-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 20px 10px;
  border-bottom: 1px solid #e2e8f0;
}

.qbc-pp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.qbc-pp-field span {
  font-size: 12px;
  color: #64748b;
}

.qbc-pp-field select,
.qbc-pp-test-row input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #cbd5f5;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  outline: none;
}

.qbc-pp-field select:focus,
.qbc-pp-test-row input:focus {
  border-color: #0f766e;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.qbc-pp-button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #cbd5f5;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.qbc-pp-button:hover {
  background: #f1f5f9;
}

.qbc-pp-button.is-primary {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

.qbc-pp-button.is-primary:hover {
  background: #0d9488;
}

.qbc-pp-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.qbc-pp-status {
  padding: 8px 20px;
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
}

.qbc-pp-status.is-success {
  color: #047857;
  background: #ecfdf5;
}

.qbc-pp-status.is-warn {
  color: #b45309;
  background: #fffbeb;
}

.qbc-pp-status.is-error {
  color: #b91c1c;
  background: #fef2f2;
}

.qbc-pp-conflicts {
  margin: 10px 20px 0;
  padding: 10px 12px;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  max-height: 34vh;
  overflow-y: auto;
}

.qbc-pp-conflicts strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}

.qbc-pp-conflict-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  border-top: 1px dashed rgba(146, 64, 14, 0.2);
}

.qbc-pp-conflict-row code {
  flex: none;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(146, 64, 14, 0.12);
  font-size: 11px;
}

.qbc-pp-conflict-row select {
  flex: 1 1 160px;
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid rgba(146, 64, 14, 0.35);
  border-radius: 8px;
  background: #ffffff;
  color: #92400e;
  font-size: 12px;
}

.qbc-pp-conflict-row select:disabled {
  opacity: 0.6;
  cursor: progress;
}

.qbc-pp-conflicts p {
  margin: 6px 0 0;
  font-size: 11px;
  color: #a16207;
}

.qbc-pp-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qbc-pp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
}

.qbc-pp-row:hover {
  border-color: #cbd5f5;
}

.qbc-pp-row.is-event {
  background: #f8fafc;
}

.qbc-pp-order {
  flex: none;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.qbc-pp-info {
  flex: 1;
  min-width: 0;
}

.qbc-pp-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.qbc-pp-title strong {
  font-size: 13px;
  color: #0f172a;
}

.qbc-pp-id {
  font-size: 11px;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.qbc-pp-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 10px;
}

.qbc-pp-badge.is-muted {
  background: #f1f5f9;
  color: #64748b;
}

.qbc-pp-badge.is-conflict {
  background: #fef3c7;
  color: #92400e;
}

.qbc-pp-commands {
  margin: 4px 0 0;
  font-size: 11px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qbc-pp-actions {
  flex: none;
  display: flex;
  gap: 6px;
}

.qbc-pp-icon {
  width: 30px;
  height: 30px;
  border: 1px solid #cbd5f5;
  border-radius: 9px;
  background: #ffffff;
  color: #334155;
  font-size: 14px;
  cursor: pointer;
}

.qbc-pp-icon:hover:not(:disabled) {
  background: #f1f5f9;
}

.qbc-pp-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.qbc-pp-empty {
  margin: 24px 0;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

.qbc-pp-test {
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.qbc-pp-test-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.qbc-pp-test-head strong {
  font-size: 12px;
  color: #0f172a;
}

.qbc-pp-test-head span {
  font-size: 11px;
  color: #64748b;
}

.qbc-pp-test-row {
  display: flex;
  gap: 8px;
}

.qbc-pp-test-result {
  margin: 10px 0 0;
  padding: 10px 12px;
  max-height: 180px;
  overflow: auto;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
}

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

.qbc-pp-hint {
  font-size: 11px;
  color: #94a3b8;
}

@media (max-width: 640px) {
  .qbc-pp-overlay {
    padding: 0;
  }
  .qbc-pp-dialog {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .qbc-pp-toolbar {
    flex-wrap: wrap;
  }
  .qbc-pp-hint {
    display: none;
  }
}

html[data-theme="dark"] .qbc-pp-dialog {
  background: #0f1a2b;
  color: #e2e8f0;
}

html[data-theme="dark"] .qbc-pp-toolbar,
html[data-theme="dark"] .qbc-pp-footer,
html[data-theme="dark"] .qbc-pp-test {
  border-color: #1f2d44;
}

html[data-theme="dark"] .qbc-pp-status {
  background: #132134;
  color: #94a3b8;
}

html[data-theme="dark"] .qbc-pp-status.is-success {
  background: #0f2f28;
  color: #6ee7b7;
}

html[data-theme="dark"] .qbc-pp-status.is-warn {
  background: #2a2110;
  color: #fcd34d;
}

html[data-theme="dark"] .qbc-pp-status.is-error {
  background: #331417;
  color: #fca5a5;
}

html[data-theme="dark"] .qbc-pp-row {
  background: #132134;
  border-color: #1f2d44;
}

html[data-theme="dark"] .qbc-pp-row:hover {
  border-color: #33507a;
}

html[data-theme="dark"] .qbc-pp-row.is-event {
  background: #101d2e;
}

html[data-theme="dark"] .qbc-pp-title strong,
html[data-theme="dark"] .qbc-pp-test-head strong {
  color: #e2e8f0;
}

html[data-theme="dark"] .qbc-pp-id,
html[data-theme="dark"] .qbc-pp-commands,
html[data-theme="dark"] .qbc-pp-hint,
html[data-theme="dark"] .qbc-pp-field span,
html[data-theme="dark"] .qbc-pp-test-head span {
  color: #94a3b8;
}

html[data-theme="dark"] .qbc-pp-order {
  background: #1e293b;
  color: #cbd5e1;
}

html[data-theme="dark"] .qbc-pp-button,
html[data-theme="dark"] .qbc-pp-icon,
html[data-theme="dark"] .qbc-pp-field select,
html[data-theme="dark"] .qbc-pp-test-row input {
  background: #16233a;
  border-color: #2a3a55;
  color: #e2e8f0;
}

html[data-theme="dark"] .qbc-pp-button:hover,
html[data-theme="dark"] .qbc-pp-icon:hover:not(:disabled) {
  background: #1d2c44;
}

html[data-theme="dark"] .qbc-pp-button.is-primary {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}

html[data-theme="dark"] .qbc-pp-conflicts {
  background: #2a2110;
  border-color: #7c5a12;
  color: #fcd34d;
}

html[data-theme="dark"] .qbc-pp-conflicts p {
  color: #d9b45a;
}

html[data-theme="dark"] .qbc-pp-conflict-row {
  border-top-color: rgba(252, 211, 77, 0.2);
}

html[data-theme="dark"] .qbc-pp-conflict-row code {
  background: rgba(252, 211, 77, 0.14);
}

html[data-theme="dark"] .qbc-pp-conflict-row select {
  background: #1f1a0d;
  border-color: rgba(252, 211, 77, 0.35);
  color: #fcd34d;
}

html[data-theme="dark"] .qbc-pp-badge {
  background: #12324a;
  color: #7dd3fc;
}

html[data-theme="dark"] .qbc-pp-badge.is-muted {
  background: #1e293b;
  color: #94a3b8;
}

html[data-theme="dark"] .qbc-pp-badge.is-conflict {
  background: #3a2b0c;
  color: #fcd34d;
}

html[data-theme="dark"] .qbc-pp-test-result {
  background: #0b1220;
  color: #dbeafe;
}

html[data-theme="dark"] .qbc-pp-empty {
  color: #64748b;
}
