/* ── The modal kit (ModalComponent, AlignedFormBuilder), from the mock-ups ───
   Wide centred modals with header / body / footer bars and aligned label rows:
   an 11rem label column, stacked under 560px, errors inline under the field. */
.pmodal:has(.pmodal-panel) { width: min(720px, calc(100vw - 2rem)); }
.pmodal:has(.pmodal-panel.is-narrow) { width: min(34rem, calc(100vw - 2rem)); }
.pmodal:has(.pmodal-panel) .pmodal-card { padding: 0; }
.pmodal-panel { display: flex; flex-direction: column; max-height: calc(100vh - 2rem); }
.modal-h { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: var(--s3) calc(var(--s4) + 2rem) var(--s3) var(--s4); border-bottom: 1px solid var(--edge); }
.modal-h .pmodal-title { flex: 1; margin: 0; font-size: var(--t16); }
.modal-b { display: grid; gap: var(--s3); padding: var(--s4); overflow: auto; }
/* An open type-ahead's list hangs over the modal's edge rather than being clipped by it. */
.pmodal:has(.typeahead-list:not([hidden])), .pmodal-panel:has(.typeahead-list:not([hidden])), .modal-b:has(.typeahead-list:not([hidden])) { overflow: visible; }
.modal-f { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s2); padding: var(--s3) var(--s4); border-top: 1px solid var(--edge); }
.modal-f.split { justify-content: space-between; }
.modal-f-left, .modal-f-right { display: flex; flex-wrap: wrap; gap: var(--s2); }
.modal-f-right { margin-left: auto; }

.field { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--s1) var(--s3); align-items: start; }
.field > label, .field > .lbl { padding-top: 9px; font-size: var(--t13); color: var(--ink-3); }
.field-c { display: grid; gap: var(--s1); min-width: 0; }
.field-c > input:not([type=checkbox]):not([type=radio]), .field-c > select, .field-c > textarea {
  width: 100%; height: var(--ctl); background: var(--well); color: var(--ink);
  border: 1px solid var(--edge-2); border-radius: var(--r);
  padding: 0 var(--s3); font: var(--t14) var(--body);
}
.field-c > textarea { height: auto; min-height: calc(var(--ctl) * 2); padding: var(--s2) var(--s3); }
.field-c > input.mono { font-family: var(--mono); }
/* An errored field's input sits in Rails' .field_with_errors wrapper: styled the same. */
.field-c > .field_with_errors { display: contents; }
.field-c > .field_with_errors > input:not([type=checkbox]):not([type=radio]), .field-c > .field_with_errors > select,
.field-c > .field_with_errors > textarea {
  width: 100%; height: var(--ctl); background: var(--well); color: var(--ink);
  border: 1px solid var(--edge-2); border-radius: var(--r);
  padding: 0 var(--s3); font: var(--t14) var(--body);
}
.field-c > .field_with_errors > textarea { height: auto; min-height: calc(var(--ctl) * 2); padding: var(--s2) var(--s3); }
.field-c > .field_with_errors > input.mono { font-family: var(--mono); }
.field .ro { min-height: var(--ctl); display: flex; align-items: center; color: var(--ink); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--rust); }
.err { margin: 0; color: var(--rust-ink); font-size: var(--t13); }
.btn-shell.primary { background: var(--green); border-color: var(--green); color: var(--on-accent); }
.btn-shell.danger { color: var(--rust-ink); }
@media (max-width: 559.98px) {
  .field { grid-template-columns: 1fr; }
  .field > label, .field > .lbl { padding-top: 0; }
}

/* The Team modal's role list and tick trees (docs/mockups/stores.html). */
.rlist, .ticks, .tree { display: grid; gap: var(--s1); }
.ropt { display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 10px; align-items: center; cursor: pointer; padding-bottom: var(--s2); }
.ropt input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.ropt .nm { min-height: var(--ctl-sm); display: flex; align-items: center; color: var(--ink); font-size: var(--t14); }
.ropt .cp { grid-column: 2; font-size: var(--t12); color: var(--ink-3); }
.chk { display: flex; align-items: center; gap: var(--s2); min-height: var(--ctl-sm); margin: 0; color: var(--ink); font-size: var(--t14); cursor: pointer; }
.chk input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--green); }
.chk.ln { padding-left: 26px; }
.team-form { display: grid; gap: var(--s4); }

/* IT's user modal: a section per line with its Admin of tick. */
.user-form { display: grid; gap: var(--s3); }
.sec-ticks { display: grid; gap: 2px; }
.sec-tick { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s3); }
.sec-tick .admin-of { color: var(--ink-3); font-size: var(--t13); }

/* The two-step pickers (Ui::MmnItemPickerComponent, Ui::IndentPickerComponent):
   the picked document with Change, then its options; an option the caller
   disables stays listed with its reason. */
.picker-pick { display: inline-flex; align-items: center; min-height: var(--ctl-sm); color: var(--ink); font-weight: 500; }
.picker-change { margin-left: var(--s3); font-size: var(--t13); }
.ropt.off { cursor: not-allowed; }
.ropt.off .nm { color: var(--ink-3); }
.picker-hint { font-size: var(--t12); color: var(--ink-3); }
