details.card-collapse > summary {
  list-style: none;
}

details.card-collapse > summary::-webkit-details-marker {
  display: none;
}

.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 1px solid #9ca3af;
  border-radius: 9999px;
  background: #fff;
  color: #6b7280;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.help-btn:hover {
  background: #f3f4f6;
  color: #111827;
  border-color: #6b7280;
}

.help-btn--header {
  border-color: #9ca3af;
  background: transparent;
  color: #d1d5db;
}

.help-btn--header:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: #e5e7eb;
}

.help-btn--lg {
  width: 22px;
  height: 22px;
  font-size: 11px;
}

.app-dialog {
  position: relative;
  width: min(92vw, 380px);
  max-height: min(75vh, 480px);
  margin: auto;
  padding: 14px 16px 14px;
  border: 0;
  border-radius: 2px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  background: #fff;
  color: #111827;
}

.app-dialog--wide {
  width: min(94vw, 720px);
  max-height: min(85vh, 640px);
  padding: 12px 12px 0;
  overflow: hidden;
}

.app-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.app-dialog__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9ca3af;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.app-dialog__close:hover {
  color: #111827;
}

.app-dialog__title {
  margin: 0 28px 8px 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #111827;
}

.app-dialog__body {
  overflow-y: auto;
  max-height: calc(75vh - 56px);
  font-size: 12px;
  line-height: 1.5;
  color: #4b5563;
}

.prose-help p {
  margin: 0 0 0.65em;
}

.prose-help p:last-child {
  margin-bottom: 0;
}

.prose-help ul {
  margin: 0.35em 0 0.65em;
  padding-left: 1.15em;
}

.prose-help li {
  margin-bottom: 0.2em;
}

.prose-help code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  background: #f3f4f6;
  padding: 0.05em 0.3em;
  border-radius: 2px;
}

.app-dialog__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin: 0 28px 10px 0;
}

.app-dialog--wide .app-dialog__title {
  margin: 0;
}

.app-dialog__file {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  color: #9ca3af;
}

.source-tabs {
  display: flex;
  gap: 10px;
}

.source-tab {
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: #9ca3af;
  font-size: 11px;
  cursor: pointer;
}

.source-tab:hover {
  color: #4b5563;
}

.source-tab--active {
  color: #111827;
  border-bottom-color: #111827;
}

.app-dialog__code {
  margin: 0 -12px;
  padding: 10px 12px;
  overflow: auto;
  background: #111827;
  color: #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre;
}

.app-dialog--wide .app-dialog__code {
  max-height: calc(min(85vh, 640px) - 56px);
}

.app-dialog__code code {
  font: inherit;
  color: inherit;
}

.app-dialog__status {
  margin: 0;
  padding: 6px 0;
  font-size: 11px;
  color: #6b7280;
}

.app-dialog__status--error {
  color: #b91c1c;
}
