.dap-launcher {
  z-index: 1060;
}

.dap-launcher .btn {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.dap-launcher.has-unseen .btn {
  position: relative;
  border-color: #f59e0b;
  background: #1d4ed8;
  animation: dapLauncherPulse 1.8s ease-in-out infinite;
}

.dap-guide-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
}

@keyframes dapLauncherPulse {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  }
  50% {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16), 0 0 0 5px rgba(245, 158, 11, 0.24);
  }
}

.dap-prompt {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 90px;
  z-index: 1060;
  width: min(340px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
  padding: 16px;
}

.dap-prompt.is-visible {
  display: block;
}

.dap-prompt-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #1d4ed8;
  font-weight: 700;
}

.dap-guide-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}

.dap-guide-item-title {
  font-weight: 700;
}

.dap-guide-item-summary {
  color: #6b7280;
  margin: 4px 0 10px;
}

.dap-guide-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 600;
}

.dap-guide-pill-draft {
  background: #fff7ed;
  color: #9a3412;
}

.dap-builder-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.dap-builder-attachments {
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  margin: 2px 0 18px;
  padding: 18px 0;
}

.dap-builder-attachments-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.dap-builder-attachments-icon {
  display: inline-flex;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  background: #f3f5f8;
  color: #334155;
}

.dap-builder-attachments-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.dap-builder-attachments-header p {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.dap-builder-attachment-save-note {
  border-left: 3px solid #d97706;
  margin-bottom: 10px;
  background: #fffbeb;
  color: #854d0e;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
}

.dap-builder-attachment-upload {
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  padding: 12px;
}

.dap-builder-attachment-upload.is-disabled {
  opacity: 0.6;
}

.dap-builder-attachment-upload .form-label {
  margin-bottom: 4px;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.dap-builder-attachment-upload .form-text {
  margin-top: 5px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.4;
}

.dap-builder-attachment-upload-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin-top: 10px;
}

.dap-builder-attachment-upload-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 31px;
  white-space: nowrap;
}

.dap-builder-attachment-error {
  margin: 10px 0 0;
  padding: 8px 10px;
  font-size: 12px;
}

.dap-builder-attachments-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.dap-builder-attachments-list-header span:last-child {
  color: #64748b;
  font-weight: 500;
}

.dap-builder-attachments-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dap-builder-attachment-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  border-top: 1px solid #e5e7eb;
  padding: 8px 0;
}

.dap-builder-attachment-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #eef2f6;
  color: #475569;
  font-size: 15px;
}

.dap-builder-attachment-details {
  min-width: 0;
}

.dap-builder-attachment-name {
  overflow: hidden;
  color: #1f2937;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dap-builder-attachment-meta {
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
}

.dap-builder-attachment-actions {
  display: flex;
  gap: 4px;
}

.dap-builder-attachment-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #d5dbe5;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  text-decoration: none;
}

.dap-builder-attachment-action:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #0f172a;
  text-decoration: none;
}

.dap-builder-attachment-delete:hover {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.dap-builder-attachment-action:disabled {
  cursor: wait;
  opacity: 0.5;
}

.dap-builder-attachment-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #e5e7eb;
  padding: 12px 2px 2px;
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 1199.98px) {
  .dap-builder-attachment-upload-actions {
    grid-template-columns: 1fr;
  }

  .dap-builder-attachment-upload-actions .btn {
    width: 100%;
  }
}

.dap-builder-howto {
  background: #f8fafc;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  color: #1f2937;
}

.dap-builder-howto summary {
  cursor: pointer;
  font-weight: 700;
  padding: 12px 14px;
}

.dap-builder-howto-body {
  border-top: 1px solid #dbe3ef;
  padding: 14px;
}

.dap-builder-howto-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dap-builder-howto dt {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
  text-transform: uppercase;
}

.dap-builder-howto dd {
  margin-bottom: 0;
}

.dap-builder-howto code {
  color: #0f172a;
  background: #e8eef7;
  border-radius: 4px;
  padding: 2px 5px;
  white-space: normal;
  word-break: break-word;
}

.dap-rich-text {
  overflow-wrap: anywhere;
  white-space: normal;
}

.dap-rich-text > :first-child {
  margin-top: 0;
}

.dap-rich-text > :last-child {
  margin-bottom: 0;
}

.dap-rich-text p {
  margin: 0 0 10px;
}

.dap-rich-text h1,
.dap-rich-text h2,
.dap-rich-text h3 {
  color: #111827;
  letter-spacing: 0;
  line-height: 1.3;
  margin: 14px 0 7px;
}

.dap-rich-text h1 {
  font-size: 1.25rem;
}

.dap-rich-text h2 {
  font-size: 1.1rem;
}

.dap-rich-text h3 {
  font-size: 1rem;
}

.dap-rich-text ul,
.dap-rich-text ol {
  margin: 0 0 10px;
  padding-left: 22px;
}

.dap-rich-text li + li {
  margin-top: 4px;
}

.dap-rich-text code {
  border-radius: 4px;
  background: #e8eef7;
  color: #0f172a;
  padding: 1px 4px;
}

