/* goonlab: a customer's personas (templates/bots/_personas.html,
   docs/bots/spec/70-personas.md, section 5), on the Profile page and in the
   Start box of a bot's page (templates/bots/_start_box.html). The site's own
   sheets style the buttons, the pills and the error boxes; nothing here
   touches another part of a page. */

.personas-title { margin-top: 2rem; }

.personas { display: flex; flex-direction: column; gap: 0.8rem; width: 100%; min-width: 0; }
.personas p { margin: 0; }
.personas [hidden] { display: none !important; }
.personas .hint, .bot-start-persona .hint { font-size: 0.8rem; color: var(--muted); margin: 0; }

.personas-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.persona {
  display: flex; flex-direction: column; gap: 0.45rem; min-width: 0;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.8rem 1rem;
}
.persona-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; min-width: 0; }
.persona-name { overflow-wrap: anywhere; }
/* the text with its line breaks as he typed them */
.persona-about { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font-size: 0.92rem; }

.persona-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.persona-buttons form { margin: 0; }
.personas summary, .bot-start-personas > summary { list-style: none; cursor: pointer; display: inline-block; }
.personas summary::-webkit-details-marker, .bot-start-personas > summary::-webkit-details-marker { display: none; }
/* an open form takes the whole width, below the row's other buttons; its
   own "Cancel" closes it */
.persona-edit[open] { order: 2; flex-basis: 100%; }
.persona-edit[open] > summary, .persona-new[open] > summary { display: none; }

.persona-form { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.4rem; }
.persona-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.persona-label {
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.persona-form input[type="text"], .persona-form textarea, .bot-start-persona select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 0.55rem 0.75rem;
  font: inherit;
  /* at least 16 pixels: a phone zooms the page into a smaller field */
  font-size: 16px;
}
.persona .persona-form input[type="text"], .persona .persona-form textarea { background: var(--panel); }
.persona-form textarea { resize: vertical; min-height: 6rem; }
.persona-form input[type="text"]:focus, .persona-form textarea:focus, .bot-start-persona select:focus {
  border-color: var(--accent); outline: none;
}
.persona-tick { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.92rem; cursor: pointer; }
.persona-tick input { margin-top: 0.2rem; accent-color: var(--accent); }

/* the Start box: the choice, its note and "Edit your personas", before the
   start form */
.bot-start-persona { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; min-width: 0; }
.bot-start-personas { width: 100%; }
.bot-start-personas[open] > summary { margin-bottom: 0.6rem; }

@media (max-width: 720px) {
  .persona-buttons .btn, .personas summary.btn, .bot-start-personas > summary.btn { min-height: 44px; }
  /* no text under 12 pixels on a phone (docs/bots/spec/93-corrections-for-phones.md,
     section 5): the small headings, in their own letters and spacing */
  .persona-label { font-size: 12.5px; }
}
