body {
  max-width: 720px;
  padding: 0 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem 1.125rem;
  margin-bottom: 1rem;
}

.panel h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.panel p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.row input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font: inherit;
}

.row input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(122, 87, 238, 0.1);
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover {
  background: var(--primary-hover);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-secondary {
  background: var(--bg-muted);
  color: var(--text);
  border: 1px solid var(--border);
}

.button-secondary:hover {
  background: var(--border);
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.625rem 0.875rem;
  margin-bottom: 0.75rem;
}

.controls-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.controls-grid input,
.controls-grid select {
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font: inherit;
  color: var(--text);
}

.controls-grid .checkbox-label {
  flex-direction: row;
  align-items: center;
  align-self: end;
}

.snippet {
  margin: 0.75rem 0 0;
  padding: 0.625rem 0.75rem;
  background: var(--text);
  color: #a5f3b4;
  border-radius: 0.5rem;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-x: auto;
}

#status {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: var(--bg-muted);
}

.outcome {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--primary);
  background: var(--bg-muted);
  border-radius: 0 0.5rem 0.5rem 0;
  font-size: 0.875rem;
}

.hooks-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  font-size: 0.875rem;
}

.append-target {
  margin-top: 0.75rem;
  min-height: 64px;
  border: 2px dashed var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* classPrefix demo: with { classPrefix: 'brand' } the component emits
   .brandListenPrompt* classes, so this page's stylesheet restyles it — a purple
   pill instead of the dark default. Positioning stays with the component (fixed,
   bottom-centre); body-scoping outranks its injected sheet for the colours. */
body .brandListenPrompt {
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 9999px;
  background: var(--primary);
  color: white;
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
}

/* Only inside the appendTo demo box does it leave the viewport edge. */
#appendTarget .brandListenPrompt {
  position: static;
  transform: none;
  margin-top: 0.5rem;
}

.brandListenPromptIcon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* renderPopup demo: an entirely page-owned element. */
.custom-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  z-index: 2147483647;
}

.custom-prompt button {
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
}
