/* Prompt Box — styles for blockquotes upgraded to prompt boxes.
 *
 * Theme-agnostic on purpose: text colour is inherited and every tint is a
 * translucent grey, so it reads on light and dark themes alike. Override
 * these custom properties from a theme or Customizer CSS to restyle:
 *
 *   --bhpb-accent   button / selection colour   (default #2563eb)
 *   --bhpb-height   height of the prompt area   (default 350px)
 */

.bhpb-source[hidden] { display: none !important; }

.bhpb {
  --bhpb-line: rgba(127, 127, 127, .35);
  margin: 1.5rem 0;
  border: 1px solid var(--bhpb-line);
  border-radius: .75rem;
  overflow: hidden;
  background: rgba(127, 127, 127, .06);
  color: inherit;
  font-family: inherit;
  font-style: normal;
  font-weight: 400;
  quotes: none;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bhpb *, .bhpb *::before, .bhpb *::after { box-sizing: border-box; }
.bhpb:focus-within {
  border-color: var(--bhpb-accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

/* ── Header ───────────────────────────────────────────────────────────── */
.bhpb__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .5rem .5rem .5rem .875rem;
  background: rgba(127, 127, 127, .12);
  border-bottom: 1px solid var(--bhpb-line);
}
.bhpb__title {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .8;
}
.bhpb__title svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.bhpb__copy {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  padding: .35rem .75rem;
  font: inherit;
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  background: var(--bhpb-accent, #2563eb);
  border: 0;
  border-radius: .5rem;
  cursor: pointer;
  transition: filter .15s ease, background .15s ease;
}
.bhpb__copy:hover { filter: brightness(1.1); }
.bhpb__copy svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.bhpb__copy.is-done { background: #16a34a; }
.bhpb__copy.is-failed { background: #dc2626; }

/* ── Prompt text: fixed height, scrolls ───────────────────────────────── */
.bhpb__text {
  display: block;
  width: 100%;
  height: var(--bhpb-height, 350px);
  margin: 0;
  padding: .875rem 1rem;
  border: 0;
  border-radius: 0;
  outline: none;
  resize: none;
  overflow-y: auto;
  background: transparent;
  color: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
  font-style: normal;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  scrollbar-color: rgba(127, 127, 127, .55) transparent;
}
.bhpb__text::-webkit-scrollbar { width: 10px; }
.bhpb__text::-webkit-scrollbar-track { background: transparent; }
.bhpb__text::-webkit-scrollbar-thumb {
  background: rgba(127, 127, 127, .45);
  border: 2px solid transparent;
  border-radius: 9999px;
  background-clip: content-box;
}
.bhpb__text::-webkit-scrollbar-thumb:hover {
  background: rgba(127, 127, 127, .7);
  background-clip: content-box;
}

/* ── Variable buttons ─────────────────────────────────────────────────── */
.bhpb__vars {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  padding: .75rem .875rem .875rem;
  border-top: 1px solid var(--bhpb-line);
}
.bhpb__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .5rem;
}
.bhpb__label {
  flex: 0 0 6rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .03em;
  opacity: .7;
}
.bhpb__chip {
  margin: 0;
  padding: .25rem .7rem;
  font: inherit;
  font-size: .8125rem;
  line-height: 1.45;
  color: inherit;
  background: transparent;
  border: 1px solid rgba(127, 127, 127, .45);
  border-radius: 9999px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.bhpb__chip:hover { border-color: var(--bhpb-accent, #2563eb); }
.bhpb__chip[aria-pressed="true"] {
  color: #fff;
  background: var(--bhpb-accent, #2563eb);
  border-color: var(--bhpb-accent, #2563eb);
}
.bhpb__copy:focus-visible,
.bhpb__chip:focus-visible {
  outline: 2px solid var(--bhpb-accent, #2563eb);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .bhpb__label { flex-basis: 100%; }
  .bhpb__text { font-size: .875rem; }
}

@media print {
  .bhpb__vars, .bhpb__copy { display: none; }
}