.dap-rich-text a {
  color: #0d6efd;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 991.98px) {
  .dap-builder-howto-grid {
    grid-template-columns: 1fr;
  }
}

.dap-capture-toolbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 21000;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #111827;
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.28);
}

.dap-capture-toolbar button,
.dap-capture-toolbar a {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  padding: 4px 8px;
  font-size: 13px;
}

.dap-capture-toolbar .dap-capture-mode-toggle.is-active {
  border-color: #38bdf8;
  background: #0ea5e9;
}

.dap-capture-toolbar .dap-capture-mode-toggle.is-interact {
  border-color: #fbbf24;
  background: #b45309;
}

.dap-capture-toolbar .dap-after-action-toggle.is-after {
  border-color: #fbbf24;
  background: #d97706;
}

.dap-capture-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.dap-preview-toolbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 23000;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  background: #111827;
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.28);
}

.dap-preview-toolbar-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dap-preview-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  border-radius: 999px;
  background: #0ea5e9;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.dap-preview-step-label {
  max-width: min(360px, 38vw);
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dap-preview-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dap-preview-toolbar button {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  padding: 4px 8px;
  font-size: 13px;
}

.dap-preview-toolbar button:hover:not(:disabled) {
  border-color: #93c5fd;
  background: rgba(37, 99, 235, 0.34);
}

.dap-preview-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.dap-preview-toolbar.is-saving {
  opacity: 0.82;
}

@media (max-width: 767.98px) {
  .dap-preview-toolbar {
    right: 12px;
    left: 12px;
    transform: none;
    flex-direction: column;
    align-items: stretch;
  }

  .dap-preview-step-label {
    max-width: none;
  }

  .dap-preview-toolbar-actions {
    justify-content: flex-start;
  }
}

.dap-step-reveal-controls {
  border-top: 1px solid #e5e7eb;
  padding-top: 8px;
}

.dap-step-config {
  display: grid;
  gap: 10px;
  min-width: 280px;
}

.dap-step-config-section {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
}

.dap-step-config-title {
  color: #111827;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.dap-step-config-help {
  color: #6b7280;
  font-size: 11px;
  line-height: 1.35;
  margin-top: 5px;
}

.dap-step-config .form-control-sm,
.dap-step-config .form-select-sm {
  font-size: 12px;
}

.dap-step-content-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 22000;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.36);
  padding: 16px;
}

.dap-step-content-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  color: #111827;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  padding: 18px;
}

.dap-step-content-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.dap-step-content-header h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.dap-step-content-header p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.dap-step-content-close {
  width: 32px;
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  font-size: 22px;
  line-height: 1;
}

.dap-step-content-target {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 12px;
}

.dap-step-content-target span {
  color: #64748b;
  font-weight: 700;
}

.dap-step-content-target code {
  overflow-wrap: anywhere;
}

.dap-step-content-target strong {
  color: #b45309;
}

.dap-step-content-dialog label {
  display: block;
  margin: 10px 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.dap-step-content-dialog input,
.dap-step-content-dialog textarea,
.dap-step-content-dialog select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 10px;
  color: #111827;
  font-size: 14px;
}

.dap-step-content-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
}

.dap-step-content-check input {
  width: auto;
}

.dap-step-content-section {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.dap-step-content-section h4 {
  margin: 0 0 4px;
  color: #111827;
  font-size: 14px;
}

.dap-step-content-section p,
.dap-step-content-help {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.dap-step-content-help {
  margin: 6px 0 0;
}

.dap-step-content-help code {
  color: #0f172a;
  background: #e8eef7;
  border-radius: 4px;
  padding: 2px 5px;
}

.dap-step-content-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.dap-step-content-actions button {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  padding: 7px 12px;
}

.dap-step-content-actions .dap-step-content-save {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.dap-preview-edit-backdrop {
  position: fixed;
  inset: 0;
  z-index: 24000;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
  padding: 16px;
}

.dap-preview-edit-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  color: #111827;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  padding: 18px;
}

.dap-preview-edit-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.dap-preview-edit-header h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.dap-preview-edit-header p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.dap-preview-edit-close {
  width: 32px;
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  font-size: 22px;
  line-height: 1;
}

.dap-preview-edit-dialog label {
  display: block;
  margin: 10px 0 4px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.dap-preview-edit-dialog input,
.dap-preview-edit-dialog textarea,
.dap-preview-edit-dialog select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 10px;
  color: #111827;
  font-size: 14px;
}

.dap-preview-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dap-preview-edit-help {
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
}

.dap-preview-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.dap-preview-edit-actions button {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  padding: 7px 12px;
}

.dap-preview-edit-actions .dap-preview-edit-save {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

@media (max-width: 767.98px) {
  .dap-preview-edit-grid {
    grid-template-columns: 1fr;
  }
}

.dap-capture-highlight {
  outline: 3px solid #f59e0b !important;
  outline-offset: 3px !important;
}

.dap-capture-hover {
  outline: 3px solid #38bdf8 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18) !important;
  cursor: crosshair !important;
}
