/* Admin portal (app/templates/portal): the few rules that tokens.css, layout.css, controls.css, data.css and pages.css
   do not already give. Tokens only. A later pass restyles the portal; the class names are the stable part. */

/* the sign-in page has no side panel: one centred column */
.auth.portal-auth { grid-template-columns: minmax(0, 1fr); justify-items: center; background: var(--bg); }
.portal-auth .auth-main { width: min(480px, 100%); }

/* filter links above a list */
.portal-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

/* a link inside a table row: a comfortable tap target on a phone */
.portal-link { font-weight: var(--weight-medium); }
@media (max-width: 639.98px) {
  .portal-table td.card-main > .portal-link { display: inline-flex; align-items: center; min-height: 44px; }
}
.portal-toolbar .search-input { flex: 1 1 260px; min-width: 0; }
.portal-toolbar .search-input input { width: 100%; }

/* label and value pairs (a request's details) */
.portal-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.portal-facts dt { color: var(--muted); font-size: var(--text-sm); }
.portal-facts dd { margin: 0; overflow-wrap: anywhere; }
.portal-message { white-space: pre-wrap; }
@media (max-width: 639.98px) {
  .portal-facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .portal-facts dd { margin-bottom: 10px; }
}

/* forms: a column of fields, or fields in a row that wraps */
.portal-form { display: flex; flex-direction: column; gap: var(--space-4); max-width: 640px; }
.portal-form-row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; max-width: none; }
.portal-form-row .field { margin: 0; flex: 1 1 220px; min-width: 0; }
.portal-form-row .btn { flex: none; }
.portal-form .field, .portal-form input, .portal-form select { max-width: 100%; }
.portal-inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.portal-inline-form .field { margin: 0; }
.portal-invite { border-top: 1px solid var(--hairline); }

/* the buttons of one table row */
.portal-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-row-actions form { margin: 0; }

/* a mailbox's error text: the reason, one short line, no mail content */
.portal-error { margin-top: 4px; color: var(--critical-ink, var(--critical)); font-size: var(--text-sm); overflow-wrap: anywhere; }
