/* redpol_v542: form and message layout stability */

.app-shell-unified-v211 form,
.app-shell-unified-v211 .form-box,
.app-shell-unified-v211 .form-stack,
.app-shell-unified-v211 .form-grid,
.app-shell-unified-v211 .form-card,
.app-shell-unified-v211 .filter-card,
.app-shell-unified-v211 .soft-panel {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

.app-shell-unified-v211 .form-grid,
.app-shell-unified-v211 .form-row,
.app-shell-unified-v211 .fields-grid,
.app-shell-unified-v211 .field-grid,
.app-shell-unified-v211 .admin-ui-v229 .form-grid,
.app-shell-unified-v211 .acc-form-grid-v251,
.app-shell-unified-v211 .fik-form-grid,
.app-shell-unified-v211 .rent-form-grid,
.app-shell-unified-v211 .maint-form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  max-width: 100%;
  min-width: 0;
}

.app-shell-unified-v211 .form-group,
.app-shell-unified-v211 .field-wrap,
.app-shell-unified-v211 .form-field,
.app-shell-unified-v211 .acc-field-v251,
.app-shell-unified-v211 .filter-field,
.app-shell-unified-v211 label {
  max-width: 100%;
  min-width: 0;
}

.app-shell-unified-v211 label,
.app-shell-unified-v211 .form-label,
.app-shell-unified-v211 .field-label,
.app-shell-unified-v211 .helptext,
.app-shell-unified-v211 .form-help,
.app-shell-unified-v211 .form-text,
.app-shell-unified-v211 .muted,
.app-shell-unified-v211 .field-error,
.app-shell-unified-v211 .form-error,
.app-shell-unified-v211 .errorlist,
.app-shell-unified-v211 .nonfield {
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: normal;
}

.app-shell-unified-v211 input,
.app-shell-unified-v211 select,
.app-shell-unified-v211 textarea,
.app-shell-unified-v211 .form-control,
.app-shell-unified-v211 .field-control {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

.app-shell-unified-v211 textarea {
  overflow-wrap: anywhere;
  resize: vertical;
}

.app-shell-unified-v211 .form-actions,
.app-shell-unified-v211 .actions,
.app-shell-unified-v211 .button-row,
.app-shell-unified-v211 .btn-row,
.app-shell-unified-v211 .submit-row,
.app-shell-unified-v211 .page-actions,
.app-shell-unified-v211 .admin-actions-v229,
.app-shell-unified-v211 .acc-form-actions-v251,
.app-shell-unified-v211 .fik-section-actions,
.app-shell-unified-v211 .fik-topbar__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
}

/* PR #274 (2026-05-23): catch-all'e button/input[type="submit"]:not(.app-btn) USUNIETE.
   Pozostaly nazwane warianty (.btn, .admin-btn-v229, .acc-btn-v245, .fik-btn). */
.app-shell-unified-v211 .btn,
.app-shell-unified-v211 .admin-btn-v229,
.app-shell-unified-v211 .acc-btn-v245,
.app-shell-unified-v211 .fik-btn {
  max-width: 100%;
  min-width: 0;
  white-space: normal;
}

.app-shell-unified-v211 .message-stack,
.app-shell-unified-v211 .messages,
.app-shell-unified-v211 .alerts,
.app-shell-unified-v211 .alert-list {
  display: grid;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
}

.app-shell-unified-v211 .message,
.app-shell-unified-v211 .message-item,
.app-shell-unified-v211 .alert,
.app-shell-unified-v211 .alert-success,
.app-shell-unified-v211 .alert-danger,
.app-shell-unified-v211 .alert-warning,
.app-shell-unified-v211 .alert-info {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.app-shell-unified-v211 .errorlist {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.app-shell-unified-v211 .errorlist li,
.app-shell-unified-v211 .field-error,
.app-shell-unified-v211 .form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #991b1b;
  padding: 7px 9px;
}

@media (max-width: 760px) {
  .app-shell-unified-v211 .form-actions,
  .app-shell-unified-v211 .actions,
  .app-shell-unified-v211 .button-row,
  .app-shell-unified-v211 .btn-row,
  .app-shell-unified-v211 .submit-row,
  .app-shell-unified-v211 .page-actions,
  .app-shell-unified-v211 .admin-actions-v229,
  .app-shell-unified-v211 .acc-form-actions-v251,
  .app-shell-unified-v211 .fik-section-actions,
  .app-shell-unified-v211 .fik-topbar__actions {
    align-items: stretch;
  }

  .app-shell-unified-v211 .form-actions > *,
  .app-shell-unified-v211 .actions > *,
  .app-shell-unified-v211 .button-row > *,
  .app-shell-unified-v211 .btn-row > *,
  .app-shell-unified-v211 .submit-row > *,
  .app-shell-unified-v211 .page-actions > * {
    flex: 1 1 180px;
  }
}
