/* /agent/: copyable prompts, laid out like railspike.dev's install prompt. */
.agent-page__prompt + .agent-page__prompt {
  margin-top: 1.5rem;
}

.copy-prompt__label {
  margin: 0 0 0.5rem;
}

.copy-prompt__field {
  position: relative;
}

/* The prompt: selectable text in a quiet box, not a form field. */
.copy-prompt__text {
  box-sizing: border-box;
  /* Never shorter than Copy. */
  min-height: calc(44px + 0.8rem + 2px);
  margin: 0;
  /* Room for Copy in the top right corner, so text never runs under it. */
  padding: 0.75rem 3.6rem 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--panel);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* A tall shared prompt, cut off by agent.php's script: its end fades out
   (a mask, so it works on any theme's background) above "Show all". */
.copy-prompt__text.is-cut {
  max-height: 16rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 3rem), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 3rem), transparent);
}

/* `:root` outranks themes that stretch buttons on phones. */
:root .copy-prompt__more {
  display: inline-block;
  width: auto;
  margin: 0.4rem 0 0;
}

:root .copy-prompt__more[hidden] {
  display: none;
}

/* Icon only, in the box's top right corner. `:root` outranks themes that
   stretch buttons on phones. */
:root .copy-prompt__button {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 0;
  height: 44px;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.copy-prompt__icon--copied,
.copy-prompt__button[data-copied] .copy-prompt__icon {
  display: none;
}

.copy-prompt__button[data-copied] .copy-prompt__icon--copied {
  display: inline;
}

:root .copy-prompt__button[hidden] {
  display: none;
}

.copy-prompt__status {
  min-height: 1.4em;
  margin: 0.35rem 0 0;
}

/* The prompt library: toolbar and category links reuse the board's, each
   shared prompt is a card with the same copyable text. */
.prompt-library__toolbar,
.prompt-library__categories {
  flex-wrap: wrap;
}

.prompt-library__categories {
  margin-top: 0.6rem;
}

.prompt-library__share {
  margin-left: auto;
}

.prompt-library__list {
  margin-top: 1rem;
}

.prompt-card + .prompt-card {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.prompt-card[hidden] {
  display: none;
}

.prompt-card__title {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
}

/* The card's last row: tags on the left, author/date/likes/Discuss on the
   right. When both don't fit, the meta line wraps below, still on the right. */
.prompt-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
}

.prompt-card__meta {
  margin: 0 0 0 auto;
  text-align: right;
}

.prompt-card__tags {
  margin: 0;
}

/* The like count carries its own separator so nothing shows at zero. */
.prompt-card__likes:not(:empty)::before {
  content: " · ";
}

/* Like sits in the meta line; `:root` outranks themes that stretch buttons
   on phones. */
:root .prompt-card__like {
  display: inline-block;
  width: auto;
  margin: 0 0 0 0.5rem;
  vertical-align: baseline;
}

.prompt-card__feedback {
  margin: 0.35rem 0 0;
  text-align: right;
}

.prompt-card__tags .chip {
  text-decoration: none;
}

.copy-prompt--library .copy-prompt__status {
  min-height: 0;
}

.prompt-library__empty {
  margin: 1rem 0 0;
}

.prompt-library__waiting {
  margin-top: 1.25rem;
}

.prompt-library__waiting ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.agent-page__start-heading {
  margin-top: 0;
}

.agent-page__prompt h3 {
  margin-bottom: 0.25rem;
}
