html.wp-toolbar:has(body.nxtpdf-setup-wizard-admin) {
  padding-top: 0 !important;
}

body.nxtpdf-setup-wizard-admin #wpadminbar,
body.nxtpdf-setup-wizard-admin #adminmenumain,
body.nxtpdf-setup-wizard-admin #wpfooter,
body.nxtpdf-setup-wizard-admin .notice,
body.nxtpdf-setup-wizard-admin .update-nag {
  display: none !important;
}

body.nxtpdf-setup-wizard-admin #wpcontent,
body.nxtpdf-setup-wizard-admin #wpbody-content {
  margin-left: 0 !important;
  padding: 0 !important;
}

body.nxtpdf-setup-wizard-admin #wpbody-content > .wrap > h1 {
  display: none !important;
}

/* App pages use regular classes */
.nxtpdf-hidden {
  display: none !important;
}

@keyframes nxtpdfSpin {
  to {
    transform: rotate(360deg);
  }
}

.nxtpdf-page-title {
  margin: 0 0 16px;
  font-size: 24px;
  line-height: 1.3333;
  font-weight: 700;
  color: #1f2937;
}

.nxtpdf-panel-section {
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.nxtpdf-panel-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 13px 14px;
  border-bottom: 1px solid #e6edf5;
  background: #f8fafc;
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.wrap .nxtpdf-editor-sidebar .nxtpdf-panel-section-title {
  margin: 0;
}

.nxtpdf-panel-section-title:hover {
  background: #eef2f7;
}

.nxtpdf-panel-section-icon {
  margin-right: 6px !important;
  color: #0f766e;
  font-size: 17px;
}

.nxtpdf-panel-section-arrow {
  width: 16px !important;
  height: 16px !important;
  margin-left: auto !important;
  color: #64748b;
  transition: transform 150ms ease;
}

.nxtpdf-panel-section-content {
  padding: 14px;
  background: #ffffff;
}

.nxtpdf-panel-section-content > * + * {
  margin-top: 16px;
}

[data-nxtpdf-section]:not([data-collapsed]) .nxtpdf-panel-section-title {
  background: #f0fdfa;
  color: #115e59;
  border-bottom-color: #cfe7e3;
}

/* PDFPanel-specific layout hook: vertical uses full-width fields + top labels */
.nxtpdf-panel-fields.is-vertical > .nxtf-form-field {
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
}

.nxtpdf-panel-fields.is-vertical > .nxtf-form-field > .nxtf-label-wrapper {
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
}

.nxtpdf-panel-fields.is-vertical > .nxtf-form-field > .nxtf-form-field-text {
  width: 100%;
}

.nxtpdf-mpdf-warning {
  margin-bottom: 16px;
  padding: 16px;
  border-left: 4px solid #fbbf24;
  background: #fffbeb;
}

.nxtpdf-mpdf-warning-row {
  display: flex;
}

.nxtpdf-mpdf-warning-content {
  margin-left: 12px;
}

.nxtpdf-mpdf-warning-icon {
  width: 20px;
  height: 20px;
  color: #fbbf24;
}

.nxtpdf-mpdf-warning-text {
  margin: 0;
  color: #b45309;
  font-size: 14px;
}

.nxtpdf-mpdf-warning-code {
  display: inline-block;
  margin: 0 2px;
  padding: 0 4px;
  border-radius: 4px;
  background: #fef3c7;
}

.nxtpdf-mpdf-warning-path {
  font-size: 12px;
}

.nxtpdf-editor-layout {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.nxtpdf-editor-sidebar {
  width: 26rem;
  min-width: 392px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #f8fafc;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.nxtpdf-editor-sidebar form[data-nxtpdf-form] {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.nxtpdf-editor-sidebar .content-section {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.nxtpdf-editor-group-header {
  margin-bottom: 14px;
  padding: 0 4px;
}

.nxtpdf-editor-group-title {
  margin: 0 !important;
  color: #0f172a;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0;
}

.nxtpdf-editor-group-description {
  margin: 4px 0 0 !important;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
}

.nxtpdf-editor-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid #dbe2ea;
  background: #ffffff;
  box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.05);
}

.nxtpdf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 8px 16px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.nxtpdf-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.nxtpdf-btn-block {
  flex: 1;
}

.nxtpdf-btn-secondary {
  border-color: #d1d5db;
  background: #fff;
  color: #374151;
}

.nxtpdf-btn-secondary:hover {
  background: #f9fafb;
}

.nxtpdf-btn-primary {
  border-color: transparent;
  background: #2563eb;
  color: #fff;
}

.nxtpdf-btn-primary:hover {
  background: #1d4ed8;
}

.nxtpdf-btn-compact {
  gap: 6px;
  border-radius: 4px;
  padding: 6px 12px;
}

.nxtpdf-btn-icon {
  width: 16px;
  height: 16px;
}

.nxtpdf-preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.nxtpdf-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.nxtpdf-preview-toolbar-title {
  margin: 0;
  color: #374151;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
}

.nxtpdf-preview-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nxtpdf-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.nxtpdf-icon-btn:hover {
  background: #f9fafb;
}

.nxtpdf-icon-btn-icon {
  width: 16px;
  height: 16px;
  color: #4b5563;
}

