/* Layout of forms drawn by the "form" component. Inputs, checkboxes, errors and buttons are in page.css. */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.form-intro, .form-help { color: var(--muted); font-size: .85rem; }
.form-notice { border-left: 2px solid var(--accent); padding: 6px 12px; font-size: .85rem; }
.form-item { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: .85rem; color: var(--muted); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.form-link { font-size: .85rem; }
.form-item textarea { min-height: 6em; resize: vertical; }
.form-localized { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px; align-items: center; font-size: .85rem; color: var(--muted); }
.form-localized + .form-localized { margin-top: 6px; }
.form-actions .btn + .btn { margin-left: 0; }
/* Form data "wide": true uses the whole width (editors). */
.form-wide-form { max-width: none; }
/* A form's title is a section heading, not the page heading. */
.form h1 { font-size: 1.9rem; }
/* In a column the form fills the column. */
.columns-item > .form { max-width: none; }
.columns-item > * + * { margin-top: 24px; }
/* Form data "inline": true draws a one-line bar (text, then the button on the right). */
.form-inline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; max-width: none; padding: 8px 14px; }
.form-inline .form-actions { margin-left: auto; }
.form-inline h1 { font-size: 1.4rem; }
.form-inline .form-item { flex: 1 1 260px; flex-direction: row; align-items: center; gap: 10px; }
.form-inline .form-item .form-label { white-space: nowrap; }
.form-center { margin: 6vh auto 0; width: 100%; }
.form-radios { display: flex; flex-wrap: wrap; gap: 8px; }
.form-radio { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.form-radio:has(input:checked) { border-color: var(--accent); }
.form-swatches { display: inline-flex; }
.form-swatches i { width: 14px; height: 14px; border: 1px solid rgba(127, 127, 127, .5); }

/* Grouped checkboxes (e.g. API key permissions): a heading per group */
.form-grouped { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; }
.form-grouped legend { grid-column: 1 / -1; }
.form-check-group { display: flex; flex-direction: column; gap: 2px; }
.form-check-heading { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.form-check[title] { cursor: help; }

/* The "who" picker: chosen groups and people as chips, a search box with a result list */
.who-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.who-chips:empty::before { content: attr(data-empty); }
.who-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface2); font-size: .85rem; }
.who-chip img, .who-chip > span:first-child, .who-result img, .who-result > span:first-child { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; display: inline-grid;
  place-items: center; background: var(--surface); color: var(--accent); font-size: .75rem; }
.who-remove { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0 4px; }
.who-remove:hover { color: var(--bad); }
.who-search { position: relative; max-width: 420px; }
.who-search input { width: 100%; }
.who-results { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 4px; list-style: none; max-height: 260px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); }
.who-result { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border: 0; border-radius: var(--radius); background: none; color: var(--fg);
  cursor: pointer; font: inherit; text-align: left; }
.who-result:hover, .who-result:focus { background: var(--surface2); }
.who-result small, .who-nobody { color: var(--muted); font-size: .75rem; }
.who-nobody { padding: 6px 8px; }