.nxtpdf-zoom-level {
  min-width: 45px;
  text-align: center;
  color: #6b7280;
  font-size: 12px;
}

.nxtpdf-preview-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 20px;
  background: #4b5563;
}

.nxtpdf-preview-loading {
  display: flex; /* ← was missing */
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 10;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 16px 24px;
}

.nxtpdf-spinner {
  width: 24px;
  height: 24px;
  animation: nxtpdfSpin 1s linear infinite;
}

.nxtpdf-spinner-track {
  opacity: 0.25;
}

.nxtpdf-spinner-head {
  opacity: 0.75;
}

.nxtpdf-preview-loading-text {
  font-size: 14px;
}

.nxtpdf-preview-shell {
  position: relative;
}

.nxtpdf-preview-placeholder {
  display: flex; /* ← was missing */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  color: #9ca3af;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

.nxtpdf-preview-placeholder-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.nxtpdf-preview-placeholder-text {
  margin: 0;
  font-size: 14px;
}

.nxtpdf-preview-placeholder-note {
  margin: 8px 0 0;
  color: #fbbf24;
  font-size: 12px;
}

.nxtpdf-setup-wizard-wrap {
  margin: 0 !important;
  padding: 0 !important;
}

.nxtpdf-setup-shell {
  min-height: 100vh;
  background: #f1f5f9;
  padding: 32px 0;
}

.nxtpdf-setup-container {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 16px;
}

.nxtpdf-setup-card {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.nxtpdf-setup-header {
  padding: 24px 24px 20px;
  background: linear-gradient(to right, #0f172a, #334155);
  color: #fff;
}

.nxtpdf-setup-kicker {
  margin: 0 !important;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
}

.nxtpdf-setup-title {
  margin: 8px 0 0 !important;
  color: #fff;
  font-size: 24px;
  line-height: 1.3333;
  font-weight: 700;
}

.nxtpdf-setup-subtitle {
  margin: 8px 0 0 !important;
  color: #cbd5e1;
}

.nxtpdf-setup-progress {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.nxtpdf-setup-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.nxtpdf-setup-progress-text {
  margin: 0 !important;
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
}

.nxtpdf-setup-indicators {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nxtpdf-setup-indicator {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
}

.nxtpdf-setup-indicator.is-current {
  background: #0f172a;
  color: #fff;
}

.nxtpdf-setup-indicator.is-complete {
  background: #059669;
  color: #fff;
}

.nxtpdf-setup-progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 9999px;
  background: #e2e8f0;
}

.nxtpdf-setup-progress-bar {
  height: 100%;
  background: #0f172a;
}

.nxtpdf-setup-form {
  padding: 24px;
}

.nxtpdf-setup-step-head {
  margin-bottom: 24px;
}

.nxtpdf-setup-step-title {
  margin: 0 !important;
  color: #0f172a;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 600;
}

.nxtpdf-setup-step-description {
  margin: 8px 0 0 !important;
  color: #64748b;
}

.nxtpdf-setup-step-fields > * + * {
  margin-top: 20px;
}

.nxtpdf-setup-success {
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  background: #ecfdf5;
  padding: 24px 20px;
}

.nxtpdf-setup-success-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.nxtpdf-setup-success-icon {
  color: #059669;
  font-size: 20px;
}

.nxtpdf-setup-success-title {
  margin: 0 !important;
  color: #065f46;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
}

.nxtpdf-setup-success-description {
  margin: 4px 0 0 !important;
  color: #047857;
  font-size: 14px;
}

.nxtpdf-setup-actions {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.nxtpdf-setup-error {
  margin: 0 !important;
  color: #e11d48;
  font-size: 14px;
}

.nxtpdf-setup-actions-group {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nxtpdf-setup-btn {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 8px 16px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.nxtpdf-setup-btn.is-disabled,
.nxtpdf-setup-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nxtpdf-setup-btn-back {
  border-color: #cbd5e1;
  background: #fff;
  color: #334155;
}

.nxtpdf-setup-btn-back:hover {
  background: #f8fafc;
}

.nxtpdf-setup-btn-skip {
  border-color: transparent;
  background: #f1f5f9;
  color: #334155;
}

.nxtpdf-setup-btn-skip:hover {
  background: #e2e8f0;
}

.nxtpdf-setup-btn-next {
  border-color: transparent;
  background: #0f172a;
  color: #fff;
}

.nxtpdf-setup-btn-next:hover {
  background: #1e293b;
}

.nxtpdf-setup-btn-finish {
  border-color: transparent;
  background: #059669;
  color: #fff;
}

.nxtpdf-setup-btn-finish:hover {
  background: #047857;
}

@media (max-width: 1024px) {
  .nxtpdf-editor-sidebar {
    width: 22rem;
    min-width: 352px;
  }
}

@media (max-width: 900px) {
  .nxtpdf-editor-layout {
    height: auto !important;
    flex-direction: column;
  }

  .nxtpdf-editor-sidebar {
    width: 100%;
    min-width: 0;
    max-height: 55vh;
    border-radius: 10px;
  }

  .nxtpdf-preview-stage {
    min-height: 420px;
  }

  .nxtpdf-setup-actions-group {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}
